-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wip] Add bootstrap-shim and package it on nightly
- Pass `dist bootstrap-shim` explicitly in CI This makes it possible to run `dist bootstrap` without also building bootstrap-shim, and more importantly works around a bug where currently two steps aren't allowed to have the same path. - Add `check::BootstrapShim` - [wip] start unifying parsing for Config and MinimalConfig
- Loading branch information
Showing
14 changed files
with
627 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::{env, process::Command}; | ||
|
||
use bootstrap::{t, MinimalConfig}; | ||
|
||
#[path = "../../../src/tools/x/src/main.rs"] | ||
mod run_python; | ||
|
||
fn main() { | ||
let args = env::args().skip(1).collect::<Vec<_>>(); | ||
let mut opts = getopts::Options::new(); | ||
opts.optopt("", "config", "TOML configuration file for build", "FILE"); | ||
let matches = t!(opts.parse(args)); | ||
|
||
// If there are no untracked changes to bootstrap, download it from CI. | ||
// Otherwise, build it from source. Use python to build to avoid duplicating the code between python and rust. | ||
let config = MinimalConfig::parse(t!(matches.opt_get("config"))); | ||
let bootstrap_bin = if let Some(commit) = last_modified_bootstrap_commit(&config) { | ||
config.download_bootstrap(&commit) | ||
} else { | ||
return run_python::main(); | ||
}; | ||
|
||
let args: Vec<_> = std::env::args().skip(1).collect(); | ||
Command::new(bootstrap_bin).args(args).status().expect("failed to spawn bootstrap binairy"); | ||
} | ||
|
||
fn last_modified_bootstrap_commit(config: &MinimalConfig) -> Option<String> { | ||
config.last_modified_commit(&["src/bootstrap"], "download-bootstrap", true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.