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

Fixes cfg with target from env #516

Merged
merged 3 commits into from
Mar 18, 2023

Conversation

pinkforest
Copy link
Contributor

@pinkforest pinkforest commented Mar 17, 2023

Fixes #515 by @ryankurte fix
Fixes #511 thanks @jcape for pointing out the warning message

We fix the cross build with override which was broken due to rustc not relaying curve cfg's.

Given it is difficult to use we also default to cfg(curve_25519_dalek_bits="32") with a warning instead of a hard error.

Slightly vary of using CARGO_CFG_ given rustc removes them in build.rs for #[cfg()] beyond target cfg set.

Cc/ @jrose-signal

Test matrix on x86_64-unknown-linux-gnu native host:

$ rustup default 1.60 ; cargo clean
$ rustup default stable ; cargo clean
$ rustup default nightly ; cargo clean

Dalek64

$ cargo build
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="64"' cargo build
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="64"' cargo build --target wasm32-unknown-unknown
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="64"' cargo build --target aarch64-unknown-linux-gnu
$ cargo build --target aarch64-unknown-linux-gnu
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="64"' cargo build --target i686-unknown-linux-gnu
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="64"' cargo build --no-default-features --target thumbv7em-none-eabi

Dalek32

$ env RUSTFLAGS='--cfg curve25519_dalek_bits="32"' cargo build
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="32"' cargo build --target wasm32-unknown-unknown
$ cargo build --target wasm32-unknown-unknown
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="32"' cargo build --target aarch64-unknown-linux-gnu
$ cargo build --target i686-unknown-linux-gnu
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="32"' cargo build --target i686-unknown-linux-gnu
$ cargo build --no-default-features --target thumbv7em-none-eabi
$ env RUSTFLAGS='--cfg curve25519_dalek_bits="32"' cargo build --no-default-features --target thumbv7em-none-eabi

pinkforest and others added 2 commits March 18, 2023 09:49
This will also give out warning thanks @jcape

Co-authored-by: James Cape <[email protected]>
@rozbb rozbb merged commit 99c0520 into dalek-cryptography:main Mar 18, 2023
@ryankurte
Copy link
Contributor

🎉 thanks for fixing this @pinkforest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants