Skip to content

Commit 043822d

Browse files
committed
add context method to build, builder and config
1 parent 69825df commit 043822d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::core::config::{DryRun, TargetSelection};
2323
use crate::utils::cache::Cache;
2424
use crate::utils::exec::{BootstrapCommand, command};
2525
use crate::utils::helpers::{self, LldThreads, add_dylib_path, exe, libdir, linker_args, t};
26-
use crate::{Build, Crate, trace};
26+
use crate::{Build, Crate, ExecutionContext, trace};
2727

2828
mod cargo;
2929

@@ -1627,4 +1627,8 @@ impl<'a> Builder<'a> {
16271627
self.info(&format!("{err}\n"));
16281628
}
16291629
}
1630+
1631+
pub fn context(&self) -> &ExecutionContext {
1632+
&self.config.execution_context
1633+
}
16301634
}

src/bootstrap/src/core/config/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3338,6 +3338,10 @@ impl Config {
33383338
pub fn ci_env(&self) -> CiEnv {
33393339
if self.is_running_on_ci { CiEnv::GitHubActions } else { CiEnv::None }
33403340
}
3341+
3342+
pub fn context(&self) -> &ExecutionContext {
3343+
&self.execution_context
3344+
}
33413345
}
33423346

33433347
/// Compares the current `Llvm` options against those in the CI LLVM builder and detects any incompatible options.

src/bootstrap/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub use utils::change_tracker::{
5656
pub use utils::helpers::PanicTracker;
5757

5858
use crate::core::build_steps::vendor::VENDOR_DIR;
59+
use crate::utils::execution_context::ExecutionContext;
5960

6061
const LLVM_TOOLS: &[&str] = &[
6162
"llvm-cov", // used to generate coverage report
@@ -2006,6 +2007,10 @@ to download LLVM rather than building it.
20062007
stream.reset().unwrap();
20072008
result
20082009
}
2010+
2011+
pub fn context(&self) -> &ExecutionContext {
2012+
&self.config.execution_context
2013+
}
20092014
}
20102015

20112016
#[cfg(unix)]

0 commit comments

Comments
 (0)