axodotdev / axodotdev/cargo-dist

"Can't find crate 'core'" when building artifacts via cross-compilation

Open
#1,772 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

[Pavex](https://github.com/LukeMathWalker/pavex) has been using `dist` for building artefacts for a while.
Yesterday, the "build-local-artifacts" steps for `x86_64-unknown-linux-musl` and `x86_64-apple-darwin` started to fail with the same error:

```
building x86_64-apple-darwin target, from aarch64-apple-darwin host, using cargo profile dist --workspace)
Compiling proc-macro2 v1.0.93
Compiling unicode-ident v1.0.17
Compiling libc v0.2.170
Compiling cfg-if v1.0.0
error[E0463]: can't find crate for `core`
|
= note: the `x86_64-apple-darwin` target may not be installed
= help: consider downloading the target with `rustup target add x86_64-apple-darwin`
```

Weirdly enough, the toolchain has been installed via `rustup` just prior to running that command:

```
running rustup to ensure you have x86_64-apple-darwin installed
info: downloading component 'rust-std' for 'x86_64-apple-darwin'
info: installing component 'rust-std' for 'x86_64-apple-darwin'
```

so that can't be the actual underlying issue.

You can find the full build logs for both jobs [here](https://github.com/LukeMathWalker/pavex/actions/runs/13493919437/job/37696930447) and [here](https://github.com/LukeMathWalker/pavex/actions/runs/13493919437/job/37696931238).

Relevant information: I've just updated the project to Rust's 2024 edition, so I do wonder if that's related.

Contributor guide

Open the contributing guide

Research direction

Start with the linked GitHub Actions logs for the x86_64-unknown-linux-musl and x86_64-apple-darwin build-local-artifacts jobs. Compare the rustup target installation output with the subsequent cargo-dist invocation and investigate whether the Rust 2024 edition update is relevant. Done means both cross-compilation jobs build their artifacts successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, rust
Domain
build-system, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.