Fix CI (#955)
* fix * fmt * Update build_and_test.yml * no nightly * fix * why * Update build_and_test.yml * a * a * ok * linux only * fmt * Update build_and_test.yml * fix
This commit is contained in:
parent
b0df0a26a1
commit
f1b25fed65
2
.github/workflows/build_and_test.yml
vendored
2
.github/workflows/build_and_test.yml
vendored
@ -61,8 +61,6 @@ jobs:
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
- name: set mold linker as default linker
|
||||
uses: rui314/setup-mold@v1
|
||||
- name: Install and cache deps
|
||||
uses: awalsh128/cache-apt-pkgs-action@v1.1.0
|
||||
with:
|
||||
|
@ -23,6 +23,11 @@ fn build_dep_check(tools: &[&str]) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if !cfg!(target_os = "linux") {
|
||||
println!("cargo:warning=Only linux host is supported for now.");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
let out_path = PathBuf::from(&env::var_os("OUT_DIR").unwrap());
|
||||
|
||||
println!("cargo:rerun-if-changed=harness.c");
|
||||
@ -50,16 +55,25 @@ fn main() {
|
||||
|
||||
let symcc_dir = clone_and_build_symcc(&out_path);
|
||||
|
||||
let runtime_dir = std::env::var("CARGO_TARGET_DIR")
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(|_| {
|
||||
std::env::current_dir()
|
||||
.unwrap()
|
||||
.join("..")
|
||||
.join("runtime")
|
||||
.join("target")
|
||||
})
|
||||
.join(std::env::var("PROFILE").unwrap());
|
||||
let runtime_dir = std::env::current_dir().unwrap().join("..").join("runtime");
|
||||
|
||||
// Build the runtime
|
||||
std::process::Command::new("cargo")
|
||||
.current_dir(&runtime_dir)
|
||||
.env_remove("CARGO_TARGET_DIR")
|
||||
.arg("build")
|
||||
.arg("--release")
|
||||
.status()
|
||||
.expect("Failed to build runtime");
|
||||
|
||||
std::fs::copy(
|
||||
&runtime_dir
|
||||
.join("target")
|
||||
.join("release")
|
||||
.join("libSymRuntime.so"),
|
||||
&runtime_dir.join("libSymRuntime.so"),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
if !runtime_dir.join("libSymRuntime.so").exists() {
|
||||
println!("cargo:warning=Runtime not found. Build it first.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user