Comments (5)
hashbrown is tested in CI to check that it builds on thumbv6m systems. You might be hitting rust-lang/cargo#5730 if another one of your dependencies is using rand
, and the build-dependency is enabling the std
feature.
from ahash.
this doesn't answer my question though --
since const_random is just a proc-macro it should be built for the host architecture, right?
the current configuration seems to mean that rand is compiled for the target architecture
even if that works in hashbrown-ci it seems like this isn't being configured correctly -- we only need rand at build time so either it or one of the links in this chain back to the user should be marked as a build dependency, right?
Here's a portion of my cargo tree
:
│ ├── common v0.1.0 (/root/mobilenode/src/common)
│ │ ├── ahash v0.2.9
│ │ │ ├── const-random v0.1.6
│ │ │ │ ├── const-random-macro v0.1.6
│ │ │ │ │ ├── proc-macro-hack v0.5.8
│ │ │ │ │ │ ├── proc-macro2 v0.4.30
│ │ │ │ │ │ │ └── unicode-xid v0.1.0
│ │ │ │ │ │ ├── quote v0.6.13
│ │ │ │ │ │ │ └── proc-macro2 v0.4.30 (*)
│ │ │ │ │ │ └── syn v0.15.42
│ │ │ │ │ │ ├── proc-macro2 v0.4.30 (*)
│ │ │ │ │ │ ├── quote v0.6.13 (*)
│ │ │ │ │ │ └── unicode-xid v0.1.0 (*)
│ │ │ │ │ └── rand v0.7.0
│ │ │ │ │ ├── getrandom v0.1.8
│ │ │ │ │ │ ├── cfg-if v0.1.9 (*)
│ │ │ │ │ │ └── libc v0.2.60
│ │ │ │ │ ├── libc v0.2.60 (*)
│ │ │ │ │ ├── rand_chacha v0.2.1
│ │ │ │ │ │ ├── c2-chacha v0.2.2
│ │ │ │ │ │ │ ├── lazy_static v1.3.0
│ │ │ │ │ │ │ │ └── spin v0.5.0
│ │ │ │ │ │ │ └── ppv-lite86 v0.2.5
│ │ │ │ │ │ └── rand_core v0.5.0
│ │ │ │ │ │ └── getrandom v0.1.8 (*)
│ │ │ │ │ └── rand_core v0.5.0 (*)
│ │ │ │ │ [dev-dependencies]
I think that either ahash
to const_random
or const_random
to const_random_macro
should be marked as a build dependency, right? I really don't want to compile rand
for my target if I don't need it, even with limited features.
from ahash.
@Amanieu in const_random_macro
Cargo.toml we have this:
https://github.com/tkaitchuck/constrandom/blob/master/macro/Cargo.toml#L17
rand = { version = "0.7", default-features = false, features = ["getrandom"] }
this isn't gonna work even if no_std
is there, there is no implementation of getrandom
on the target
as we can see in cargo-tree, getrandom
is pulling in libc
from ahash.
const-random-macro
is a proc macro crate, which is always built for the host, even when cross-compiling. All its dependencies are also built for the host.
If you look at your full cargo tree
, is the rand
crate used anywhere else?
from ahash.
@Amanieu I made the following reduced test, and it is working. So I think you are right, sorry for the noise, and thanks for helping me!
#!/bin/bash
rm -rf example
cargo new example --lib
cd example
echo "ahash = \"0.2\"" >> Cargo.toml
rm src/lib.rs
echo "#![no_std]
extern crate ahash;" > src/lib.rs
echo "{\
\"arch\": \"x86_64\",\
\"cpu\": \"x86-64\",\
\"data-layout\": \"e-m:e-i64:64-f80:128-n8:16:32:64-S128\",\
\"dynamic-linking\": true,\
\"env\": \"sgx\",\
\"executables\": true,\
\"has-elf-tls\": true,\
\"has-rpath\": true,\
\"is-builtin\": false,\
\"linker-flavor\": \"gcc\",\
\"linker-is-gnu\": true,\
\"llvm-target\": \"x86_64-unknown-linux-gnu\",\
\"max-atomic-width\": 64,\
\"os\": \"none\",\
\"position-independent-executables\": true,\
\"pre-link-args\": {\
\"gcc\": [\
\"-Wl,--as-needed\",\
\"-Wl,-z,noexecstack\",\
\"-m64\"\
]\
},\
\"relro-level\": \"full\",\
\"stack-probes\": true,\
\"target-c-int-width\": \"32\",\
\"target-endian\": \"little\",\
\"target-family\": \"unix\",\
\"target-pointer-width\": \"64\",\
\"vendor\": \"unknown\"\
}" > x86-64-unknown-linux-gnu.json
cargo xbuild --target x86-64-unknown-linux-gnu.json -v
from ahash.
Related Issues (20)
- Deterministic hash value HOT 2
- error[E0635]: unknown feature `stdsimd` HOT 19
- Significant bump in MSRV from 0.8.7 to 0.8.8 HOT 9
- No link to crates.io HOT 1
- RandomState has too many collisions in low order bits when hashing a u64 HOT 29
- Hashing `&T` yields different results compared to `T`
- Fragile build script: crate automatically enables "specialize" feature HOT 14
- ahash 0.8.11 breaks hashbrown? HOT 6
- Work around `swap_bytes` on WebAssembly HOT 3
- git source unaligned with crates.io release HOT 5
- Linking Errors with Specific Optimization Levels When Running Test Cases HOT 1
- rust v1.78 std simd feature removed HOT 1
- `set_random_source` never returns `Err(false)`
- Replace atomic-polyfill with portable-atomic
- Mismatch between published version on crates.io and tagged version in git repo for v0.8.11 HOT 8
- Suggestion: Alternative wrapper HOT 1
- AES not enabled on AArch64
- Hash output is different when using target-cpu=native
- Hashing `&T` yields different results compared to `T` in **nightly** channel HOT 1
- Require an opt-in for enabling `min_specialization` rustc feature HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahash.