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

jpegxl-rs and jpegxl-sys version mismatch fails to compile #89

Open
y-guyon opened this issue Sep 18, 2024 · 1 comment
Open

jpegxl-rs and jpegxl-sys version mismatch fails to compile #89

y-guyon opened this issue Sep 18, 2024 · 1 comment

Comments

@y-guyon
Copy link

y-guyon commented Sep 18, 2024

Having the following in my Cargo.toml:

[dependencies]
jpegxl-rs = { version = "=0.10.3", features = ["vendored"] }

somehow led to cargo build failing with:

error[E0308]: mismatched types
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jpegxl-rs-0.10.3+libjxl-0.10.2/src/encode.rs:398:17
    |
396 |             JxlEncoderAddBox(
    |             ---------------- arguments to this function are incorrect
397 |                 self.enc,
398 |                 Metadata::box_type(t),
    |                 ^^^^^^^^^^^^^^^^^^^^^ expected `*const JxlBoxType`, found `JxlBoxType`
    |
    = note: expected raw pointer `*const JxlBoxType`
                    found struct `JxlBoxType`
note: function defined here
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jpegxl-sys-0.10.4+libjxl-0.10.3/src/encode.rs:243:12
    |
243 |     pub fn JxlEncoderAddBox(
    |            ^^^^^^^^^^^^^^^^

(note that the opposite, jpegxl-rs 0.10.4 failing to wrap jpegxl-sys 0.10.3, also happened to me)


The following fixed it for me:

[dependencies]
jpegxl-sys = { version = "=0.10.3" }
jpegxl-rs = { version = "=0.10.3", features = ["vendored"] }

Should jpegxl-rs rely on a fixed version of jpegxl-sys to prevent this API interface version mismatch?
For example replace the version by "=0.10.4" here:

[dependencies.jpegxl-sys]
version = "0.10.3"
path = "../jpegxl-sys"
default-features = false

@inflation
Copy link
Owner

inflation commented Sep 19, 2024

I think it's just I'm not following semver correctly in this case. With cargo-semver-checks in CI, I hope it would not happen again.

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