We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build.rs
Cross build deno is possible with some special method (#1846, #19759).
Currently we have to patch build.rs like this:
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno-1.36.2/build.rs workdir/deno-1.36.2/build.rs --- workdir-1/deno-1.36.2/build.rs 2023-08-24 19:38:40.831557143 +0800 +++ workdir/deno-1.36.2/build.rs 2023-08-24 19:39:43.532680484 +0800 @@ -400,9 +400,6 @@ // 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."); - } let symbols_path = std::path::Path::new("napi").join( format!("generated_symbol_exports_list_{}.def", env::consts::OS).as_str(),
But if we add an environment variable like this:
diff '--color=auto' -ru -x Cargo.lock workdir-1/deno-1.36.2/build.rs workdir/deno-1.36.2/build.rs --- workdir-1/deno-1.36.2/build.rs 2023-08-24 19:38:40.831557143 +0800 +++ workdir/deno-1.36.2/build.rs 2023-08-25 14:02:31.747904547 +0800 @@ -400,7 +400,8 @@ // Host snapshots won't work when cross compiling. let target = env::var("TARGET").unwrap(); let host = env::var("HOST").unwrap(); - if target != host { + let skip_cross_build = env::var("DENO_SKIP_CROSS_BUILD_CHECK").map_or(false, |v| v == "1"); + if (!skip_cross_build) && (target != host) { panic!("Cross compiling with snapshot is not supported."); }
Then when do cross build, we can just export DENO_SKIP_CROSS_BUILD_CHECK=1, and no need to patch build.rs.
export DENO_SKIP_CROSS_BUILD_CHECK=1
But when some one do cross build accidentally (not setup special method for cross build), they will still get warned:
thread 'main' panicked at 'Cross compiling with snapshot is not supported.', build.rs:405:5
The text was updated successfully, but these errors were encountered:
sorry, network error
Sorry, something went wrong.
No branches or pull requests
Cross build deno is possible with some special method (#1846, #19759).
Currently we have to patch
build.rs
like this:But if we add an environment variable like this:
Then when do cross build, we can just
export DENO_SKIP_CROSS_BUILD_CHECK=1
, and no need to patchbuild.rs
.But when some one do cross build accidentally (not setup special method for cross build), they will still get warned:
The text was updated successfully, but these errors were encountered: