Skip to content

Commit

Permalink
use bootstrap-self-test feature on libstd check
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Jun 6, 2024
1 parent 6bfdb04 commit dd99021
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,10 @@ pub struct LibcxxVersionTool {
pub target: TargetSelection,
}

#[allow(dead_code)]
#[derive(Debug, Clone)]
pub enum LibcxxVersion {
Gnu(usize),
#[allow(dead_code)]
Llvm(usize),
}

Expand Down
9 changes: 7 additions & 2 deletions src/bootstrap/src/core/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ use std::fs;
use std::path::PathBuf;
use std::process::Command;

#[cfg(not(feature = "bootstrap-self-test"))]
use crate::builder::Builder;
#[cfg(not(feature = "bootstrap-self-test"))]
use crate::core::build_steps::tool;
#[cfg(not(feature = "bootstrap-self-test"))]
use std::collections::HashSet;

use crate::builder::{Builder, Kind};
use crate::core::build_steps::tool;
use crate::builder::Kind;
use crate::core::config::Target;
use crate::utils::helpers::output;
use crate::Build;
Expand All @@ -41,6 +44,7 @@ const STAGE0_MISSING_TARGETS: &[&str] = &[

/// Minimum version threshold for libstdc++ required when using prebuilt LLVM
/// from CI (with`llvm.download-ci-llvm` option).
#[cfg(not(feature = "bootstrap-self-test"))]
const LIBSTDCXX_MIN_VERSION_THRESHOLD: usize = 8;

impl Finder {
Expand Down Expand Up @@ -108,6 +112,7 @@ pub fn check(build: &mut Build) {
}

// Ensure that a compatible version of libstdc++ is available on the system when using `llvm.download-ci-llvm`.
#[cfg(not(feature = "bootstrap-self-test"))]
if !build.config.dry_run() && !build.build.is_msvc() && build.config.llvm_from_ci {
let builder = Builder::new(build);
let libcxx_version = builder.ensure(tool::LibcxxVersionTool { target: build.build });
Expand Down

0 comments on commit dd99021

Please sign in to comment.