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

Rust installed via Homebrew lacks rust-src, preventing embedded (no_std) builds #205867

Open
4 tasks done
luofang34 opened this issue Jan 29, 2025 · 0 comments
Open
4 tasks done
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@luofang34
Copy link

luofang34 commented Jan 29, 2025

brew gist-logs <formula> link OR brew config AND brew doctor output

$brew config
HOMEBREW_VERSION: 4.4.19
ORIGIN: https://github.com/Homebrew/brew
HEAD: 23facb219df8615680636ef12103bb3313f44e2a
Last commit: 2 days ago
Branch: stable
Core tap JSON: 29 Jan 06:51 UTC
Core cask tap JSON: 29 Jan 06:51 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.LqH8qgQdBZ/org.xquartz:0
HOMEBREW_MAKE_JOBS: 16
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: 16-core 64-bit arm_palma
Clang: 16.0.0 build 1600
Git: 2.47.1 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: 16.2
Rosetta 2: false

$brew doctor
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

When installing Rust via Homebrew (brew install rust), the rust-src component is missing by default. This prevents compilation of embedded (no_std) projects, as the core and alloc libraries are unavailable for targets like thumbv7em-none-eabihf.

What happened (include all command output)?

Attempting to compile an embedded Rust project leads to:

error[E0463]: can't find crate for `core`
= note: the `thumbv7em-none-eabihf` target may not be installed

and running

ls $(rustc --print sysroot)/lib/rustlib/thumbv7em-none-eabihf/lib/

returns no libcore.rlib

What did you expect to happen?

The Homebrew Rust package could include rust-src by default.
Alternatively, brew info rust could warn users that embedded Rust requires rust-src

Step-by-step reproduction instructions (by running brew commands)

brew install rust
rustup target add thumbv7em-none-eabihf
cargo new test-project && cd test-project
echo '#![no_std] #![no_main]' > src/main.rs
cargo build --release --target thumbv7em-none-eabihf
@luofang34 luofang34 added the bug Reproducible Homebrew/homebrew-core bug label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

No branches or pull requests

1 participant