extra/rust to 1.83.0-1

This commit is contained in:
Kevin Mihelich 2024-11-28 17:33:53 +00:00
parent ce8f594e4e
commit c846688c93
8 changed files with 33 additions and 180 deletions

View file

@ -1,7 +1,7 @@
pkgbase = rust
pkgdesc = Systems programming language focused on safety, speed and concurrency
pkgver = 1.82.0
pkgrel = 2
pkgver = 1.83.0
pkgrel = 1
epoch = 1
url = https://www.rust-lang.org/
arch = x86_64
@ -33,21 +33,19 @@ pkgbase = rust
depends = zlib
options = !emptydirs
options = !lto
source = https://static.rust-lang.org/dist/rustc-1.82.0-src.tar.gz
source = https://static.rust-lang.org/dist/rustc-1.82.0-src.tar.gz.asc
source = https://static.rust-lang.org/dist/rustc-1.83.0-src.tar.gz
source = https://static.rust-lang.org/dist/rustc-1.83.0-src.tar.gz.asc
source = 0001-bootstrap-Change-libexec-dir.patch
source = 0002-bootstrap-Change-bash-completion-dir.patch
source = 0003-compiler-Change-LLVM-targets.patch
source = 0004-compiler-Use-wasm-ld-for-wasm-targets.patch
source = 0005-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
validpgpkeys = 108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE
b2sums = c95ee180622a7984d03d43bcb3dd2ae16c41f95dde88426f972f32cac6ece904ced00d90967a32829db64d8790ee042192d1102426e7a2c4f6b2ff9d14c7cf70
b2sums = c4b4d5ce55e07c95016c10aece82b6bf35d037f84017ad87d86d7f5a4d965393f11da309daa32b877512f41a8a9c1ff4b462a523c807eb8f8919cb9485c0767c
b2sums = SKIP
b2sums = 87bdf52a50a6630ee431c6f81a1dc6b70161ba2301b457ab5cb1e8b3f1ef0be133090cc8afbf38c76b07eacef8de0829b601d253cdd620c752447efaace0a40a
b2sums = 365d53955a5ccf4b603ed39dd06384db063441477ed76fbbb31d7a0d46c6a297d86a0b306fcb616485c229ec8965eaa36a5b91b2398991b51f37ff58bd461054
b2sums = b0e5c8054f5364fbbc5619674923931e5d896bf56dc1cb1b09e906b7b451d44b7af78dca848e9f8e2de4f15d014187dd25301d6e704005a1efafffe586e120de
b2sums = 963aa64d27763f063b9fac483a870563f5a71a49ec02d17b7ca0c14dbf67064ba56028bbc45f2ee50b16eada725cb55c2aa2ab17ceadff65ba9e40cb220f7a0c
b2sums = b99ff1689f92ac50b2f64e00150ae6959cf5350dab28e773d9256ec33457684289cef37297c66943a4aa15e0128d043676fa3e498a63bd264bdff34e165e1bcc
b2sums = 329cae9618a2c7bc9a0acb67471d80e46bd17b4033ecb25780e47d8a4005a889c67f75e675a7aab0c32f35984cd0101910d3cad31b786c40d0c7d10614f07f2f
b2sums = 98faa0f85da268d7de3ec057512ee57fc415a976543b649199bc5a8fecab75ce14ce4a6efebf9d13dded1749384a2355e7674dbb2fba6e5bf3018ee20af98f69
b2sums = 9629e3af2d792cc7558c969e5ced3a25268604c9ce8204903441df11e7468455564eb43d062f661d861df9280fd972253b0523e2a47fbe6c8ac57f072f832139
b2sums = b50e77529edc7640e2e08a434aa48591b5b809b35e61db026010e28b6c4caf61a780131500a5b0f9339d2a98177de7adb13d7589a0b2f084304d059c4de112ee
pkgname = rust
optdepends = gdb: rust-gdb script

View file

@ -0,0 +1,4 @@
[rust]
source = "github"
github = "rust-lang/rust"
use_max_tag = true

View file

@ -9,7 +9,7 @@ Subject: [PATCH] bootstrap: Change libexec dir
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 4957de2e1b79..8cfa026ea3ee 100644
index 90e6a10d9d68..b33a32ba23d1 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -427,7 +427,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
@ -22,7 +22,7 @@ index 4957de2e1b79..8cfa026ea3ee 100644
let libdir_relative = builder.libdir_relative(compiler);
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 3a1eb43b801f..3acd3c7881eb 100644
index a01497c2bb98..dcec060cbe35 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -852,7 +852,7 @@ fn run(self, builder: &Builder<'_>) -> Option<PathBuf> {

View file

@ -8,10 +8,10 @@ Subject: [PATCH] bootstrap: Change bash-completion dir
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 8cfa026ea3ee..31d55542ec64 100644
index b33a32ba23d1..5f5235998740 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -1112,7 +1112,11 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
@@ -1108,7 +1108,11 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
tarball.add_file(cargo, "bin", 0o755);
tarball.add_file(etc.join("_cargo"), "share/zsh/site-functions", 0o644);

View file

@ -23,10 +23,10 @@ targets, as things break when this is done:
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 945bab6887e6..ccbdc3ae298e 100644
index d2c03e588ff3..d34baca03593 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -2029,6 +2029,10 @@ pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches
@@ -2033,6 +2033,10 @@ pub fn parse_target_triple(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches
early_dcx.early_fatal(format!("target file {path:?} does not exist"))
})
}
@ -38,10 +38,10 @@ index 945bab6887e6..ccbdc3ae298e 100644
_ => TargetTriple::from_triple(host_triple()),
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
index 5584435a0ad9..06107a19948b 100644
index c95cb308d7f5..2e3074aae04b 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs
@@ -9,7 +9,7 @@ pub fn target() -> Target {
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
base.stack_probes = StackProbeType::Inline;
Target {
@ -51,10 +51,10 @@ index 5584435a0ad9..06107a19948b 100644
description: Some("32-bit Linux (kernel 3.2, glibc 2.17+)".into()),
tier: Some(1),
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
index 4a92d4ef9d5c..1618f1656270 100644
index 59ec6c7f9d5f..d8f061b24c94 100644
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
@@ -26,7 +26,7 @@ pub fn target() -> Target {
@@ -26,7 +26,7 @@ pub(crate) fn target() -> Target {
}
Target {

View file

@ -9,7 +9,7 @@ We don't ship rust-lld.
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
index f237391016e7..a333bb529627 100644
index 81b96cd39ffa..550082f1138a 100644
--- a/compiler/rustc_target/src/spec/base/wasm.rs
+++ b/compiler/rustc_target/src/spec/base/wasm.rs
@@ -85,8 +85,7 @@ macro_rules! args {

View file

@ -1,144 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Fri, 6 Sep 2024 09:21:33 -0700
Subject: [PATCH] Fix enabling wasm-component-ld to match other tools
It was [pointed out recently][comment] that enabling `wasm-component-ld`
as a host tool is different from other host tools. This commit refactors
the logic to match by deduplicating selection of when to build other
tools and then using the same logic for `wasm-component-ld`.
[comment]: https://github.com/rust-lang/rust/pull/127866#issuecomment-2333434720
---
src/bootstrap/src/core/build_steps/compile.rs | 2 +-
src/bootstrap/src/core/build_steps/dist.rs | 2 +-
src/bootstrap/src/core/build_steps/tool.rs | 38 +++----------------
src/bootstrap/src/lib.rs | 17 +++++----
4 files changed, 17 insertions(+), 42 deletions(-)
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index edf18e2ebf33..596e1eb358fa 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -1892,7 +1892,7 @@ fn run(self, builder: &Builder<'_>) -> Compiler {
// delegates to the `rust-lld` binary for linking and then runs
// logic to create the final binary. This is used by the
// `wasm32-wasip2` target of Rust.
- if builder.build_wasm_component_ld() {
+ if builder.tool_enabled("wasm-component-ld") {
let wasm_component_ld_exe =
builder.ensure(crate::core::build_steps::tool::WasmComponentLd {
compiler: build_compiler,
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 31d55542ec64..74a230416bde 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -473,7 +473,7 @@ fn prepare_image(builder: &Builder<'_>, compiler: Compiler, image: &Path) {
);
}
}
- if builder.build_wasm_component_ld() {
+ if builder.tool_enabled("wasm-component-ld") {
let src_dir = builder.sysroot_libdir(compiler, host).parent().unwrap().join("bin");
let ld = exe("wasm-component-ld", compiler.host);
builder.copy_link(&src_dir.join(&ld), &dst_dir.join(&ld));
diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs
index 3acd3c7881eb..bb9d380fb6b2 100644
--- a/src/bootstrap/src/core/build_steps/tool.rs
+++ b/src/bootstrap/src/core/build_steps/tool.rs
@@ -693,14 +693,7 @@ impl Step for Cargo {
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
- run.path("src/tools/cargo").default_condition(
- builder.config.extended
- && builder.config.tools.as_ref().map_or(
- true,
- // If `tools` is set, search list for this tool.
- |tools| tools.iter().any(|tool| tool == "cargo"),
- ),
- )
+ run.path("src/tools/cargo").default_condition(builder.tool_enabled("cargo"))
}
fn make_run(run: RunConfig<'_>) {
@@ -772,14 +765,7 @@ impl Step for RustAnalyzer {
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
- run.path("src/tools/rust-analyzer").default_condition(
- builder.config.extended
- && builder
- .config
- .tools
- .as_ref()
- .map_or(true, |tools| tools.iter().any(|tool| tool == "rust-analyzer")),
- )
+ run.path("src/tools/rust-analyzer").default_condition(builder.tool_enabled("rust-analyzer"))
}
fn make_run(run: RunConfig<'_>) {
@@ -821,12 +807,8 @@ fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/rust-analyzer")
.path("src/tools/rust-analyzer/crates/proc-macro-srv-cli")
.default_condition(
- builder.config.extended
- && builder.config.tools.as_ref().map_or(true, |tools| {
- tools.iter().any(|tool| {
- tool == "rust-analyzer" || tool == "rust-analyzer-proc-macro-srv"
- })
- }),
+ builder.tool_enabled("rust-analyzer")
+ || builder.tool_enabled("rust-analyzer-proc-macro-srv"),
)
}
@@ -874,16 +856,8 @@ impl Step for LlvmBitcodeLinker {
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
- run.path("src/tools/llvm-bitcode-linker").default_condition(
- builder.config.extended
- && builder
- .config
- .tools
- .as_ref()
- .map_or(builder.build.unstable_features(), |tools| {
- tools.iter().any(|tool| tool == "llvm-bitcode-linker")
- }),
- )
+ run.path("src/tools/llvm-bitcode-linker")
+ .default_condition(builder.tool_enabled("llvm-bitcode-linker"))
}
fn make_run(run: RunConfig<'_>) {
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 82b640f54234..fb73c5ff799a 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1379,16 +1379,17 @@ fn default_wasi_runner(&self) -> Option<String> {
None
}
- /// Returns whether it's requested that `wasm-component-ld` is built as part
- /// of the sysroot. This is done either with the `extended` key in
- /// `config.toml` or with the `tools` set.
- fn build_wasm_component_ld(&self) -> bool {
- if self.config.extended {
- return true;
+ /// Returns whether the specified tool is configured as part of this build.
+ ///
+ /// This requires that both the `extended` key is set and the `tools` key is
+ /// either unset or specifically contains the specified tool.
+ fn tool_enabled(&self, tool: &str) -> bool {
+ if !self.config.extended {
+ return false;
}
match &self.config.tools {
- Some(set) => set.contains("wasm-component-ld"),
- None => false,
+ Some(set) => set.contains(tool),
+ None => true,
}
}

View file

@ -21,8 +21,8 @@ pkgname=(
rust-src
)
epoch=1
pkgver=1.82.0
pkgrel=2
pkgver=1.83.0
pkgrel=1
pkgdesc="Systems programming language focused on safety, speed and concurrency"
url=https://www.rust-lang.org/
arch=(x86_64)
@ -64,15 +64,13 @@ source=(
0002-bootstrap-Change-bash-completion-dir.patch
0003-compiler-Change-LLVM-targets.patch
0004-compiler-Use-wasm-ld-for-wasm-targets.patch
0005-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
)
b2sums=('c95ee180622a7984d03d43bcb3dd2ae16c41f95dde88426f972f32cac6ece904ced00d90967a32829db64d8790ee042192d1102426e7a2c4f6b2ff9d14c7cf70'
b2sums=('c4b4d5ce55e07c95016c10aece82b6bf35d037f84017ad87d86d7f5a4d965393f11da309daa32b877512f41a8a9c1ff4b462a523c807eb8f8919cb9485c0767c'
'SKIP'
'87bdf52a50a6630ee431c6f81a1dc6b70161ba2301b457ab5cb1e8b3f1ef0be133090cc8afbf38c76b07eacef8de0829b601d253cdd620c752447efaace0a40a'
'365d53955a5ccf4b603ed39dd06384db063441477ed76fbbb31d7a0d46c6a297d86a0b306fcb616485c229ec8965eaa36a5b91b2398991b51f37ff58bd461054'
'b0e5c8054f5364fbbc5619674923931e5d896bf56dc1cb1b09e906b7b451d44b7af78dca848e9f8e2de4f15d014187dd25301d6e704005a1efafffe586e120de'
'963aa64d27763f063b9fac483a870563f5a71a49ec02d17b7ca0c14dbf67064ba56028bbc45f2ee50b16eada725cb55c2aa2ab17ceadff65ba9e40cb220f7a0c'
'b99ff1689f92ac50b2f64e00150ae6959cf5350dab28e773d9256ec33457684289cef37297c66943a4aa15e0128d043676fa3e498a63bd264bdff34e165e1bcc')
'329cae9618a2c7bc9a0acb67471d80e46bd17b4033ecb25780e47d8a4005a889c67f75e675a7aab0c32f35984cd0101910d3cad31b786c40d0c7d10614f07f2f'
'98faa0f85da268d7de3ec057512ee57fc415a976543b649199bc5a8fecab75ce14ce4a6efebf9d13dded1749384a2355e7674dbb2fba6e5bf3018ee20af98f69'
'9629e3af2d792cc7558c969e5ced3a25268604c9ce8204903441df11e7468455564eb43d062f661d861df9280fd972253b0523e2a47fbe6c8ac57f072f832139'
'b50e77529edc7640e2e08a434aa48591b5b809b35e61db026010e28b6c4caf61a780131500a5b0f9339d2a98177de7adb13d7589a0b2f084304d059c4de112ee')
validpgpkeys=(
108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
)
@ -93,18 +91,15 @@ prepare() {
# Use our wasm-ld
patch -Np1 -i ../0004-compiler-Use-wasm-ld-for-wasm-targets.patch
# Use our wasm-component-ld
# https://github.com/rust-lang/rust/pull/130034
patch -Np1 -i ../0005-Fix-enabling-wasm-component-ld-to-match-other-tools.patch
cat >config.toml <<END
# see src/bootstrap/defaults/
profile = "dist"
# see src/bootstrap/src/utils/change_tracker.rs
change-id = 129295
change-id = 131075
[llvm]
download-ci-llvm = false
link-shared = true
[build]