[meta] Remove the Python DSL
KILL THE SNAKE WITH FIRE.
This commit is contained in:
@@ -57,32 +57,6 @@ fn main() {
|
||||
crate_dir.join("build.rs").to_str().unwrap()
|
||||
);
|
||||
|
||||
// Scripts are in `$crate_dir/meta-python`.
|
||||
let meta_dir = crate_dir.join("meta-python");
|
||||
let build_script = meta_dir.join("build.py");
|
||||
|
||||
// Launch build script with Python. We'll just find python in the path.
|
||||
// Use -B to disable .pyc files, because they cause trouble for vendoring
|
||||
// scripts, and this is a build step that isn't run very often anyway.
|
||||
let python = identify_python();
|
||||
let status = process::Command::new(python)
|
||||
.current_dir(crate_dir)
|
||||
.arg("-B")
|
||||
.arg(build_script)
|
||||
.arg("--out-dir")
|
||||
.arg(out_dir.clone())
|
||||
.status()
|
||||
.expect("Failed to launch second-level build script; is python installed?");
|
||||
if !status.success() {
|
||||
process::exit(status.code().unwrap());
|
||||
}
|
||||
|
||||
// DEVELOPMENT:
|
||||
// ------------------------------------------------------------------------
|
||||
// Now that the Python build process is complete, generate files that are
|
||||
// emitted by the `meta` crate.
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if let Err(err) = meta::generate(&isas, &out_dir) {
|
||||
eprintln!("Error: {}", err);
|
||||
process::exit(1);
|
||||
@@ -99,16 +73,3 @@ fn main() {
|
||||
println!("cargo:warning=Generated files are in {}", out_dir);
|
||||
}
|
||||
}
|
||||
|
||||
fn identify_python() -> &'static str {
|
||||
for python in &["python", "python3", "python2.7"] {
|
||||
if process::Command::new(python)
|
||||
.arg("--version")
|
||||
.status()
|
||||
.is_ok()
|
||||
{
|
||||
return python;
|
||||
}
|
||||
}
|
||||
panic!("The Cranelift build requires Python (version 2.7 or version 3)");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user