inflation / jpegxl-rs

GNU General Public License v3.0
62 stars 12 forks source link

`vendored` feature fails to build due to hardcoded `lib` path in build script #47

Closed awused closed 5 months ago

awused commented 5 months ago

After updating jpeg-xl-rs and enabling the vendored feature I'm not able to build the library.

Running `/home/desuwa/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name jpegxl_rs --edition=2021 /home/desuwa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jpegxl-rs-0.10.2+libjxl-0.10.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=218 --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C embed-bitcode=no -C debuginfo=2 '--warn=clippy::pedantic' --warn=missing_docs -C debug-assertions=on -C overflow-checks=off --cfg 'feature="image"' --cfg 'feature="vendored"' -C metadata=edde05d7bd84da78 -C extra-filename=-edde05d7bd84da78 --out-dir /cache/rust/debug/deps -L dependency=/cache/rust/debug/deps --extern byteorder=/cache/rust/debug/deps/libbyteorder-e053f75d8df4ee7b.rmeta --extern derive_builder=/cache/rust/debug/deps/libderive_builder-7687be543061bfed.rmeta --extern half=/cache/rust/debug/deps/libhalf-57b198a55c036e0f.rmeta --extern image=/cache/rust/debug/deps/libimage-7fc37e8bda1b0232.rmeta --extern jpegxl_sys=/cache/rust/debug/deps/libjpegxl_sys-17a9559e92f37951.rmeta --extern thiserror=/cache/rust/debug/deps/libthiserror-04c61937dcc805a8.rmeta --cap-lints allow -C target-cpu=native -L native=/cache/rust/debug/build/jpegxl-sys-225034c748bead83/out/lib`
error: could not find native static library `jxl`, perhaps an -L flag is missing?

The native directory /cache/rust/debug/build/jpegxl-sys-225034c748bead83/out/lib is incorrect, the real directory is /cache/rust/debug/build/jpegxl-sys-225034c748bead83/out/lib64 which contains the expected static libraries.

This is on Fedora 39, x86-64, and rustc -Vv's output is:

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-unknown-linux-gnu
release: 1.78.0
LLVM version: 18.1.2

Though, weirdly, if I just clone the repo I can build it with --features vendored or include by path just fine, even without modifying the native path.

inflation commented 5 months ago

Yes, I fixed it in a pr this week but not releasing. I'm gonna release a new version now.

awused commented 5 months ago

Ah I saw that PR but thought it was windows-only.

inflation commented 5 months ago

Ah I saw that PR but thought it was windows-only.

Yes it's a change from another PR. I'm just integrated locally.

inflation commented 5 months ago

Should be there in v0.10.3

awused commented 5 months ago

This seems to still be broken in 0.10.3.

       Dirty jpegxl-rs v0.10.3+libjxl-0.10.2: the dependency jpegxl_sys was rebuilt
   Compiling jpegxl-rs v0.10.3+libjxl-0.10.2
     Running `/home/desuwa/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name jpegxl_rs --edition=2021 /home/desuwa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jpegxl-rs-0.10.3+libjxl-0.10.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=218 --crate-type lib --emit=dep-info,metadata,link -C opt-level=1 -C embed-bitcode=no -C debuginfo=2 '--warn=clippy::pedantic' --warn=missing_docs -C debug-assertions=on -C overflow-checks=off --cfg 'feature="image"' --cfg 'feature="vendored"' -C metadata=599955c2b42d6bab -C extra-filename=-599955c2b42d6bab --out-dir /cache/rust/debug/deps -L dependency=/cache/rust/debug/deps --extern byteorder=/cache/rust/debug/deps/libbyteorder-e053f75d8df4ee7b.rmeta --extern derive_builder=/cache/rust/debug/deps/libderive_builder-7687be543061bfed.rmeta --extern half=/cache/rust/debug/deps/libhalf-57b198a55c036e0f.rmeta --extern image=/cache/rust/debug/deps/libimage-fa3796cfe1561597.rmeta --extern jpegxl_sys=/cache/rust/debug/deps/libjpegxl_sys-557c4e510a073d6b.rmeta --extern thiserror=/cache/rust/debug/deps/libthiserror-04c61937dcc805a8.rmeta --cap-lints allow -C target-cpu=native -L native=/cache/rust/debug/build/jpegxl-sys-d0901160e7be57b9/out/lib`
error: could not find native static library `jxl`, perhaps an -L flag is missing?

error: could not compile `jpegxl-sys` (lib) due to 1 previous error