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

error[E0599]: no variant or associated item named default found for enum DefaultHashBuilder in the current scope #6

Open
dkg opened this issue Mar 26, 2021 · 6 comments

Comments

@dkg
Copy link

dkg commented Mar 26, 2021

I'm trying to package hashlink 0.6.0 for debian, and in the course of the standard debian build, I see the following two failures:

debian cargo wrapper: running subprocess (['env', 'RUST_BACKTRACE=1', '/usr/bin/cargo', '-Zavoid-dev-deps', 'build', '--verbose', '--verbose', '-j4', '--target', 'x86_64-unknown-linux-gnu'],) {}
   Compiling hashbrown v0.9.1
     Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=hashbrown CARGO_MANIFEST_DIR=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/debian/cargo_registry/hashbrown-0.9.1 CARGO_PKG_AUTHORS='Amanieu d'\''Antras <[email protected]>' CARGO_PKG_DESCRIPTION='A Rust port of Google'\''s SwissTable hash map' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=Apache-2.0/MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hashbrown CARGO_PKG_REPOSITORY='https://github.com/rust-lang/hashbrown' CARGO_PKG_VERSION=0.9.1 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=9 CARGO_PKG_VERSION_PATCH=1 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/debug/deps:/usr/lib' rustc --crate-name hashbrown --edition=2018 /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/debian/cargo_registry/hashbrown-0.9.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="inline-more"' -C metadata=dfc80923e95acd17 -C extra-filename=-dfc80923e95acd17 --out-dir /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -L dependency=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/debug/deps --cap-lints warn -C debuginfo=2 --cap-lints warn -C linker=x86_64-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0=/usr/share/cargo/registry/hashlink-0.6.0`
   Compiling hashlink v0.6.0 (/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0)
     Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=hashlink CARGO_MANIFEST_DIR=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0 CARGO_PKG_AUTHORS='kyren <[email protected]>' CARGO_PKG_DESCRIPTION='HashMap-like containers that hold their key-value pairs in a user controllable order' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hashlink CARGO_PKG_REPOSITORY='https://github.com/kyren/hashlink' CARGO_PKG_VERSION=0.6.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=6 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/debug/deps:/usr/lib' rustc --crate-name hashlink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=eb6baffa3df7995a -C extra-filename=-eb6baffa3df7995a --out-dir /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -C incremental=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/incremental -L dependency=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/debug/deps --extern hashbrown=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps/libhashbrown-dfc80923e95acd17.rmeta -C debuginfo=2 --cap-lints warn -C linker=x86_64-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0=/usr/share/cargo/registry/hashlink-0.6.0`
error[E0599]: no variant or associated item named `default` found for enum `DefaultHashBuilder` in the current scope
  --> src/linked_hash_map.rs:50:57
   |
50 |             hash_builder: hash_map::DefaultHashBuilder::default(),
   |                                                         ^^^^^^^ variant or associated item not found in `DefaultHashBuilder`

error[E0599]: no variant or associated item named `default` found for enum `DefaultHashBuilder` in the current scope
  --> src/linked_hash_map.rs:60:57
   |
60 |             hash_builder: hash_map::DefaultHashBuilder::default(),
   |                                                         ^^^^^^^ variant or associated item not found in `DefaultHashBuilder`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `hashlink`.

Caused by:
  process didn't exit successfully: `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=hashlink CARGO_MANIFEST_DIR=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0 CARGO_PKG_AUTHORS='kyren <[email protected]>' CARGO_PKG_DESCRIPTION='HashMap-like containers that hold their key-value pairs in a user controllable order' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=hashlink CARGO_PKG_REPOSITORY='https://github.com/kyren/hashlink' CARGO_PKG_VERSION=0.6.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=6 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/debug/deps:/usr/lib' rustc --crate-name hashlink --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=eb6baffa3df7995a -C extra-filename=-eb6baffa3df7995a --out-dir /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -C incremental=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/incremental -L dependency=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/debug/deps --extern hashbrown=/home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0/target/x86_64-unknown-linux-gnu/debug/deps/libhashbrown-dfc80923e95acd17.rmeta -C debuginfo=2 --cap-lints warn -C linker=x86_64-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix /home/dkg/src/sequoia/2021-03-26/rust-hashlink-0.6.0=/usr/share/cargo/registry/hashlink-0.6.0` (exit code: 1)
dh_auto_test: error: /usr/share/cargo/bin/cargo build returned exit code 101

I'm not a rust expert, so if you think i'm doing something wrong here, i'm happy to get pointers to the right fix.

@dkg dkg changed the title error[E0599]: no variant or associateerror[E0599]: no variant or associated item named default found for enum DefaultHashBuilder in the current scoped item named default found for enum DefaultHashBuilder in the current scope error[E0599]: no variant or associated item named default found for enum DefaultHashBuilder in the current scope Mar 26, 2021
@dkg
Copy link
Author

dkg commented Mar 26, 2021

this is with rustc 1.48.0+dfsg1-2

@dkg
Copy link
Author

dkg commented Apr 6, 2021

any word on this? This error is blocking me from uploading hashlink to debian. Maybe there's some versioned dependency that isn't clearly stated?

@nathaniel-daniel
Copy link

Looks like DefaultHashBuilder doesn't implement Default when it actually does? I can build the crate from cargo with 1.48.0 so this seems like a problem specific to your build setup.

@dkg
Copy link
Author

dkg commented Apr 12, 2021

seems like this might be an issue with hashbrown, then. My attempt to build used hashbrown 0.9.1 (the version currently in debian).

Looks like i've got a bit more work ahead of me to update hashbrown in debian to a more recent version; but perhaps this means that the hashlink dependencies aren't correct?

@nathaniel-daniel
Copy link

The Debian hashbrown crate seems bugged. This crate relies on hashbrown having the ahash feature through the use of default features. However, this patch seems to disable ahash completely. The fallback DefaultHashBuilder does not implement Default, and is mostly an empty stand-in. This is why your build fails.

@dtolnay
Copy link

dtolnay commented Apr 13, 2021

I don't know much about Debian but the ahash crate has caused no end of trouble in my own codebase too, so I am not surprised to see it implicated. It intentionally generates a nondeterministic build artifact every time you invoke rustc on it... which I imagine is why Debian wants nothing to do with it.

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

3 participants