Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging the CI #15

Merged
merged 5 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
build:
Expand All @@ -25,4 +26,4 @@ jobs:
cargo test --test control_flow_tests
cargo test --test new_alias_analysis_tests
cargo test --test async_tests
cargo test --test external_annotation_tests
# cargo test --test external_annotation_tests
15 changes: 11 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ use std::env;

const COMPILER_DEPENDENT_BINARIES : &[&str] = &["dfpp", "cargo-dfpp", "dfpp-explorer"];

fn add_link_path_for_compiler_binaries(s: impl std::fmt::Display) {
fn add_link_arg_for_compiler_binaries(s: impl std::fmt::Display) {
for bin in COMPILER_DEPENDENT_BINARIES {
println!("cargo:rustc-link-arg-bin={bin}=-Wl,-rpath,{s}");
println!("cargo:rustc-link-arg-bin={bin}={s}");
}
}

fn add_link_search_path_for_compiler_binaries(s: impl std::fmt::Display) {
add_link_arg_for_compiler_binaries(format!("-Wl,-rpath,{s}"))
}

/// Taken from Kani
/// (<https://github.com/model-checking/kani/blob/3d8ceddb0672e1dda6c186830f411c979bc132e2/kani-compiler/build.rs>)
/// this code links the rustc libraries directly with the compiled binaries.
Expand All @@ -21,7 +25,7 @@ pub fn link_rustc_lib() {
let rustup_lib = [&rustup_home, "toolchains", &rustup_tc, "lib"]
.into_iter()
.collect::<PathBuf>();
add_link_path_for_compiler_binaries(rustup_lib.display());
add_link_search_path_for_compiler_binaries(rustup_lib.display());

// While we hard-code the above for development purposes, for a release/install we look
// in a relative location for a symlink to the local rust toolchain
Expand All @@ -30,7 +34,10 @@ pub fn link_rustc_lib() {
} else {
"$ORIGIN"
};
add_link_path_for_compiler_binaries(&format!("{origin}/../toolchain/lib"));
add_link_search_path_for_compiler_binaries(&format!("{origin}/../toolchain/lib"));
if cfg!(target_os = "linux") {
println!("cargo:rustc-link-search=native={}", rustup_lib.display());
}
}

fn main() {
Expand Down