Skip to content

Commit e7be89f

Browse files
committed
Auto merge of #137667 - Kobzol:gcc-dist-build, r=<try>
Add `dist::Gcc` build step To distribute the prebuilt libgccjit.so from CI. Opening as a draft to examine the impact on CI times. r? `@ghost`
2 parents 2af87ea + bea7b2f commit e7be89f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+29
Original file line numberDiff line numberDiff line change
@@ -2464,3 +2464,32 @@ impl Step for ReproducibleArtifacts {
24642464
if added_anything { Some(tarball.generate()) } else { None }
24652465
}
24662466
}
2467+
2468+
/// Tarball containing a prebuilt version of the libgccjit library,
2469+
/// needed as a dependency for the GCC codegen backend (similarly to the LLVM
2470+
/// backend needing a prebuilt libLLVM).
2471+
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
2472+
pub struct Gcc {
2473+
pub target: TargetSelection,
2474+
}
2475+
2476+
impl Step for Gcc {
2477+
type Output = GeneratedTarball;
2478+
2479+
const DEFAULT: bool = true;
2480+
2481+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2482+
run.alias("gcc")
2483+
}
2484+
2485+
fn make_run(run: RunConfig<'_>) {
2486+
run.builder.ensure(Gcc { target: run.target });
2487+
}
2488+
2489+
fn run(self, builder: &Builder<'_>) -> Self::Output {
2490+
let tarball = Tarball::new(builder, "gcc", &self.target.triple);
2491+
let output = builder.ensure(super::gcc::Gcc { target: self.target });
2492+
tarball.add_file(output.libgccjit, ".", 0o644);
2493+
tarball.generate()
2494+
}
2495+
}

src/bootstrap/src/core/builder/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ impl<'a> Builder<'a> {
10721072
dist::PlainSourceTarball,
10731073
dist::BuildManifest,
10741074
dist::ReproducibleArtifacts,
1075+
dist::Gcc
10751076
),
10761077
Kind::Install => describe!(
10771078
install::Docs,

0 commit comments

Comments
 (0)