A way to out-put building self-contained deps
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Summary
Posted by @denizsokmen https://github.com/rust-lang/rust/pull/141375#issuecomment-3338693161:
Custom target issue is actually more related to Rust bootstrap forcefully cross-compiling crtbegin, crtend and llvm-libunwind for musl for self-contained linkage reasons: https://github.com/rust-lang/rust/blob/40ace17fc3891155bad26a50d60a9ab07b83bf8e/src/bootstrap/src/core/build_steps/compile.rs#L422 and https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/config/target_selection.rs#L96
I see no way to opt out of that, even though those binaries won't be used as they'll be fetched from the sysroot of that musl-based custom target. Is there a way to tell Rust bootstrap not to bother with preparing self-contained binaries?
Expected behaviour
A way to out-put crtbegin, crtend and llvm-libunwind build for custom musl target.
Actual behaviour
You'll need to patch code as described: https://github.com/rust-lang/rust/pull/141375#issuecomment-3338710930.
Possible solution
Probalby extend the target table in bootstrap.toml like target.self-contained = <bool>?
Bootstrap configuration (bootstrap.toml)
[target.my-custom-musl]
linker = "…"
musl-root = "…"
cc = "…"
cxx = "…"
cflags = "…"
cxxflags = "…"
rustflags= "…"
llvm-libunwind = "system"
HEAD
5b9007bfc358817cf066ee27c6b440440727d3a7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/bootstrap/src/core/build_steps/compile.rs around the crtbegin, crtend, and llvm-libunwind handling, then follow the target configuration in src/bootstrap/src/core/config/target_selection.rs. Review the custom target settings shown in bootstrap.toml and the referenced pull-request discussion. Done should provide a documented configuration path that avoids unnecessary self-contained builds for the custom musl target.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100