Skip to content

Commit

Permalink
Merge build_helper into util
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Mar 4, 2022
1 parent 8b85e7c commit 3b26b91
Show file tree
Hide file tree
Showing 22 changed files with 166 additions and 182 deletions.
145 changes: 0 additions & 145 deletions src/bootstrap/build_helper.rs

This file was deleted.

3 changes: 1 addition & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::path::{Component, Path, PathBuf};
use std::process::Command;
use std::time::{Duration, Instant};

use crate::build_helper::{output, t};
use crate::cache::{Cache, Interned, INTERNER};
use crate::check;
use crate::compile;
Expand All @@ -24,7 +23,7 @@ use crate::native;
use crate::run;
use crate::test;
use crate::tool::{self, SourceType};
use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir};
use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir, output, t};
use crate::{Build, CLang, DocTests, GitRepo, Mode};

pub use crate::Compiler;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/cc_detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::{env, iter};

use crate::build_helper::output;
use crate::config::{Target, TargetSelection};
use crate::util::output;
use crate::{Build, CLang, GitRepo};

// The `cc` crate doesn't provide a way to obtain a path to the detected archiver,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use std::path::Path;
use std::process::Command;

use crate::build_helper::output;
use crate::util::output;
use crate::Build;

pub enum GitInfo {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fs;
use std::io::{self, ErrorKind};
use std::path::Path;

use crate::build_helper::t;
use crate::util::t;
use crate::Build;

pub fn clean(build: &Build, all: bool) {
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ use std::str;

use serde::Deserialize;

use crate::build_helper::{output, t, up_to_date};
use crate::builder::Cargo;
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
use crate::config::{LlvmLibunwind, TargetSelection};
use crate::dist;
use crate::native;
use crate::tool::SourceType;
use crate::util::{exe, is_debug_info, is_dylib, symlink_dir};
use crate::util::{exe, is_debug_info, is_dylib, output, symlink_dir, t, up_to_date};
use crate::LLVM_TOOLS;
use crate::{CLang, Compiler, DependencyType, GitRepo, Mode};

Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ use std::fs;
use std::path::{Path, PathBuf};
use std::str::FromStr;

use crate::build_helper::t;
use crate::builder::TaskPath;
use crate::cache::{Interned, INTERNER};
use crate::channel::GitInfo;
pub use crate::flags::Subcommand;
use crate::flags::{Color, Flags};
use crate::util::exe;
use crate::util::{exe, t};
use serde::Deserialize;

macro_rules! check_ci_llvm {
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;

use crate::build_helper::{output, t};
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
use crate::compile;
use crate::config::TargetSelection;
use crate::tarball::{GeneratedTarball, OverlayKind, Tarball};
use crate::tool::{self, Tool};
use crate::util::{exe, is_dylib, timeit};
use crate::util::{exe, is_dylib, output, t, timeit};
use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS};

pub fn pkgname(builder: &Builder<'_>, component: &str) -> String {
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ use std::fs;
use std::io;
use std::path::{Path, PathBuf};

use crate::build_helper::{t, up_to_date};
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
use crate::compile;
use crate::config::{Config, TargetSelection};
use crate::tool::{self, prepare_tool_cargo, SourceType, Tool};
use crate::util::symlink_dir;
use crate::util::{symlink_dir, t, up_to_date};
use crate::Mode;

macro_rules! submodule_helper {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use std::process;

use getopts::Options;

use crate::build_helper::t;
use crate::builder::Builder;
use crate::config::{Config, TargetSelection};
use crate::setup::Profile;
use crate::util::t;
use crate::{Build, DocTests};

pub enum Color {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/format.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Runs rustfmt on the repository.

use crate::build_helper::{output, t};
use crate::util::{output, t};
use crate::Build;
use ignore::WalkBuilder;
use std::collections::VecDeque;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::fs;
use std::path::{Component, PathBuf};
use std::process::Command;

use crate::build_helper::t;
use crate::util::t;

use crate::dist::{self, sanitize_sh};
use crate::tarball::GeneratedTarball;
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ use std::os::windows::fs::symlink_file;

use filetime::FileTime;

use crate::build_helper::{mtime, output, run, run_suppressed, t, try_run, try_run_suppressed};
use crate::builder::Kind;
use crate::config::{LlvmLibunwind, TargetSelection};
use crate::util::{exe, libdir, CiEnv};
use crate::util::{
exe, libdir, mtime, output, run, run_suppressed, t, try_run, try_run_suppressed, CiEnv,
};

mod build_helper;
mod builder;
mod cache;
mod cc_detect;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::process::Command;

use serde::Deserialize;

use crate::build_helper::output;
use crate::cache::INTERNER;
use crate::util::output;
use crate::{Build, Crate};

#[derive(Deserialize)]
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ use std::io;
use std::path::{Path, PathBuf};
use std::process::Command;

use crate::build_helper::up_to_date;
use crate::build_helper::{output, t};
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
use crate::config::TargetSelection;
use crate::util::{self, exe};
use crate::util::{self, exe, output, t, up_to_date};
use crate::{CLang, GitRepo};

pub struct Meta {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/run.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::build_helper::output;
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
use crate::dist::distdir;
use crate::tool::Tool;
use crate::util::output;
use std::process::Command;

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use std::fs;
use std::path::PathBuf;
use std::process::Command;

use crate::build_helper::output;
use crate::cache::INTERNER;
use crate::config::Target;
use crate::util::output;
use crate::Build;

pub struct Finder {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/tarball.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::{
process::Command,
};

use crate::build_helper::t;
use crate::builder::Builder;
use crate::util::t;

#[derive(Copy, Clone)]
pub(crate) enum OverlayKind {
Expand Down
7 changes: 2 additions & 5 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::iter;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

use crate::build_helper::{self, output, t};
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
use crate::cache::Interned;
use crate::compile;
Expand All @@ -21,7 +20,7 @@ use crate::flags::Subcommand;
use crate::native;
use crate::tool::{self, SourceType, Tool};
use crate::toolstate::ToolState;
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var};
use crate::util::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t};
use crate::Crate as CargoCrate;
use crate::{envify, CLang, DocTests, GitRepo, Mode};

Expand Down Expand Up @@ -2305,9 +2304,7 @@ impl Step for Distcheck {
.current_dir(&dir),
);
builder.run(
Command::new(build_helper::make(&builder.config.build.triple))
.arg("check")
.current_dir(&dir),
Command::new(util::make(&builder.config.build.triple)).arg("check").current_dir(&dir),
);

// Now make sure that rust-src has all of libstd's dependencies
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ use std::fs;
use std::path::{Path, PathBuf};
use std::process::{exit, Command};

use crate::build_helper::t;
use crate::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step};
use crate::channel::GitInfo;
use crate::compile;
use crate::config::TargetSelection;
use crate::toolstate::ToolState;
use crate::util::{add_dylib_path, exe};
use crate::util::{add_dylib_path, exe, t};
use crate::Compiler;
use crate::Mode;

Expand Down
Loading

0 comments on commit 3b26b91

Please sign in to comment.