Skip to content

Commit ff4a0db

Browse files
authored
Merge pull request #14 from rubdos/sb2-cargo-target
Let Cargo obey the SB2_TARGET variable
2 parents f83100d + 86ec3b0 commit ff4a0db

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From f5d252ef690390c2cb9948995ccf68aeae2b123e Mon Sep 17 00:00:00 2001
2+
From: Ruben De Smet <ruben.de.smet@rubdos.be>
3+
Date: Thu, 27 Jan 2022 16:32:39 +0100
4+
Subject: [PATCH] Scratchbox2 needs to be able to tell cargo the default
5+
target.
6+
7+
This is analogous to the SB2 patch to rustc; ac226bbc018e11311394126fe580763c5bc77a2c
8+
9+
Signed-off-by: Ruben De Smet <ruben.de.smet@rubdos.be>
10+
---
11+
src/cargo/core/compiler/compile_kind.rs | 8 +++++++-
12+
1 file changed, 7 insertions(+), 1 deletion(-)
13+
14+
diff --git a/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs b/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs
15+
index adfa55f..8d892a0 100644
16+
--- a/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs
17+
+++ b/src/tools/cargo/src/cargo/core/compiler/compile_kind.rs
18+
@@ -76,7 +76,13 @@ impl CompileKind {
19+
};
20+
CompileKind::Target(CompileTarget::new(&value)?)
21+
}
22+
- None => CompileKind::Host,
23+
+ None => {
24+
+ if let Ok(sb2_tgt) = std::env::var("SB2_RUST_TARGET_TRIPLE") {
25+
+ CompileKind::Target(CompileTarget::new(&sb2_tgt)?)
26+
+ } else {
27+
+ CompileKind::Host
28+
+ }
29+
+ }
30+
};
31+
Ok(vec![kind])
32+
}
33+
--
34+
2.31.1
35+

rust.spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Patch3: 0003-Disable-statx-for-all-builds.-JB-50106.patch
6262
Patch4: 0004-Scratchbox2-needs-to-be-able-to-tell-rustc-the-defau.patch
6363
Patch5: 0005-Cargo-Force-the-target-when-building-for-CompileKind-Host.patch
6464
Patch6: 0006-Provide-ENV-controls-to-bypass-some-sb2-calls-betwee.patch
65+
Patch7: 0007-Scratchbox2-needs-to-be-able-to-tell-cargo-the-defau.patch
6566
# This is the real rustc spec - the stub one appears near the end.
6667
%ifarch %ix86
6768

0 commit comments

Comments
 (0)