Skip to content

lang: Fix bytemuck_derive build error #3610

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

Conversation

acheroncrypto
Copy link
Collaborator

Problem

anchor-lang doesn't compile due to an update to the bytemuck_derive crate.

error: rustc 1.79.0-dev is not supported by the following package:

                 Note that this is the rustc version that ships with Solana tools and not your system's rustc version. Use `solana-install update` or head over to https://docs.solanalabs.com/cli/install to install a newer version.
  [email protected] requires rustc 1.84
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.79.0-dev

As the error message suggests, the latest version of the bytemuck_derive crate specifies MSRV as 1.84, which is incompatible with the Rust version coming from the latest Solana version (1.79.0).

This is one of the issues with Rust's dependency management where even though anchor-lang only depends on bytemuck, and doesn't have its derive feature enabled, cargo refuses to build even when bytemuck_derive is an optional dependency that isn't enabled.

In stable Rust 1.84, cargo supports trying to fallback to a supported version instead of returning an error, which should fix many issues similar to this one. See:

Summary of changes

Add bytemuck_derive version requirement to be >1.0.0, <1.9.

This is a short term fix that will be removed once Solana build tools are on Rust >=1.84 (currently 1.79.0).

Fixes #3606

Copy link

vercel bot commented Mar 19, 2025

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added lang dependencies Pull requests that update a dependency file fix Bug fix PR labels Mar 19, 2025
@acheroncrypto acheroncrypto merged commit a107d82 into solana-foundation:master Mar 19, 2025
48 of 53 checks passed
@jacobcreech jacobcreech mentioned this pull request Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file fix Bug fix PR lang
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error: failed to download bytemuck_derive v1.9.1 feature edition2024 is required
1 participant