Skip to content

Commit

Permalink
Auto merge of rust-lang#137667 - Kobzol:gcc-dist-build, r=<try>
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
bors committed Feb 26, 2025
2 parents 2b3cef8 + bea7b2f commit 87766ec
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2464,3 +2464,32 @@ impl Step for ReproducibleArtifacts {
if added_anything { Some(tarball.generate()) } else { None }
}
}

/// Tarball containing a prebuilt version of the libgccjit library,
/// needed as a dependency for the GCC codegen backend (similarly to the LLVM
/// backend needing a prebuilt libLLVM).
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct Gcc {
pub target: TargetSelection,
}

impl Step for Gcc {
type Output = GeneratedTarball;

const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.alias("gcc")
}

fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Gcc { target: run.target });
}

fn run(self, builder: &Builder<'_>) -> Self::Output {
let tarball = Tarball::new(builder, "gcc", &self.target.triple);
let output = builder.ensure(super::gcc::Gcc { target: self.target });
tarball.add_file(output.libgccjit, ".", 0o644);
tarball.generate()
}
}
1 change: 1 addition & 0 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ impl<'a> Builder<'a> {
dist::PlainSourceTarball,
dist::BuildManifest,
dist::ReproducibleArtifacts,
dist::Gcc
),
Kind::Install => describe!(
install::Docs,
Expand Down

0 comments on commit 87766ec

Please sign in to comment.