Skip to content
Merged
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
22 changes: 19 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,28 @@ fn static_lbug_file_name() -> &'static str {
}

fn prebuilt_cache_key() -> String {
// Linux ships more than one static build per release, and the download
// script picks one with LBUG_LINUX_VARIANT. Keep them in separate cache
// directories, otherwise switching the variant reuses whichever archive
// was downloaded first.
let variant_suffix = if cfg!(target_os = "linux") {
// Same default as download-liblbug.sh, which also treats an empty
// value as unset.
let variant = env::var("LBUG_LINUX_VARIANT")
.ok()
.filter(|v| !v.is_empty())
.unwrap_or_else(|| "compat".to_string());
format!("-{variant}")
} else {
String::new()
};

let source = if let Ok(run_id) = env::var("LBUG_PRECOMPILED_RUN_ID") {
format!("run-{run_id}")
format!("run-{run_id}{variant_suffix}")
} else if let Ok(version) = env::var("LBUG_VERSION") {
format!("version-{version}")
format!("version-{version}{variant_suffix}")
} else {
"latest".to_string()
format!("latest{variant_suffix}")
};

source
Expand Down
Loading