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

Fix nightly build #619

Merged
merged 3 commits into from
Feb 6, 2024
Merged

Fix nightly build #619

merged 3 commits into from
Feb 6, 2024

Conversation

jimmygchen
Copy link
Contributor

@jimmygchen jimmygchen commented Feb 6, 2024

Addresses #618.

This PR fixes the failing build on the latest Rust nightly compiler rustc 1.78.0-nightly (f067fd608 2024-02-05).

The stdsimd feature has been split into separate features in the latest Rust nightly compiler and its usage needs to be updated to use #![feature(stdarch_x86_avx512)] instead.

See rust-lang/stdarch#1486 and rust-lang/rust#111137.

@rozbb
Copy link
Contributor

rozbb commented Feb 6, 2024

Thank you, this looks great! For anyone reading: we have two SIMD implementations for x86_64—AVX2 and AVX-512. The former has already been stabilized, so it's not an issue. The latter is unstable, and was previously gated by a nightly feature stdsimd. As @jimmygchen said, this feature has been split into more fine grained features. So, we get errors in #618 like

error[E0658]: use of unstable library feature 'stdarch_x86_avx512'
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.1/src/backend/vector/ifma/field.rs:25:9
   |
25 |     use core::arch::x86_64::_mm256_madd52lo_epu64;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #111137 <https://github.com/rust-lang/rust/issues/111137> for more information
   = help: add `#![feature(stdarch_x86_avx512)]` to the crate attributes to enable
   = note: this compiler was built on 2024-02-05; consider upgrading it if it is out of date

because _mm256_madd52lo_epu64 is behind that new AVX-512 gate.

@rozbb
Copy link
Contributor

rozbb commented Feb 6, 2024

@tarcieri happy to merge. Shall I also cut a new version (minor or patch?)?

@rozbb rozbb merged commit ff1c309 into dalek-cryptography:main Feb 6, 2024
22 checks passed
@leighmcculloch
Copy link

Thanks for the fast fix.

Which version is this targeting?

@rozbb
Copy link
Contributor

rozbb commented Feb 6, 2024

This will be a patch bump (ie +0.0.1) for curve-, ed-, and x- crates. Sound good @tarcieri ?

@tarcieri
Copy link
Contributor

tarcieri commented Feb 6, 2024

Yep, sounds good

@sergiimk
Copy link

sergiimk commented Feb 7, 2024

This change unfortunately breaks the build for older nightlies.

Our company is probably not the only one who uses nightly rustc not just for testing, but for access to unstable features, so we don't upgrade rustc that often and still running:

rustc 1.76.0-nightly (90e321d82 2023-12-02)

Don't know if this particular change could've been done in a backwards-compatible way or not, but just wanted to mention that the latest patch release likely both fixed AND broke a lot of builds.

@tarcieri
Copy link
Contributor

tarcieri commented Feb 7, 2024

@sergiimk this is a breaking change in the nightly compiler. It requires a corresponding breaking change in this library to support.

The nightly compiler is definitionally the unstable version of the compiler. Breaking changes can come at any time, the onus is on you to keep what you're building on it stable via meticulous dependency management.

@rozbb
Copy link
Contributor

rozbb commented Feb 7, 2024

Is there an accepted way to handle the following scenario? You have a crate that relies on nightly. You pull in curve25519-dalek as a dep, but you don't really care about performance. Can you force dalek to behave as it would in stable, while still using nightly for your own crate?

@tarcieri
Copy link
Contributor

tarcieri commented Feb 7, 2024

I think it's unreasonable to ask for support for anything but the latest version of the nightly compiler

@rozbb
Copy link
Contributor

rozbb commented Feb 7, 2024

Right, what I was thinking is something along the lines of a negative feature like no-nightly which basically overrides our toolchain autodetect and skips all nightly features.

IIRC we had a nightly feature we killed. So not sure if the inverse is any better. Just an idea I was wondering if there's precedence for

inorick pushed a commit to eclipse-heimlig/heimlig that referenced this pull request Feb 7, 2024
inorick pushed a commit to eclipse-heimlig/heimlig that referenced this pull request Feb 7, 2024
@tarcieri
Copy link
Contributor

tarcieri commented Feb 7, 2024

@rozbb disabling the nightly cfg attribute would accomplish that. It gets set automatically in build.rs here:

println!("cargo:rustc-cfg=nightly");

@rozbb
Copy link
Contributor

rozbb commented Feb 7, 2024

Ah nice, that answers it then

inorick added a commit to eclipse-heimlig/heimlig that referenced this pull request Feb 8, 2024
* Enforce undocumented_unsafe_blocks clippy warning

* Update dalek dependencies to fix nightly builds

See dalek-cryptography/curve25519-dalek#619

* Require fixed version of dalek dependencies

---------

Co-authored-by: Norbert Fabritius <[email protected]>
edouardparis added a commit to wizardsardine/liana that referenced this pull request Feb 9, 2024
0c665f9 gui: bump dependencies to fix nightly build (jp1ac4)

Pull request description:

  This includes the changes from dalek-cryptography/curve25519-dalek#619 and dalek-cryptography/curve25519-dalek#621.

ACKs for top commit:
  edouardparis:
    utACK 0c665f9

Tree-SHA512: 414f65ff0d0b102ba43506042ebb3d4acbc67a019620a044d3be4d6b8c950e8c5d5d44fe722d38a0a445b1dc374f5e374b129d32cd66b5fed27cc2d53cc7f8e7
joshuef pushed a commit to maidsafe/autonomi that referenced this pull request Feb 12, 2024
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

Successfully merging this pull request may close these issues.

5 participants