Files
wz-phone/desktop/src-tauri/build.rs
Siavash Sameni 4c998312aa
Some checks failed
Mirror to GitHub / mirror (push) Failing after 37s
Build Release Binaries / build-amd64 (push) Failing after 3m37s
regression check: revert build.rs to exact Step D state
Verify the Step D baseline still launches after the environment mutations
we may have caused during the E bisection (docker image rebuild, tauri-cli
version drift, etc). Build.rs is now byte-identical to commit a852cad
(Step D) except for the git hash capture block that already existed at
that point.

If this launches cleanly → the cpp_smoke addition genuinely breaks
something, bisection continues.
If this crashes → the environment regressed between Step D and now,
and we need to rebuild the docker image to an earlier snapshot.
2026-04-09 16:45:34 +04:00

39 lines
1.6 KiB
Rust

use std::process::Command;
fn main() {
// ─── Embedded git hash ─────────────────────────────────────────────────
let git_hash = Command::new("git")
.args(["rev-parse", "--short", "HEAD"])
.output()
.ok()
.filter(|o| o.status.success())
.and_then(|o| String::from_utf8(o.stdout).ok())
.map(|s| s.trim().to_string())
.unwrap_or_else(|| "unknown".into());
println!("cargo:rustc-env=WZP_GIT_HASH={git_hash}");
println!("cargo:rerun-if-changed=../../.git/HEAD");
println!("cargo:rerun-if-changed=../../.git/refs/heads");
// ─── Step A: single trivial cpp/hello.c compiled via cc::Build ─────────
// ─── Step D: also compile getauxval_fix.c (legacy wzp-android shim) ────
// getauxval_fix.c overrides the broken static getauxval stub that
// compiler-rt pulls in for Android targets. It's been shipping in the
// legacy wzp-android .so for months without issue, so including it here
// is low-risk — but it's an incremental variable we want to isolate.
let target = std::env::var("TARGET").unwrap_or_default();
if target.contains("android") {
println!("cargo:rerun-if-changed=cpp/hello.c");
cc::Build::new()
.file("cpp/hello.c")
.compile("wzp_hello");
println!("cargo:rerun-if-changed=cpp/getauxval_fix.c");
cc::Build::new()
.file("cpp/getauxval_fix.c")
.compile("getauxval_fix");
}
tauri_build::build()
}