Skip to content

Commit 3e10e1f

Browse files
committed
Auto merge of rust-lang#138597 - Kobzol:git-ci-beta, r=<try>
[do not merge] beta test for git change detection (rust-lang#138591) Opening to test CI/bootstrap changes from rust-lang#138591. r? `@ghost` try-job: x86_64-gnu-aux
2 parents 8c7969a + 506d23d commit 3e10e1f

File tree

31 files changed

+1166
-399
lines changed

31 files changed

+1166
-399
lines changed

Diff for: .github/workflows/ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ jobs:
111111
# which then uses log commands to actually set them.
112112
EXTRA_VARIABLES: ${{ toJson(matrix.env) }}
113113

114-
- name: setup upstream remote
115-
run: src/ci/scripts/setup-upstream-remote.sh
116-
117114
- name: ensure the channel matches the target branch
118115
run: src/ci/scripts/verify-channel.sh
119116

Diff for: Cargo.lock

+27-8
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ version = "0.1.0"
317317
dependencies = [
318318
"serde",
319319
"serde_derive",
320+
"tempfile",
320321
]
321322

322323
[[package]]
@@ -2135,6 +2136,12 @@ version = "0.4.15"
21352136
source = "registry+https://github.com/rust-lang/crates.io-index"
21362137
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
21372138

2139+
[[package]]
2140+
name = "linux-raw-sys"
2141+
version = "0.9.3"
2142+
source = "registry+https://github.com/rust-lang/crates.io-index"
2143+
checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
2144+
21382145
[[package]]
21392146
name = "litemap"
21402147
version = "0.7.4"
@@ -4832,7 +4839,20 @@ dependencies = [
48324839
"bitflags",
48334840
"errno",
48344841
"libc",
4835-
"linux-raw-sys",
4842+
"linux-raw-sys 0.4.15",
4843+
"windows-sys 0.59.0",
4844+
]
4845+
4846+
[[package]]
4847+
name = "rustix"
4848+
version = "1.0.2"
4849+
source = "registry+https://github.com/rust-lang/crates.io-index"
4850+
checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825"
4851+
dependencies = [
4852+
"bitflags",
4853+
"errno",
4854+
"libc",
4855+
"linux-raw-sys 0.9.3",
48364856
"windows-sys 0.59.0",
48374857
]
48384858

@@ -5246,15 +5266,14 @@ dependencies = [
52465266

52475267
[[package]]
52485268
name = "tempfile"
5249-
version = "3.15.0"
5269+
version = "3.19.0"
52505270
source = "registry+https://github.com/rust-lang/crates.io-index"
5251-
checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704"
5271+
checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600"
52525272
dependencies = [
5253-
"cfg-if",
52545273
"fastrand",
5255-
"getrandom 0.2.15",
5274+
"getrandom 0.3.1",
52565275
"once_cell",
5257-
"rustix",
5276+
"rustix 1.0.2",
52585277
"windows-sys 0.59.0",
52595278
]
52605279

@@ -6599,8 +6618,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
65996618
checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909"
66006619
dependencies = [
66016620
"libc",
6602-
"linux-raw-sys",
6603-
"rustix",
6621+
"linux-raw-sys 0.4.15",
6622+
"rustix 0.38.43",
66046623
]
66056624

66066625
[[package]]

Diff for: config.example.toml

+10
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,16 @@
163163
# Custom CMake defines to set when building LLVM.
164164
#build-config = {}
165165

166+
# =============================================================================
167+
# Tweaking how GCC is compiled
168+
# =============================================================================
169+
[gcc]
170+
# Download GCC from CI instead of building it locally.
171+
# Note that this will attempt to download GCC even if there are local
172+
# modifications to the `src/gcc` submodule.
173+
# Currently, this is only supported for the `x86_64-unknown-linux-gnu` target.
174+
# download-ci-gcc = false
175+
166176
# =============================================================================
167177
# General build configuration options
168178
# =============================================================================

Diff for: license-metadata.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"directories": [],
1414
"files": [
1515
"analyzer-decls.h",
16-
"malloc-macro.h"
16+
"malloc-macro.h",
17+
"sarif-path-role.h"
1718
],
1819
"license": {
1920
"copyright": [

Diff for: src/bootstrap/Cargo.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ dependencies = [
225225

226226
[[package]]
227227
name = "errno"
228-
version = "0.3.9"
228+
version = "0.3.10"
229229
source = "registry+https://github.com/rust-lang/crates.io-index"
230-
checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba"
230+
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
231231
dependencies = [
232232
"libc",
233-
"windows-sys 0.52.0",
233+
"windows-sys 0.59.0",
234234
]
235235

236236
[[package]]
@@ -334,9 +334,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
334334

335335
[[package]]
336336
name = "libc"
337-
version = "0.2.167"
337+
version = "0.2.171"
338338
source = "registry+https://github.com/rust-lang/crates.io-index"
339-
checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc"
339+
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
340340

341341
[[package]]
342342
name = "libredox"

Diff for: src/bootstrap/download-ci-gcc-stamp

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Change this file to make users of the `download-ci-gcc` configuration download
2+
a new version of GCC from CI, even if the GCC submodule hasn’t changed.
3+
4+
Last change is for: https://github.com/rust-lang/rust/pull/138051

Diff for: src/bootstrap/src/core/build_steps/compile.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::{env, fs, str};
1717

1818
use serde_derive::Deserialize;
1919

20+
use crate::core::build_steps::gcc::{Gcc, add_cg_gcc_cargo_flags};
2021
use crate::core::build_steps::tool::SourceType;
2122
use crate::core::build_steps::{dist, llvm};
2223
use crate::core::builder;
@@ -30,7 +31,7 @@ use crate::utils::exec::command;
3031
use crate::utils::helpers::{
3132
exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
3233
};
33-
use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode};
34+
use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode, trace};
3435

3536
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3637
pub struct Std {
@@ -107,7 +108,11 @@ impl Step for Std {
107108
// the `rust.download-rustc=true` option.
108109
let force_recompile = builder.rust_info().is_managed_git_subrepository()
109110
&& builder.download_rustc()
110-
&& builder.config.last_modified_commit(&["library"], "download-rustc", true).is_none();
111+
&& builder.config.has_changes_from_upstream(&["library"]);
112+
113+
trace!("is managed git repo: {}", builder.rust_info().is_managed_git_subrepository());
114+
trace!("download_rustc: {}", builder.download_rustc());
115+
trace!(force_recompile);
111116

112117
run.builder.ensure(Std {
113118
compiler: run.builder.compiler(run.builder.top_stage, run.build_triple()),
@@ -1500,6 +1505,14 @@ impl Step for CodegenBackend {
15001505
.arg(builder.src.join(format!("compiler/rustc_codegen_{backend}/Cargo.toml")));
15011506
rustc_cargo_env(builder, &mut cargo, target, compiler.stage);
15021507

1508+
// Ideally, we'd have a separate step for the individual codegen backends,
1509+
// like we have in tests (test::CodegenGCC) but that would require a lot of restructuring.
1510+
// If the logic gets more complicated, it should probably be done.
1511+
if backend == "gcc" {
1512+
let gcc = builder.ensure(Gcc { target });
1513+
add_cg_gcc_cargo_flags(&mut cargo, &gcc);
1514+
}
1515+
15031516
let tmp_stamp = BuildStamp::new(&out_dir).with_prefix("tmp");
15041517

15051518
let _guard = builder.msg_build(compiler, format_args!("codegen backend {backend}"), target);

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+27
Original file line numberDiff line numberDiff line change
@@ -2450,3 +2450,30 @@ impl Step for ReproducibleArtifacts {
24502450
if added_anything { Some(tarball.generate()) } else { None }
24512451
}
24522452
}
2453+
2454+
/// Tarball containing a prebuilt version of the libgccjit library,
2455+
/// needed as a dependency for the GCC codegen backend (similarly to the LLVM
2456+
/// backend needing a prebuilt libLLVM).
2457+
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
2458+
pub struct Gcc {
2459+
pub target: TargetSelection,
2460+
}
2461+
2462+
impl Step for Gcc {
2463+
type Output = GeneratedTarball;
2464+
2465+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2466+
run.alias("gcc")
2467+
}
2468+
2469+
fn make_run(run: RunConfig<'_>) {
2470+
run.builder.ensure(Gcc { target: run.target });
2471+
}
2472+
2473+
fn run(self, builder: &Builder<'_>) -> Self::Output {
2474+
let tarball = Tarball::new(builder, "gcc", &self.target.triple);
2475+
let output = builder.ensure(super::gcc::Gcc { target: self.target });
2476+
tarball.add_file(output.libgccjit, "lib", 0o644);
2477+
tarball.generate()
2478+
}
2479+
}

Diff for: src/bootstrap/src/core/build_steps/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn get_modified_rs_files(build: &Builder<'_>) -> Result<Option<Vec<String>>, Str
9494
return Ok(None);
9595
}
9696

97-
get_git_modified_files(&build.config.git_config(), Some(&build.config.src), &["rs"])
97+
get_git_modified_files(&build.config.git_config(), Some(&build.config.src), &["rs"]).map(Some)
9898
}
9999

100100
#[derive(serde_derive::Deserialize)]

0 commit comments

Comments
 (0)