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

Building the tools image fails on Mac silicon #373

Open
chrsoo opened this issue Dec 29, 2024 · 2 comments
Open

Building the tools image fails on Mac silicon #373

chrsoo opened this issue Dec 29, 2024 · 2 comments

Comments

@chrsoo
Copy link
Contributor

chrsoo commented Dec 29, 2024

When following the instructions on CONTRIBUTING.md:

# change directory into the rust-fitsio root directory
docker build -t <tag> .
docker run --rm -it -v $(pwd):/project <tag> bash

... the docker build fails with the following message on a Mac with Apple silicon (M1):

➜  rust-fitsio git:(main) ✗ docker build -t fitsio .
[+] Building 165.4s (7/9)
...
 => ERROR [3/5] RUN rustup update &&     rustup install stable &&     rustup install nightly &&     rustup component add clippy --toolchain stable-x8  163.6s
------
 > [3/5] RUN rustup update &&     rustup install stable &&     rustup install nightly &&     rustup component add clippy --toolchain stable-x86_64-unknown-linux-gnu:
...
#6 163.6 error: toolchain 'stable-x86_64-unknown-linux-gnu' is not installed

It would appear that the Dockerfile (or build command) assumes an Intel-based Mac.

chrsoo added a commit to chrsoo/rust-fitsio that referenced this issue Dec 29, 2024
chrsoo added a commit to chrsoo/rust-fitsio that referenced this issue Dec 29, 2024
@chrsoo
Copy link
Contributor Author

chrsoo commented Dec 29, 2024

The Dockerfile explicitly refers to the x86_64 toolchain, preventing the Dockerfile to work on an arm-based machine:

RUN rustup update && \
    rustup install stable && \
    rustup install nightly && \
    rustup component add clippy --toolchain stable-x86_64-unknown-linux-gnu

However, the clippy documentation states that clippy is included in rustup per default, making this dependency unnecessary. Removing it makes the Dockerfile build on Mac and clippy still runs as expected:

➜  rust-fitsio git:(main) ✗ docker run --rm -it -v $(pwd):/project fitsio bash
root@7fd0895cfd46:/project# cargo clippy
info: syncing channel updates for 'beta-aarch64-unknown-linux-gnu'
info: latest update on 2024-12-28, rust version 1.84.0-beta.5 (0857a8e32 2024-12-27)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-analyzer'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-analyzer'
info: installing component 'rust-docs'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
    Updating crates.io index
...

@chrsoo
Copy link
Contributor Author

chrsoo commented Dec 29, 2024

PR in #376

simonrw pushed a commit to chrsoo/rust-fitsio that referenced this issue Jan 2, 2025
simonrw pushed a commit to chrsoo/rust-fitsio that referenced this issue Jan 2, 2025
simonrw pushed a commit that referenced this issue Jan 2, 2025
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

No branches or pull requests

1 participant