Skip to content

Commit

Permalink
Fix nit, add rerun condition to build script
Browse files Browse the repository at this point in the history
  • Loading branch information
gememma committed Oct 28, 2024
1 parent f624226 commit 97cf9ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions mirrord/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use std::process::exit;

fn main() {
println!("cargo::rerun-if-env-changed=MIRRORD_LAYER_FILE_MACOS_ARM64");
if std::env::var("MIRRORD_LAYER_FILE").is_err() {
println!(
"cargo:rustc-env=MIRRORD_LAYER_FILE={}",
Expand Down
6 changes: 3 additions & 3 deletions scripts/shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// Function to be executed when the library is loaded
__attribute__((constructor))
void on_library_load() {
const char *lib_env = getenv("MIRRORD_MACOS_ARM64_LIBRARY");
const char *lib_path = getenv("MIRRORD_MACOS_ARM64_LIBRARY");

if (lib_env && *lib_env) {
dlopen(lib_env, RTLD_LAZY);
if (lib_path && *lib_path) {
dlopen(lib_path, RTLD_LAZY);
}
}

0 comments on commit 97cf9ef

Please sign in to comment.