зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1337955 - Switch the toolchains project branch to nightly rust compiler. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D210761
This commit is contained in:
Родитель
ffb57d1e53
Коммит
895fc56d4f
|
@ -0,0 +1,413 @@
|
|||
Teaches Cargo to source all std dependencies from vendored sources in the rust-src
|
||||
component, making -Zbuild-std compatible with vendored builds.
|
||||
|
||||
This was originally landed in https://github.com/rust-lang/cargo/pull/8834
|
||||
but was backed out for causing breakage in other situations. It works fine
|
||||
for Firefox's usecase, though.
|
||||
|
||||
Most of these changes just add/edit tests for the functionality. Only the
|
||||
change to src/cargo/core/compiler/standard_lib.rs is important.
|
||||
|
||||
diff --git a/src/cargo/core/compiler/standard_lib.rs b/src/cargo/core/compiler/standard_lib.rs
|
||||
index 684e4426c..83649cedf 100644
|
||||
--- a/src/cargo/core/compiler/standard_lib.rs
|
||||
+++ b/src/cargo/core/compiler/standard_lib.rs
|
||||
@@ -11,6 +11,7 @@ use crate::ops::{self, Packages};
|
||||
use crate::util::errors::CargoResult;
|
||||
use crate::GlobalContext;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
+use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -74,27 +75,45 @@ pub fn resolve_std<'gctx>(
|
||||
}
|
||||
|
||||
let src_path = detect_sysroot_src_path(target_data)?;
|
||||
- let to_patch = [
|
||||
- "rustc-std-workspace-core",
|
||||
- "rustc-std-workspace-alloc",
|
||||
- "rustc-std-workspace-std",
|
||||
- ];
|
||||
- let patches = to_patch
|
||||
- .iter()
|
||||
- .map(|&name| {
|
||||
- let source_path = SourceId::for_path(&src_path.join("library").join(name))?;
|
||||
- let dep = Dependency::parse(name, None, source_path)?;
|
||||
+
|
||||
+ // Special std packages should be pulled from `library/` and should be
|
||||
+ // prefixed with `rustc-std-workspace-` in certain places.
|
||||
+ let libs_prefix = "library/";
|
||||
+ let special_std_prefix = "rustc-std-workspace-";
|
||||
+ let libs_path = src_path.join(libs_prefix);
|
||||
+
|
||||
+ // Crates in rust-src to build. libsysroot is in some sense the "root" package
|
||||
+ // of std, as nothing else depends on it, so it must be explicitly added.
|
||||
+ let mut members = vec![format!("{}sysroot", libs_prefix)];
|
||||
+
|
||||
+ // If rust-src contains a "vendor" directory, then patch in all the crates it contains.
|
||||
+ let vendor_path = src_path.join("vendor");
|
||||
+ let vendor_dir = fs::read_dir(vendor_path)?;
|
||||
+ let patches = vendor_dir
|
||||
+ .into_iter()
|
||||
+ .map(|entry| {
|
||||
+ let entry = entry?;
|
||||
+ let name = entry
|
||||
+ .file_name()
|
||||
+ .into_string()
|
||||
+ .map_err(|_| anyhow::anyhow!("package name wasn't utf8"))?;
|
||||
+
|
||||
+ // Remap the rustc-std-workspace crates to the actual rust-src libraries
|
||||
+ let path = if let Some(real_name) = name.strip_prefix(special_std_prefix) {
|
||||
+ // Record this crate as something to build in the workspace
|
||||
+ members.push(format!("{}{}", libs_prefix, real_name));
|
||||
+ libs_path.join(&name)
|
||||
+ } else {
|
||||
+ entry.path()
|
||||
+ };
|
||||
+ let source_path = SourceId::for_path(&path)?;
|
||||
+ let dep = Dependency::parse(&name, None, source_path)?;
|
||||
Ok(dep)
|
||||
})
|
||||
.collect::<CargoResult<Vec<_>>>()?;
|
||||
+
|
||||
let crates_io_url = crate::sources::CRATES_IO_INDEX.parse().unwrap();
|
||||
let patch = HashMap::from([(crates_io_url, patches)]);
|
||||
- let members = vec![
|
||||
- String::from("library/std"),
|
||||
- String::from("library/core"),
|
||||
- String::from("library/alloc"),
|
||||
- String::from("library/sysroot"),
|
||||
- ];
|
||||
let ws_config = crate::core::WorkspaceConfig::Root(crate::core::WorkspaceRootConfig::new(
|
||||
&src_path,
|
||||
&Some(members),
|
||||
diff --git a/tests/testsuite/mock-std/library/test/Cargo.toml b/tests/testsuite/mock-std/library/test/Cargo.toml
|
||||
index b9f51eda7..fed5f3973 100644
|
||||
--- a/tests/testsuite/mock-std/library/test/Cargo.toml
|
||||
+++ b/tests/testsuite/mock-std/library/test/Cargo.toml
|
||||
@@ -9,3 +9,4 @@ std = { path = "../std" }
|
||||
panic_unwind = { path = "../panic_unwind" }
|
||||
compiler_builtins = { path = "../compiler_builtins" }
|
||||
registry-dep-using-std = { version = "*", features = ['mockbuild'] }
|
||||
+registry-dep-only-used-by-test = { version = "*" }
|
||||
diff --git a/tests/testsuite/mock-std/library/test/src/lib.rs b/tests/testsuite/mock-std/library/test/src/lib.rs
|
||||
index a112855f5..224b89bb2 100644
|
||||
--- a/tests/testsuite/mock-std/library/test/src/lib.rs
|
||||
+++ b/tests/testsuite/mock-std/library/test/src/lib.rs
|
||||
@@ -7,4 +7,5 @@ extern crate test;
|
||||
pub use test::*;
|
||||
|
||||
pub fn custom_api() {
|
||||
+ registry_dep_only_used_by_test::wow_testing_is_so_easy();
|
||||
}
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/Cargo.toml b/tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..31ba65a98
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/Cargo.toml
|
||||
@@ -0,0 +1,9 @@
|
||||
+[package]
|
||||
+name = "registry-dep-only-used-by-test"
|
||||
+version = "1.0.0"
|
||||
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
+edition = "2018"
|
||||
+
|
||||
+[dependencies]
|
||||
+
|
||||
+[features]
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/src/lib.rs b/tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/src/lib.rs
|
||||
new file mode 100644
|
||||
index 000000000..a68d2aeef
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-only-used-by-test/src/lib.rs
|
||||
@@ -0,0 +1,2 @@
|
||||
+pub fn wow_testing_is_so_easy() {
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-using-alloc/Cargo.toml b/tests/testsuite/mock-std/vendor/registry-dep-using-alloc/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..f7e4ab232
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-using-alloc/Cargo.toml
|
||||
@@ -0,0 +1,12 @@
|
||||
+[package]
|
||||
+name = "registry-dep-using-alloc"
|
||||
+version = "1.0.0"
|
||||
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
+edition = "2018"
|
||||
+
|
||||
+[dependencies]
|
||||
+rustc-std-workspace-alloc = { version = "*", optional = true }
|
||||
+rustc-std-workspace-core = { version = "*", optional = true }
|
||||
+
|
||||
+[features]
|
||||
+mockbuild = ["rustc-std-workspace-alloc", "rustc-std-workspace-core"]
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-using-alloc/src/lib.rs b/tests/testsuite/mock-std/vendor/registry-dep-using-alloc/src/lib.rs
|
||||
new file mode 100644
|
||||
index 000000000..b9ab30339
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-using-alloc/src/lib.rs
|
||||
@@ -0,0 +1,9 @@
|
||||
+#[cfg(feature = "mockbuild")]
|
||||
+pub fn custom_api() {
|
||||
+}
|
||||
+
|
||||
+#[cfg(not(feature = "mockbuild"))]
|
||||
+pub fn non_sysroot_api() {
|
||||
+ core::custom_api();
|
||||
+ alloc::custom_api();
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-using-core/Cargo.toml b/tests/testsuite/mock-std/vendor/registry-dep-using-core/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..befb83a63
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-using-core/Cargo.toml
|
||||
@@ -0,0 +1,11 @@
|
||||
+[package]
|
||||
+name = "registry-dep-using-core"
|
||||
+version = "1.0.0"
|
||||
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
+edition = "2018"
|
||||
+
|
||||
+[dependencies]
|
||||
+rustc-std-workspace-core = { version = "*", optional = true }
|
||||
+
|
||||
+[features]
|
||||
+mockbuild = ["rustc-std-workspace-core"]
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-using-core/src/lib.rs b/tests/testsuite/mock-std/vendor/registry-dep-using-core/src/lib.rs
|
||||
new file mode 100644
|
||||
index 000000000..f9dbac0f4
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-using-core/src/lib.rs
|
||||
@@ -0,0 +1,8 @@
|
||||
+#[cfg(feature = "mockbuild")]
|
||||
+pub fn custom_api() {
|
||||
+}
|
||||
+
|
||||
+#[cfg(not(feature = "mockbuild"))]
|
||||
+pub fn non_sysroot_api() {
|
||||
+ core::custom_api();
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-using-std/Cargo.toml b/tests/testsuite/mock-std/vendor/registry-dep-using-std/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..71ef0a42f
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-using-std/Cargo.toml
|
||||
@@ -0,0 +1,11 @@
|
||||
+[package]
|
||||
+name = "registry-dep-using-std"
|
||||
+version = "1.0.0"
|
||||
+authors = ["Alex Crichton <alex@alexcrichton.com>"]
|
||||
+edition = "2018"
|
||||
+
|
||||
+[dependencies]
|
||||
+rustc-std-workspace-std = { version = "*", optional = true }
|
||||
+
|
||||
+[features]
|
||||
+mockbuild = ["rustc-std-workspace-std"]
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/registry-dep-using-std/src/lib.rs b/tests/testsuite/mock-std/vendor/registry-dep-using-std/src/lib.rs
|
||||
new file mode 100644
|
||||
index 000000000..f3af39178
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/registry-dep-using-std/src/lib.rs
|
||||
@@ -0,0 +1,8 @@
|
||||
+#[cfg(feature = "mockbuild")]
|
||||
+pub fn custom_api() {
|
||||
+}
|
||||
+
|
||||
+#[cfg(not(feature = "mockbuild"))]
|
||||
+pub fn non_sysroot_api() {
|
||||
+ std::custom_api();
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/rustc-std-workspace-alloc/Cargo.toml b/tests/testsuite/mock-std/vendor/rustc-std-workspace-alloc/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..4465a08a8
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/rustc-std-workspace-alloc/Cargo.toml
|
||||
@@ -0,0 +1 @@
|
||||
+this file shouldn't be read
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/rustc-std-workspace-core/Cargo.toml b/tests/testsuite/mock-std/vendor/rustc-std-workspace-core/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..4465a08a8
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/rustc-std-workspace-core/Cargo.toml
|
||||
@@ -0,0 +1 @@
|
||||
+this file shouldn't be read
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/mock-std/vendor/rustc-std-workspace-std/Cargo.toml b/tests/testsuite/mock-std/vendor/rustc-std-workspace-std/Cargo.toml
|
||||
new file mode 100644
|
||||
index 000000000..4465a08a8
|
||||
--- /dev/null
|
||||
+++ b/tests/testsuite/mock-std/vendor/rustc-std-workspace-std/Cargo.toml
|
||||
@@ -0,0 +1 @@
|
||||
+this file shouldn't be read
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/testsuite/standard_lib.rs b/tests/testsuite/standard_lib.rs
|
||||
index d3be303ea..486a9b4e0 100644
|
||||
--- a/tests/testsuite/standard_lib.rs
|
||||
+++ b/tests/testsuite/standard_lib.rs
|
||||
@@ -15,71 +15,18 @@ struct Setup {
|
||||
}
|
||||
|
||||
fn setup() -> Setup {
|
||||
- // Our mock sysroot requires a few packages from crates.io, so make sure
|
||||
- // they're "published" to crates.io. Also edit their code a bit to make sure
|
||||
- // that they have access to our custom crates with custom apis.
|
||||
+ // Register a version of one of the std dependencies that doesn't compile.
|
||||
+ // This ensures that the mock-std's vendor is actually being used.
|
||||
Package::new("registry-dep-using-core", "1.0.0")
|
||||
.file(
|
||||
"src/lib.rs",
|
||||
"
|
||||
- #![no_std]
|
||||
-
|
||||
- #[cfg(feature = \"mockbuild\")]
|
||||
- pub fn custom_api() {
|
||||
- }
|
||||
-
|
||||
- #[cfg(not(feature = \"mockbuild\"))]
|
||||
- pub fn non_sysroot_api() {
|
||||
- core::custom_api();
|
||||
- }
|
||||
+ don't compile me bro!!
|
||||
",
|
||||
)
|
||||
.add_dep(Dependency::new("rustc-std-workspace-core", "*").optional(true))
|
||||
.feature("mockbuild", &["rustc-std-workspace-core"])
|
||||
.publish();
|
||||
- Package::new("registry-dep-using-alloc", "1.0.0")
|
||||
- .file(
|
||||
- "src/lib.rs",
|
||||
- "
|
||||
- #![no_std]
|
||||
-
|
||||
- extern crate alloc;
|
||||
-
|
||||
- #[cfg(feature = \"mockbuild\")]
|
||||
- pub fn custom_api() {
|
||||
- }
|
||||
-
|
||||
- #[cfg(not(feature = \"mockbuild\"))]
|
||||
- pub fn non_sysroot_api() {
|
||||
- core::custom_api();
|
||||
- alloc::custom_api();
|
||||
- }
|
||||
- ",
|
||||
- )
|
||||
- .add_dep(Dependency::new("rustc-std-workspace-core", "*").optional(true))
|
||||
- .add_dep(Dependency::new("rustc-std-workspace-alloc", "*").optional(true))
|
||||
- .feature(
|
||||
- "mockbuild",
|
||||
- &["rustc-std-workspace-core", "rustc-std-workspace-alloc"],
|
||||
- )
|
||||
- .publish();
|
||||
- Package::new("registry-dep-using-std", "1.0.0")
|
||||
- .file(
|
||||
- "src/lib.rs",
|
||||
- "
|
||||
- #[cfg(feature = \"mockbuild\")]
|
||||
- pub fn custom_api() {
|
||||
- }
|
||||
-
|
||||
- #[cfg(not(feature = \"mockbuild\"))]
|
||||
- pub fn non_sysroot_api() {
|
||||
- std::custom_api();
|
||||
- }
|
||||
- ",
|
||||
- )
|
||||
- .add_dep(Dependency::new("rustc-std-workspace-std", "*").optional(true))
|
||||
- .feature("mockbuild", &["rustc-std-workspace-std"])
|
||||
- .publish();
|
||||
|
||||
let p = ProjectBuilder::new(paths::root().join("rustc-wrapper"))
|
||||
.file(
|
||||
@@ -335,6 +282,81 @@ fn depend_same_as_std() {
|
||||
fn test() {
|
||||
let setup = setup();
|
||||
|
||||
+ // Our mock sysroot requires a few packages from crates.io, so make sure
|
||||
+ // they're "published" to crates.io. Also edit their code a bit to make sure
|
||||
+ // that they have access to our custom crates with custom apis.
|
||||
+ Package::new("registry-dep-using-core", "1.0.0")
|
||||
+ .file(
|
||||
+ "src/lib.rs",
|
||||
+ "
|
||||
+ #![no_std]
|
||||
+
|
||||
+ #[cfg(feature = \"mockbuild\")]
|
||||
+ pub fn custom_api() {
|
||||
+ }
|
||||
+
|
||||
+ #[cfg(not(feature = \"mockbuild\"))]
|
||||
+ pub fn non_sysroot_api() {
|
||||
+ core::custom_api();
|
||||
+ }
|
||||
+ ",
|
||||
+ )
|
||||
+ .add_dep(Dependency::new("rustc-std-workspace-core", "*").optional(true))
|
||||
+ .feature("mockbuild", &["rustc-std-workspace-core"])
|
||||
+ .publish();
|
||||
+ Package::new("registry-dep-using-alloc", "1.0.0")
|
||||
+ .file(
|
||||
+ "src/lib.rs",
|
||||
+ "
|
||||
+ #![no_std]
|
||||
+
|
||||
+ extern crate alloc;
|
||||
+
|
||||
+ #[cfg(feature = \"mockbuild\")]
|
||||
+ pub fn custom_api() {
|
||||
+ }
|
||||
+
|
||||
+ #[cfg(not(feature = \"mockbuild\"))]
|
||||
+ pub fn non_sysroot_api() {
|
||||
+ core::custom_api();
|
||||
+ alloc::custom_api();
|
||||
+ }
|
||||
+ ",
|
||||
+ )
|
||||
+ .add_dep(Dependency::new("rustc-std-workspace-core", "*").optional(true))
|
||||
+ .add_dep(Dependency::new("rustc-std-workspace-alloc", "*").optional(true))
|
||||
+ .feature(
|
||||
+ "mockbuild",
|
||||
+ &["rustc-std-workspace-core", "rustc-std-workspace-alloc"],
|
||||
+ )
|
||||
+ .publish();
|
||||
+ Package::new("registry-dep-using-std", "1.0.0")
|
||||
+ .file(
|
||||
+ "src/lib.rs",
|
||||
+ "
|
||||
+ #[cfg(feature = \"mockbuild\")]
|
||||
+ pub fn custom_api() {
|
||||
+ }
|
||||
+
|
||||
+ #[cfg(not(feature = \"mockbuild\"))]
|
||||
+ pub fn non_sysroot_api() {
|
||||
+ std::custom_api();
|
||||
+ }
|
||||
+ ",
|
||||
+ )
|
||||
+ .add_dep(Dependency::new("rustc-std-workspace-std", "*").optional(true))
|
||||
+ .feature("mockbuild", &["rustc-std-workspace-std"])
|
||||
+ .publish();
|
||||
+ Package::new("registry-dep-only-used-by-test", "1.0.0")
|
||||
+ .file(
|
||||
+ "src/lib.rs",
|
||||
+ "
|
||||
+ pub fn wow_testing_is_so_easy() {
|
||||
+ }
|
||||
+ ",
|
||||
+ )
|
||||
+ .publish();
|
||||
+
|
||||
let p = project()
|
||||
.file(
|
||||
"src/lib.rs",
|
|
@ -16,10 +16,10 @@ fn main() {
|
|||
println!("cargo:rerun-if-changed=wrappers.cpp");
|
||||
|
||||
let ver = version().unwrap();
|
||||
let max_oom_hook_version = Version::parse("1.79.0-alpha").unwrap();
|
||||
let max_oom_hook_version = Version::parse("1.81.0-alpha").unwrap();
|
||||
// The new alloc error panic feature was temporarily reverted. We kept the
|
||||
// code in tree, but the version here is such that it's effectively never used.
|
||||
let max_alloc_error_panic_version = Version::parse("1.79.0-alpha").unwrap();
|
||||
let max_alloc_error_panic_version = Version::parse("1.81.0-alpha").unwrap();
|
||||
|
||||
if ver >= Version::parse("1.80.0-alpha").unwrap() {
|
||||
println!("cargo::rustc-check-cfg=cfg(oom_with, values(\"hook\", \"alloc_error_panic\"))");
|
||||
|
|
|
@ -388,6 +388,14 @@ rust-1.78.0:
|
|||
repo: https://github.com/rust-lang/rust/
|
||||
revision: 9b00956e56009bab2aa15d7bff10916599e3d6d6
|
||||
|
||||
rust-nightly:
|
||||
description: Rust nightly source code
|
||||
fetch:
|
||||
type: git
|
||||
include-dot-git: true
|
||||
repo: https://github.com/rust-lang/rust/
|
||||
branch: master
|
||||
|
||||
wasi-sdk-11:
|
||||
description: wasi-sdk-11 source code
|
||||
fetch:
|
||||
|
|
|
@ -66,11 +66,14 @@ linux64-rust-1.78:
|
|||
'--target', 'aarch64-unknown-linux-gnu',
|
||||
'--target', 'wasm32-wasi',
|
||||
]
|
||||
toolchain-alias: linux64-rust
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust
|
||||
|
||||
# A patched rust toolchain that allows us to use sanitizers in our vendored
|
||||
# build environment. See the rust fetch's comments for more details.
|
||||
linux64-rust-dev:
|
||||
linux64-rust-1.78-dev:
|
||||
description: "build rust from source"
|
||||
worker-type: b-linux-large-gcp
|
||||
treeherder:
|
||||
|
@ -88,6 +91,10 @@ linux64-rust-dev:
|
|||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-dev
|
||||
fetches:
|
||||
fetch:
|
||||
- rust-1.78.0
|
||||
|
@ -116,7 +123,10 @@ linux64-rust-cross-1.78:
|
|||
'--target', 'i686-linux-android',
|
||||
'--target', 'x86_64-linux-android',
|
||||
]
|
||||
toolchain-alias: linux64-rust-cross
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-cross
|
||||
|
||||
linux64-rust-static-1.78:
|
||||
description: "rust repack with static linking support"
|
||||
|
@ -132,7 +142,10 @@ linux64-rust-static-1.78:
|
|||
'--target', 'i686-unknown-linux-gnu',
|
||||
'--target', 'i686-unknown-linux-musl',
|
||||
]
|
||||
toolchain-alias: linux64-rust-static
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-static
|
||||
|
||||
linux64-rust-macos-1.78:
|
||||
description: "rust repack with macos-cross support"
|
||||
|
@ -146,7 +159,10 @@ linux64-rust-macos-1.78:
|
|||
'--target', 'x86_64-apple-darwin',
|
||||
'--target', 'aarch64-apple-darwin',
|
||||
]
|
||||
toolchain-alias: linux64-rust-macos
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-macos
|
||||
|
||||
linux64-rust-ios-1.78:
|
||||
description: "rust repack with ios-cross support"
|
||||
|
@ -160,7 +176,10 @@ linux64-rust-ios-1.78:
|
|||
'--target', 'aarch64-apple-ios',
|
||||
'--target', 'aarch64-apple-ios-sim',
|
||||
]
|
||||
toolchain-alias: linux64-rust-ios
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-ios
|
||||
|
||||
linux64-rust-android-1.78:
|
||||
description: "rust repack with android-cross support"
|
||||
|
@ -177,7 +196,10 @@ linux64-rust-android-1.78:
|
|||
'--target', 'i686-linux-android',
|
||||
'--target', 'x86_64-linux-android',
|
||||
]
|
||||
toolchain-alias: linux64-rust-android
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-android
|
||||
|
||||
linux64-rust-windows-1.78:
|
||||
description: "rust repack with windows-cross support"
|
||||
|
@ -192,7 +214,10 @@ linux64-rust-windows-1.78:
|
|||
'--target', 'i686-pc-windows-msvc',
|
||||
'--target', 'aarch64-pc-windows-msvc',
|
||||
]
|
||||
toolchain-alias: linux64-rust-windows
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: linux64-rust-windows
|
||||
|
||||
win64-rust-1.78:
|
||||
treeherder:
|
||||
|
@ -205,7 +230,10 @@ win64-rust-1.78:
|
|||
'--target', 'i686-pc-windows-msvc',
|
||||
'--target', 'aarch64-pc-windows-msvc',
|
||||
]
|
||||
toolchain-alias: win64-rust
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: win64-rust
|
||||
|
||||
macosx64-rust-1.78:
|
||||
treeherder:
|
||||
|
@ -216,7 +244,10 @@ macosx64-rust-1.78:
|
|||
'--host', 'x86_64-apple-darwin',
|
||||
'--target', 'x86_64-apple-darwin',
|
||||
]
|
||||
toolchain-alias: macosx64-rust
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: macosx64-rust
|
||||
|
||||
mingw32-rust-1.78:
|
||||
treeherder:
|
||||
|
@ -230,4 +261,241 @@ mingw32-rust-1.78:
|
|||
'--target', 'x86_64-pc-windows-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
]
|
||||
toolchain-alias: mingw32-rust
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: null
|
||||
default: mingw32-rust
|
||||
|
||||
linux64-rust-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
treeherder:
|
||||
symbol: TL(rust-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'i686-unknown-linux-gnu',
|
||||
'--target', 'aarch64-unknown-linux-gnu',
|
||||
'--target', 'wasm32-wasi',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust
|
||||
default: null
|
||||
|
||||
# A patched rust toolchain that allows us to use sanitizers in our vendored
|
||||
# build environment. See the rust fetch's comments for more details.
|
||||
linux64-rust-nightly-dev:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "build rust from source"
|
||||
worker-type: b-linux-large-gcp
|
||||
treeherder:
|
||||
symbol: TL(rust-dev-nightly)
|
||||
worker:
|
||||
env:
|
||||
# Work around https://github.com/rust-lang/rust/issues/105967
|
||||
RUSTFLAGS_BOOTSTRAP: '-Clink-arg=-Wl,--undefined-version'
|
||||
RUSTFLAGS_NOT_BOOTSTRAP: '-Clink-arg=-Wl,--undefined-version'
|
||||
run:
|
||||
arguments: [
|
||||
'--patch', 'rust-vendor-std.patch',
|
||||
'--patch', 'src/tools/cargo:cargo-vendor-std-1.79.patch',
|
||||
'--channel', 'dev',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-dev
|
||||
default: null
|
||||
fetches:
|
||||
fetch:
|
||||
- rust-nightly
|
||||
toolchain:
|
||||
- linux64-clang-toolchain
|
||||
- linux64-toolchain-sysroot
|
||||
|
||||
linux64-rust-cross-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "rust repack with macos and windows cross support"
|
||||
treeherder:
|
||||
symbol: TL(rust-cross-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'i686-unknown-linux-gnu',
|
||||
'--target', 'x86_64-apple-darwin',
|
||||
'--target', 'aarch64-apple-darwin',
|
||||
'--target', 'x86_64-pc-windows-msvc',
|
||||
'--target', 'i686-pc-windows-msvc',
|
||||
'--target', 'aarch64-pc-windows-msvc',
|
||||
'--target', 'armv7-linux-androideabi',
|
||||
'--target', 'thumbv7neon-linux-androideabi',
|
||||
'--target', 'aarch64-linux-android',
|
||||
'--target', 'i686-linux-android',
|
||||
'--target', 'x86_64-linux-android',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-cross
|
||||
default: null
|
||||
|
||||
linux64-rust-static-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "rust repack with static linking support"
|
||||
treeherder:
|
||||
symbol: TL(rust-static-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'aarch64-unknown-linux-musl',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-musl',
|
||||
'--target', 'i686-unknown-linux-gnu',
|
||||
'--target', 'i686-unknown-linux-musl',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-static
|
||||
default: null
|
||||
|
||||
linux64-rust-macos-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "rust repack with macos-cross support"
|
||||
treeherder:
|
||||
symbol: TL(rust-macos-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-apple-darwin',
|
||||
'--target', 'aarch64-apple-darwin',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-macos
|
||||
default: null
|
||||
|
||||
linux64-rust-ios-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "rust repack with ios-cross support"
|
||||
treeherder:
|
||||
symbol: TL(rust-ios-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'aarch64-apple-ios',
|
||||
'--target', 'aarch64-apple-ios-sim',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-ios
|
||||
default: null
|
||||
|
||||
linux64-rust-android-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "rust repack with android-cross support"
|
||||
treeherder:
|
||||
symbol: TL(rust-android-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'armv7-linux-androideabi',
|
||||
'--target', 'thumbv7neon-linux-androideabi',
|
||||
'--target', 'aarch64-linux-android',
|
||||
'--target', 'i686-linux-android',
|
||||
'--target', 'x86_64-linux-android',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-android
|
||||
default: null
|
||||
|
||||
linux64-rust-windows-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
description: "rust repack with windows-cross support"
|
||||
treeherder:
|
||||
symbol: TL(rust-win-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'x86_64-pc-windows-msvc',
|
||||
'--target', 'i686-pc-windows-msvc',
|
||||
'--target', 'aarch64-pc-windows-msvc',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: linux64-rust-windows
|
||||
default: null
|
||||
|
||||
win64-rust-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
treeherder:
|
||||
symbol: TW64(rust-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-pc-windows-msvc',
|
||||
'--target', 'x86_64-pc-windows-msvc',
|
||||
'--target', 'i686-pc-windows-msvc',
|
||||
'--target', 'aarch64-pc-windows-msvc',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: win64-rust
|
||||
default: null
|
||||
|
||||
macosx64-rust-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
treeherder:
|
||||
symbol: TM(rust-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-apple-darwin',
|
||||
'--target', 'x86_64-apple-darwin',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: macosx64-rust
|
||||
default: null
|
||||
|
||||
mingw32-rust-nightly:
|
||||
attributes:
|
||||
cached_task: false
|
||||
treeherder:
|
||||
symbol: TMW(rust-nightly)
|
||||
run:
|
||||
arguments: [
|
||||
'--channel', 'nightly', '--allow-generic-channel',
|
||||
'--host', 'x86_64-unknown-linux-gnu',
|
||||
'--target', 'i686-unknown-linux-gnu',
|
||||
'--target', 'i686-pc-windows-gnu',
|
||||
'--target', 'x86_64-pc-windows-gnu',
|
||||
'--target', 'x86_64-unknown-linux-gnu',
|
||||
]
|
||||
toolchain-alias:
|
||||
by-project:
|
||||
toolchains: mingw32-rust
|
||||
default: null
|
||||
|
|
|
@ -624,6 +624,11 @@ def args():
|
|||
" or dev (build from source).",
|
||||
required=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--allow-generic-channel",
|
||||
action="store_true",
|
||||
help='Allow to use e.g. "nightly" without a date as a channel.',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--patch",
|
||||
dest="patches",
|
||||
|
@ -659,12 +664,14 @@ def args():
|
|||
args = parser.parse_args()
|
||||
if not args.cargo_channel:
|
||||
args.cargo_channel = args.channel
|
||||
validate_channel(args.channel)
|
||||
validate_channel(args.cargo_channel)
|
||||
if not args.allow_generic_channel:
|
||||
validate_channel(args.channel)
|
||||
validate_channel(args.cargo_channel)
|
||||
if not args.host:
|
||||
args.host = "linux64"
|
||||
args.host = expand_platform(args.host)
|
||||
args.targets = [expand_platform(t) for t in args.targets]
|
||||
delattr(args, "allow_generic_channel")
|
||||
|
||||
return args
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче