projg2 / pycargoebuild

A generator for Rust/Cargo ebuilds written in Python
GNU General Public License v2.0
25 stars 6 forks source link

bindgen: missing rustc-hash-1.0.1 crate? #11

Closed mgorny closed 1 year ago

mgorny commented 1 year ago

Comparing the ebuild generated by pycargoebuild and the ebuild in ::gentoo, the former seems to be missing:

rustc-hash-1.0.1

Apparently bindgen specifies rustc-hash = 1.0.1 as a dependency but this file is missing from Cargo.lock. Is it a bug in pycargoebuild or extraneous dep in bindgen ebuild?

CC @gyakovlev, @bjacquin

mgorny commented 1 year ago

I've just removed 1.0.1 from the existing ebuild and it seems to build just fine.

gyakovlev commented 1 year ago

I see it in Cargo.lock? https://github.com/rust-lang/rust-bindgen/blob/c51591941e18a75c312c7c237c4969dd22c40467/Cargo.lock#L587

gyakovlev commented 1 year ago

and it's used =) https://github.com/rust-lang/rust-bindgen/blob/v0.63.0/bindgen/lib.rs#L106

strange.

gyakovlev commented 1 year ago

and for me it builds it too

...
Running `rustc --crate-name rustc_hash /var/tmp/portage/dev-util/bindgen-0.63.0/work/cargo_home/gentoo/rustc-hash-1.1.0/src/lib.rs 

and links it to bindgen

Running `rustc --crate-name bindgen --edition=2018 bindgen/./lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="log"' --cfg 'feature="logging"' --cfg 'feature="runtime"' --cfg 'feature="which"' --cfg 'feature="which-rustfmt"' -C metadata=b672fda81f33869e -C extra-filename=-b672fda81f33869e --out-dir /var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps -L dependency=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps --extern bitflags=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libbitflags-e488825fe21a55e0.rmeta --extern cexpr=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libcexpr-6783554525b83da5.rmeta --extern clang_sys=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libclang_sys-1f47346a2ffca035.rmeta --extern lazy_static=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/liblazy_static-697f3473089a381c.rmeta --extern lazycell=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/liblazycell-3646ee2562e85433.rmeta --extern log=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/liblog-68888a4cc46a1fd3.rmeta --extern peeking_take_while=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libpeeking_take_while-4fcbb4212ae7c3e1.rmeta --extern proc_macro2=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libproc_macro2-33f4c05201370b80.rmeta --extern quote=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libquote-ca6ba59a48c50de8.rmeta --extern regex=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libregex-74a91a82fb56cc30.rmeta --extern rustc_hash=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/librustc_hash-98aecc9f18526298.rmeta --extern shlex=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libshlex-310cae79946ba998.rmeta --extern syn=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libsyn-a09735ace79f67a3.rmeta --extern which=/var/tmp/portage/dev-util/bindgen-0.63.0/work/rust-bindgen-0.63.0/target/release/deps/libwhich-0def310163f53286.rmeta -C target-cpu=pwr9`
gyakovlev commented 1 year ago

ah, it's 1.1.0 is used.

gyakovlev commented 1 year ago

got confused with similar numbers.

 * cargo build --release
error: failed to select a version for the requirement `rustc-hash = "^1.0.1"` (locked to 1.1.0)

basically default, or caret dep1.0.1 or ^1.0.1 == '>=1.0.1, <2.0.0'

so cargo updated to 1.1.0 in the lock file, because 1.1.0 still semver-compatible with 1.0.1

yeah, it's ok to remove it from ebuild, 1.0.1 is unused.

gyakovlev commented 1 year ago

mystery solved.