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

Pin sub-crate versions #410

Closed
ShaddyDC opened this issue Jan 8, 2024 · 1 comment
Closed

Pin sub-crate versions #410

ShaddyDC opened this issue Jan 8, 2024 · 1 comment

Comments

@ShaddyDC
Copy link
Contributor

ShaddyDC commented Jan 8, 2024

I guess this won't be relevant much longer in the context of #409, but it would be nice right now.

The problem is, you currently cannot pin a version of this crate because it doesn't pin its subcrates.
That is, as described here, a version of the form "1.3.0" is implicitly "^1.3.0" and thus also accepts "1.4.0" as valid, assuming it to be a semantic version.
You can pin the gltf crate with "=1.3.0", but because it depends on gltf-json = { path = "gltf-json", version = "1.3.0" }, it will try to load gltf-json version "1.4.0", which isn't compatible and leads to compile errors:

error[E0308]: mismatched types
  --> /home/space/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gltf-1.3.0/src/accessor/sparse.rs:41:9
   |
40 |     pub fn offset(&self) -> u32 {
   |                             --- expected `u32` because of return type
41 |         self.json.byte_offset
   |         ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `USize64`

etc

I am a bit surprised it loads the subcrates from cargo separately, but I guess that's just how the resolution works?

Now, this can be mitigated with a lock-file, but it breaks if you want to update that lockfile.
As a simple fix until version 2.0 is released, I suggest just pinning the sub-crates (ie gltf-json = { path = "gltf-json", version = "=1.4.0" }).
Then again, if 2.0 is the next release, it probably doesn't really matter anymore at this point.

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