Skip to content

Commit

Permalink
Vendor rustc_codegen_gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 11, 2024
1 parent cdb775c commit 0ada6fd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,7 @@ def check_vendored_status(self):
sync_dirs = "--sync ./src/tools/cargo/Cargo.toml " \
"--sync ./src/tools/rust-analyzer/Cargo.toml " \
"--sync ./compiler/rustc_codegen_cranelift/Cargo.toml " \
"--sync ./compiler/rustc_codegen_gcc/Cargo.toml " \
"--sync ./src/bootstrap/Cargo.toml "
eprint('ERROR: vendoring required, but vendor directory does not exist.')
eprint(' Run `cargo vendor {}` to initialize the '
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ impl Step for PlainSourceTarball {
.arg("--sync")
.arg(builder.src.join("./compiler/rustc_codegen_cranelift/Cargo.toml"))
.arg("--sync")
.arg(builder.src.join("./compiler/rustc_codegen_gcc/Cargo.toml"))
.arg("--sync")
.arg(builder.src.join("./src/bootstrap/Cargo.toml"))
// Will read the libstd Cargo.toml
// which uses the unstable `public-dependency` feature.
Expand Down
5 changes: 1 addition & 4 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub(crate) const WORKSPACES: &[(&str, ExceptionList, Option<(&[&str], &[&str])>)
Some((&["rustc_codegen_cranelift"], PERMITTED_CRANELIFT_DEPENDENCIES)),
),
// tidy-alphabetical-start
//("compiler/rustc_codegen_gcc", EXCEPTIONS_GCC, None), // FIXME uncomment once all deps are vendored
("compiler/rustc_codegen_gcc", EXCEPTIONS_GCC, None),
//("library/backtrace", &[], None), // FIXME uncomment once rust-lang/backtrace#562 has been synced back to the rust repo
//("library/portable-simd", &[], None), // FIXME uncomment once rust-lang/portable-simd#363 has been synced back to the rust repo
//("library/stdarch", EXCEPTIONS_STDARCH, None), // FIXME uncomment once rust-lang/stdarch#1462 has been synced back to the rust repo
Expand Down Expand Up @@ -164,15 +164,12 @@ const EXCEPTIONS_CRANELIFT: ExceptionList = &[
// tidy-alphabetical-end
];

// FIXME uncomment once all deps are vendored
/*
const EXCEPTIONS_GCC: ExceptionList = &[
// tidy-alphabetical-start
("gccjit", "GPL-3.0"),
("gccjit_sys", "GPL-3.0"),
// tidy-alphabetical-end
];
*/

const EXCEPTIONS_BOOTSTRAP: ExceptionList = &[
("ryu", "Apache-2.0 OR BSL-1.0"), // through serde. BSL is not acceptble, but we use it under Apache-2.0
Expand Down
7 changes: 5 additions & 2 deletions src/tools/tidy/src/extdeps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use std::fs;
use std::path::Path;

/// List of allowed sources for packages.
const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crates.io-index\""];
const ALLOWED_SOURCES: &[&str] = &[
"\"registry+https://github.com/rust-lang/crates.io-index\"",
"\"git+https://github.com/antoyo/gccjit.rs",
];

/// Checks for external package sources. `root` is the path to the directory that contains the
/// workspace `Cargo.toml`.
Expand Down Expand Up @@ -33,7 +36,7 @@ pub fn check(root: &Path, bad: &mut bool) {
let source = line.split_once('=').unwrap().1.trim();

// Ensure source is allowed.
if !ALLOWED_SOURCES.contains(&&*source) {
if !ALLOWED_SOURCES.iter().any(|allowed| source.starts_with(allowed)) {
tidy_error!(bad, "invalid source: {}", source);
}
}
Expand Down

0 comments on commit 0ada6fd

Please sign in to comment.