diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-03-16 19:17:15 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-16 19:17:15 +0530 |
commit | 89a41d0a67c531d937126bbdb095ab1edb5eede2 (patch) | |
tree | 714688aa22e74901fceb39b74678bffc034aede3 | |
parent | 7044bf523bab3a6da47150a05823dd6571abfd49 (diff) |
chore(cli): Disallow cross compiling for snapshots (#13976)
-rw-r--r-- | cli/build.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/build.rs b/cli/build.rs index 98dea9b46..7b56dbcbd 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -326,6 +326,12 @@ fn main() { return; } + // Host snapshots won't work when cross compiling. + let target = env::var("TARGET").unwrap(); + let host = env::var("HOST").unwrap(); + if target != host { + panic!("Cross compiling with snapshot is not supported."); + } // To debug snapshot issues uncomment: // op_fetch_asset::trace_serializer(); @@ -339,7 +345,7 @@ fn main() { println!("cargo:rustc-env=TS_VERSION={}", ts_version()); println!("cargo:rerun-if-env-changed=TS_VERSION"); - println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap()); + println!("cargo:rustc-env=TARGET={}", target); println!("cargo:rustc-env=PROFILE={}", env::var("PROFILE").unwrap()); let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap()); |