Skip to content

Bug: Build fails due to outdated Rust version (rustc 1.63.0) required for once_cell v1.21.1 #155

Open
@ikmzkro

Description

@ikmzkro

Description

When attempting to build nsm-lib from aws-nitro-enclaves-nsm-api using the provided Dockerfile in aws-nitro-enclaves-sdk-c, the build fails due to a mismatch in the Rust compiler version requirements.

error: package `once_cell v1.21.1` cannot be built because it requires rustc 1.65 or newer, while the currently active rustc version is 1.63.0

Reproduction Steps

  1. Clone the repository:
    git clone --depth 1 -b v0.4.0 https://github.com/aws/aws-nitro-enclaves-nsm-api.git
  2. Run the following build step (e.g. in Dockerfile.al2):
    RUN source $HOME/.cargo/env && cd aws-nitro-enclaves-nsm-api && cargo build --release --jobs $(nproc) -p nsm-lib
  3. Build fails with the error shown above.

Environment

  • Dockerfile base: amazonlinux2
  • Current Rust version: rustc 1.63.0
  • Required Rust version: >=1.65.0 for once_cell v1.21.1

Suggested Fix

Update the installed Rust toolchain version in Dockerfile.al2 to at least rustc 1.65.0 or newer before executing the cargo build command.

Example:

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:$PATH"
RUN rustup install 1.70.0 && rustup default 1.70.0

References

Context

This issue was encountered while building aws-nitro-enclave-blockchain-wallet which depends on this SDK. Updating the SDK’s Dockerfile would prevent similar failures for downstream consumers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions