Compare commits
No commits in common. 'c9' and 'i10cs' have entirely different histories.
@ -1,2 +1,2 @@
|
||||
SOURCES/rustc-1.76.0-src.tar.xz
|
||||
SOURCES/wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
|
||||
SOURCES/rustc-1.83.0-src.tar.xz
|
||||
SOURCES/wasi-libc-wasi-sdk-24.tar.gz
|
||||
|
@ -1,2 +1,2 @@
|
||||
755339e8131d618d3c1095a581f27afc573ad310 SOURCES/rustc-1.76.0-src.tar.xz
|
||||
124d114ffb627ada36bfa1df0216bcea0f55a15e SOURCES/wasi-libc-03b228e46bb02fcc5927253e1b8ad715072b1ae4.tar.gz
|
||||
d45b38f7c4e74f62aa9f1969f144018214625125 SOURCES/rustc-1.83.0-src.tar.xz
|
||||
0d6b315ce3e7ae23a2c6b079d73fae9d3e2bb438 SOURCES/wasi-libc-wasi-sdk-24.tar.gz
|
||||
|
@ -0,0 +1,162 @@
|
||||
From 65458aed68fe6786068bab00e5a46d7ecdd2a072 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?=
|
||||
<39484203+jieyouxu@users.noreply.github.com>
|
||||
Date: Thu, 17 Oct 2024 22:58:45 +0800
|
||||
Subject: [PATCH] bootstrap: allow setting `--jobs` in config.toml
|
||||
|
||||
---
|
||||
config.example.toml | 5 ++
|
||||
src/bootstrap/src/core/config/config.rs | 5 +-
|
||||
src/bootstrap/src/core/config/flags.rs | 3 +-
|
||||
src/bootstrap/src/core/config/tests.rs | 58 +++++++++++++++++++++++
|
||||
src/bootstrap/src/utils/change_tracker.rs | 5 ++
|
||||
5 files changed, 73 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/config.example.toml b/config.example.toml
|
||||
index 4b591b949b36..168ac353cff7 100644
|
||||
--- a/config.example.toml
|
||||
+++ b/config.example.toml
|
||||
@@ -414,6 +414,11 @@
|
||||
# Specify the location of the Android NDK. Used when targeting Android.
|
||||
#android-ndk = "/path/to/android-ndk-r26d"
|
||||
|
||||
+# Number of parallel jobs to be used for building and testing. If set to `0` or
|
||||
+# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag
|
||||
+# passed to cargo invocations.
|
||||
+#jobs = 0
|
||||
+
|
||||
# =============================================================================
|
||||
# General install configuration options
|
||||
# =============================================================================
|
||||
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
|
||||
index c2ab439891ea..aeb81b146382 100644
|
||||
--- a/src/bootstrap/src/core/config/config.rs
|
||||
+++ b/src/bootstrap/src/core/config/config.rs
|
||||
@@ -891,6 +891,7 @@ struct Build {
|
||||
metrics: Option<bool> = "metrics",
|
||||
android_ndk: Option<PathBuf> = "android-ndk",
|
||||
optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
|
||||
+ jobs: Option<u32> = "jobs",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1289,7 +1290,6 @@ pub(crate) fn parse_inner(
|
||||
config.rustc_error_format = flags.rustc_error_format;
|
||||
config.json_output = flags.json_output;
|
||||
config.on_fail = flags.on_fail;
|
||||
- config.jobs = Some(threads_from_config(flags.jobs as u32));
|
||||
config.cmd = flags.cmd;
|
||||
config.incremental = flags.incremental;
|
||||
config.dry_run = if flags.dry_run { DryRun::UserSelected } else { DryRun::Disabled };
|
||||
@@ -1511,8 +1511,11 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
||||
metrics: _,
|
||||
android_ndk,
|
||||
optimized_compiler_builtins,
|
||||
+ jobs,
|
||||
} = toml.build.unwrap_or_default();
|
||||
|
||||
+ config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
|
||||
+
|
||||
if let Some(file_build) = build {
|
||||
config.build = TargetSelection::from_user(&file_build);
|
||||
};
|
||||
diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs
|
||||
index 3aefe517a5be..bfeb811508c0 100644
|
||||
--- a/src/bootstrap/src/core/config/flags.rs
|
||||
+++ b/src/bootstrap/src/core/config/flags.rs
|
||||
@@ -110,11 +110,10 @@ pub struct Flags {
|
||||
short,
|
||||
long,
|
||||
value_hint = clap::ValueHint::Other,
|
||||
- default_value_t = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get),
|
||||
value_name = "JOBS"
|
||||
)]
|
||||
/// number of jobs to run in parallel
|
||||
- pub jobs: usize,
|
||||
+ pub jobs: Option<u32>,
|
||||
// This overrides the deny-warnings configuration option,
|
||||
// which passes -Dwarnings to the compiler invocations.
|
||||
#[arg(global = true, long)]
|
||||
diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
|
||||
index 2611b6cf51bb..1f02757682c2 100644
|
||||
--- a/src/bootstrap/src/core/config/tests.rs
|
||||
+++ b/src/bootstrap/src/core/config/tests.rs
|
||||
@@ -352,3 +352,61 @@ fn parse_rust_std_features_empty() {
|
||||
fn parse_rust_std_features_invalid() {
|
||||
parse("rust.std-features = \"backtrace\"");
|
||||
}
|
||||
+
|
||||
+#[test]
|
||||
+fn parse_jobs() {
|
||||
+ assert_eq!(parse("build.jobs = 1").jobs, Some(1));
|
||||
+}
|
||||
+
|
||||
+#[test]
|
||||
+fn jobs_precedence() {
|
||||
+ // `--jobs` should take precedence over using `--set build.jobs`.
|
||||
+
|
||||
+ let config = Config::parse_inner(
|
||||
+ Flags::parse(&[
|
||||
+ "check".to_owned(),
|
||||
+ "--config=/does/not/exist".to_owned(),
|
||||
+ "--jobs=67890".to_owned(),
|
||||
+ "--set=build.jobs=12345".to_owned(),
|
||||
+ ]),
|
||||
+ |&_| toml::from_str(""),
|
||||
+ );
|
||||
+ assert_eq!(config.jobs, Some(67890));
|
||||
+
|
||||
+ // `--set build.jobs` should take precedence over `config.toml`.
|
||||
+ let config = Config::parse_inner(
|
||||
+ Flags::parse(&[
|
||||
+ "check".to_owned(),
|
||||
+ "--config=/does/not/exist".to_owned(),
|
||||
+ "--set=build.jobs=12345".to_owned(),
|
||||
+ ]),
|
||||
+ |&_| {
|
||||
+ toml::from_str(
|
||||
+ r#"
|
||||
+ [build]
|
||||
+ jobs = 67890
|
||||
+ "#,
|
||||
+ )
|
||||
+ },
|
||||
+ );
|
||||
+ assert_eq!(config.jobs, Some(12345));
|
||||
+
|
||||
+ // `--jobs` > `--set build.jobs` > `config.toml`
|
||||
+ let config = Config::parse_inner(
|
||||
+ Flags::parse(&[
|
||||
+ "check".to_owned(),
|
||||
+ "--jobs=123".to_owned(),
|
||||
+ "--config=/does/not/exist".to_owned(),
|
||||
+ "--set=build.jobs=456".to_owned(),
|
||||
+ ]),
|
||||
+ |&_| {
|
||||
+ toml::from_str(
|
||||
+ r#"
|
||||
+ [build]
|
||||
+ jobs = 789
|
||||
+ "#,
|
||||
+ )
|
||||
+ },
|
||||
+ );
|
||||
+ assert_eq!(config.jobs, Some(123));
|
||||
+}
|
||||
diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
|
||||
index b37786496cb5..9169bc90a45d 100644
|
||||
--- a/src/bootstrap/src/utils/change_tracker.rs
|
||||
+++ b/src/bootstrap/src/utils/change_tracker.rs
|
||||
@@ -275,4 +275,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
|
||||
severity: ChangeSeverity::Info,
|
||||
summary: "New option `./x setup editor` added, replacing `./x setup vscode` and adding support for vim, emacs and helix.",
|
||||
},
|
||||
+ ChangeInfo {
|
||||
+ change_id: 131838,
|
||||
+ severity: ChangeSeverity::Info,
|
||||
+ summary: "Allow setting `--jobs` in config.toml with `build.jobs`.",
|
||||
+ },
|
||||
];
|
||||
--
|
||||
2.47.0
|
||||
|
@ -0,0 +1,62 @@
|
||||
# rust_arches: list of architectures where building Rust is supported
|
||||
#
|
||||
# Since RPM itself now depends on Rust code (via its GPG backend, rpm-sequoia),
|
||||
# this list will probably always be a superset of all architectures that are
|
||||
# supported by Fedora, which is why it is no longer required to set
|
||||
# "ExclusiveArch: rust_arches" for Rust packages in Fedora.
|
||||
%rust_arches x86_64 %{ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x
|
||||
|
||||
# version_no_tilde: lua macro for reconstructing the original crate version
|
||||
# from the RPM version (i.e. replace any "~" characters with "-")
|
||||
%version_no_tilde() %{lua:
|
||||
local sep = rpm.expand('%1')
|
||||
local ver = rpm.expand('%2')
|
||||
\
|
||||
if sep == '%1' then
|
||||
sep = '-'
|
||||
end
|
||||
\
|
||||
if ver == '%2' then
|
||||
ver = rpm.expand('%version')
|
||||
end
|
||||
ver = ver:gsub('~', sep)
|
||||
\
|
||||
print(ver)
|
||||
}
|
||||
|
||||
# __crates_url: default API endpoint for downloading .crate files from crates.io
|
||||
%__crates_url https://crates.io/api/v1/crates/
|
||||
|
||||
# crates_source: lua macro for constructing the Source URL for a crate
|
||||
%crates_source() %{lua:
|
||||
local crate = rpm.expand('%1')
|
||||
local version = rpm.expand('%2')
|
||||
local url = rpm.expand('%__crates_url')
|
||||
\
|
||||
-- first argument missing: fall back to %crate
|
||||
if crate == '%1' then
|
||||
crate = rpm.expand('%crate')
|
||||
end
|
||||
-- %crate macro not defined: fall back to %name
|
||||
if crate == '%crate' then
|
||||
crate = rpm.expand('%name')
|
||||
end
|
||||
\
|
||||
-- second argument missing: fall back to %crate_version
|
||||
if version == '%2' then
|
||||
version = rpm.expand('%crate_version')
|
||||
end
|
||||
-- %crate_version macro not defined: fall back to %version
|
||||
if version == '%crate_version' then
|
||||
version = rpm.expand('%version')
|
||||
end
|
||||
-- replace '~' with '-' for backwards compatibility
|
||||
-- can be removed in the future
|
||||
version = version:gsub('~', '-')
|
||||
\
|
||||
print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate')
|
||||
}
|
||||
|
||||
# __cargo_skip_build: unused macro, set to 0 for backwards compatibility
|
||||
%__cargo_skip_build 0
|
||||
|
@ -1,42 +0,0 @@
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-01-07 18:12:08.000000000 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-01-09 15:25:51.519781381 -0800
|
||||
@@ -2071,7 +2071,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -2113,20 +2112,6 @@
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
-
|
||||
-[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.3.0"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
|
||||
[[package]]
|
||||
name = "libz-sys"
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-01-09 15:23:02.369032291 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-01-09 15:24:44.015679666 -0800
|
||||
@@ -40,7 +40,7 @@
|
||||
curl-sys = "0.4.70"
|
||||
filetime = "0.2.22"
|
||||
flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
|
||||
-git2 = "0.18.1"
|
||||
+git2 = { version = "0.18.1", default-features = false, features = ["https"] }
|
||||
git2-curl = "0.19.0"
|
||||
gix = { version = "0.56.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
|
||||
gix-features-for-configuration-only = { version = "0.35.0", package = "gix-features", features = [ "parallel" ] }
|
@ -1,21 +0,0 @@
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-01-07 18:12:08.000000000 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-01-09 15:36:23.808367445 -0800
|
||||
@@ -2109,7 +2109,6 @@
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716"
|
||||
dependencies = [
|
||||
- "cc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-01-07 18:12:08.000000000 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-01-09 15:36:18.534437627 -0800
|
||||
@@ -73,7 +73,7 @@
|
||||
pulldown-cmark = { version = "0.9.3", default-features = false }
|
||||
rand = "0.8.5"
|
||||
regex = "1.10.2"
|
||||
-rusqlite = { version = "0.30.0", features = ["bundled"] }
|
||||
+rusqlite = { version = "0.30.0", features = [] }
|
||||
rustfix = { version = "0.7.0", path = "crates/rustfix" }
|
||||
same-file = "1.0.6"
|
||||
security-framework = "2.9.2"
|
@ -0,0 +1,44 @@
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-09-06 10:36:55.743405666 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-09-06 10:36:55.745405652 -0700
|
||||
@@ -2156,7 +2156,6 @@ checksum = "10472326a8a6477c3c20a64547b0
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -2197,20 +2196,6 @@ dependencies = [
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
-
|
||||
-[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.3.0"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
|
||||
[[package]]
|
||||
name = "libz-sys"
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-09-06 10:36:55.746405645 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-09-06 10:37:13.849280464 -0700
|
||||
@@ -44,7 +44,7 @@ curl = "0.4.46"
|
||||
curl-sys = "0.4.73"
|
||||
filetime = "0.2.23"
|
||||
flate2 = { version = "1.0.30", default-features = false, features = ["zlib"] }
|
||||
-git2 = "0.19.0"
|
||||
+git2 = { version = "0.19.0", default-features = false, features = ["https"] }
|
||||
git2-curl = "0.20.0"
|
||||
gix = { version = "0.64.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
|
||||
glob = "0.3.1"
|
@ -0,0 +1,23 @@
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2024-09-06 10:30:29.435107742 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2024-09-06 10:31:57.168492758 -0700
|
||||
@@ -2194,7 +2194,6 @@ version = "0.30.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
|
||||
dependencies = [
|
||||
- "cc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2024-09-06 10:30:29.435107742 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2024-09-06 10:31:27.942697616 -0700
|
||||
@@ -77,7 +77,7 @@ proptest = "1.5.0"
|
||||
pulldown-cmark = { version = "0.11.0", default-features = false, features = ["html"] }
|
||||
rand = "0.8.5"
|
||||
regex = "1.10.5"
|
||||
-rusqlite = { version = "0.32.0", features = ["bundled"] }
|
||||
+rusqlite = { version = "0.32.0", features = [] }
|
||||
rustfix = { version = "0.8.2", path = "crates/rustfix" }
|
||||
same-file = "1.0.6"
|
||||
security-framework = "2.11.1"
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue