remove old backstage injection and remove all legacy code

This commit is contained in:
KingKDot
2026-08-20 10:57:56 -05:00
parent ea22c83c37
commit 4ed32f6b65
43 changed files with 142 additions and 5795 deletions
+13 -18
View File
@@ -31,23 +31,19 @@ fn main() {
}
fn generate_loader_entry() {
let name = match std::env::var("BACKSTAGE_LOADER_EXPORT").ok().as_deref() {
Some("ReflectiveLoader") => "ReflectiveLoader".to_string(),
Some(value) => panic!("unsupported BACKSTAGE_LOADER_EXPORT value: {value}"),
None => {
let seed = std::env::var("BACKSTAGE_LOADER_SEED")
.ok()
.and_then(|value| value.parse::<u64>().ok())
.unwrap_or_else(|| {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_nanos() as u64
^ (std::process::id() as u64).wrapping_mul(0x9E37_79B9_7F4A_7C15)
});
format!("x{:06x}", seed & 0xFFFF_FF)
}
};
// The loader export is always a per-build randomized `x<hex>` name. The
// legacy fixed `ReflectiveLoader` export is no longer supported.
let seed = std::env::var("BACKSTAGE_LOADER_SEED")
.ok()
.and_then(|value| value.parse::<u64>().ok())
.unwrap_or_else(|| {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_nanos() as u64
^ (std::process::id() as u64).wrapping_mul(0x9E37_79B9_7F4A_7C15)
});
let name = format!("x{:06x}", seed & 0xFFFF_FF);
let src = format!(
"// Generated by build.rs — do not edit.\n\
@@ -63,6 +59,5 @@ fn generate_loader_entry() {
let out_dir = std::env::var("OUT_DIR").unwrap();
std::fs::write(std::path::Path::new(&out_dir).join("loader_entry.rs"), src)
.expect("failed to write loader_entry.rs");
println!("cargo:rerun-if-env-changed=BACKSTAGE_LOADER_EXPORT");
println!("cargo:rerun-if-env-changed=BACKSTAGE_LOADER_SEED");
}