8000 cargo libcnb package defaults to x86 architecture · Issue #869 · heroku/libcnb.rs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
cargo libcnb package defaults to x86 architecture  #869
Closed
@mars

Description

@mars

cargo libcnb package defaults to x86 architecture regardless of the current system architecture.

When running this command on an ARM / Apple Silicon Mac, the following error message appears:

❯❯❯ cargo libcnb package
🚚 Preparing package directory...
🖥️ Gathering Cargo configuration (for x86_64-unknown-linux-musl)
For cross-compilation from aarch64 macos to x86_64-unknown-linux-musl,
a C compiler and linker for the target platform must be installed:

To install an x86_64 cross-compiler on macOS:
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl

You will also need to install the Rust target:
rustup target add x86_64-unknown-linux-musl

❌ Failed to configure Cargo for cross-compilation

That is confusing, because I am not trying to cross-compile.

The solution is to set the current architecture as the target in the command:

❯❯❯ cargo libcnb package --target aarch64-unknown-linux-musl

Ideally, either that error messaging or the default behavior would be improved. So that this situation is not so confusing for developers running on non-x86 architecture.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0