Skip to content

Commit 6466a7b

Browse files
Merge #1024
1024: Fixing superfluous download of pre-built target rust-std when build-s… r=alexhuszagh,emilgardis a=HBchevelle68 This fix prevents the unnecessary download of of the target's pre-built rust-std when the target specified in Cross.toml has `build-std = true`. When this configuration is set, pulling the targets pre-built rust-std is unnecessary and is not used during the build. An example `Cross.toml` file could look like: ``` [target.x86_64-unknown-freebsd] build-std = true ``` with respective build commands: ``` cross build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-freebsd --release ``` ``` cross build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-netbsd --release ``` You will note, the `freebsd` build will not pull the pre-built `freebsd rust-std` and the build will succeed, while the `netbsd` will still pull the pre-built std i.e: ``` info: downloading component 'rust-std' for 'x86_64-unknown-netbsd' info: installing component 'rust-std' for 'x86_64-unknown-netbsd' ``` Co-authored-by: HBchevelle68 <[email protected]>
2 parents ba030a6 + 560903a commit 6466a7b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changes/1024.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"description": "`rust-std` is no longer downloaded when using `build-std = true`",
3+
"type": "fixed",
4+
"breaking": false
5+
}

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ To override the toolchain mounted in the image, set `target.{}.image.toolchain =
624624
}
625625

626626
if !uses_xargo
627+
&& !uses_build_std
627628
&& !available_targets.is_installed(&target)
628629
&& available_targets.contains(&target)
629630
{

0 commit comments

Comments
 (0)