Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected archive schema string does not match generated resource schema. #233

Open
hallahan opened this issue Oct 25, 2022 · 2 comments
Open

Comments

@hallahan
Copy link
Contributor

I am on the latest commit of master (b1d77cb), and I am having issues with loading archives after modifying the schema. Playing around with osmflat-rs, I added a few things to the schema. I am able to compile OSM data fine, but when I try and open an archive (using the debug example), I get ResourceStorageError.WrongSignature.

Digging in a bit, it looks like flatdata-generator and the archive.schema written to the data directory do not match with their tags. The check to see if the stored schema and expected schema is simply doing a string compare, and this fails.

        if stored_schema != expected_schema {
            return Err(ResourceStorageError::WrongSignature {
                resource_name: resource_name.into(),
                diff: compute_diff(stored_schema, expected_schema),
            });
        }

I generate the rust file like so:

flatdata-generator -s /Users/n/code/osmflat-rs/flatdata/osm.flatdata -g rust -O /Users/n/code/osmflat-rs/osmflat/src/exp_gen.rs 

From the generated file, the OSM raw string representing the schema does not have a tab indenting the contents of the namespace. The archive.schema file does.

Screen Shot 2022-10-25 at 2 05 57 PM

@hallahan
Copy link
Contributor Author

There is something weird about this, because I can't seem to reproduce it consistently.

@VeaaC
Copy link
Collaborator

VeaaC commented Oct 26, 2022

That is a bit weird, normally the same string is used for writing the archive's schema, as well as for checking it.

Do you maybe have some kind of automatic reformatting tool/setting configured in your IDE/Git/etc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants