mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(compile): adhoc codesign mach-o by default (#24824)
This commit is contained in:
parent
f1fc708d81
commit
9f27bf9144
2 changed files with 14 additions and 3 deletions
|
@ -183,7 +183,7 @@ fn write_binary_bytes(
|
|||
} else if target.contains("darwin") {
|
||||
libsui::Macho::from(original_bin)?
|
||||
.write_section("d3n0l4nd", writer)?
|
||||
.build(&mut file_writer)?;
|
||||
.build_and_sign(&mut file_writer)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -194,8 +194,8 @@ pub fn is_standalone_binary(exe_path: &Path) -> bool {
|
|||
};
|
||||
|
||||
libsui::utils::is_elf(&data)
|
||||
| libsui::utils::is_pe(&data)
|
||||
| libsui::utils::is_macho(&data)
|
||||
|| libsui::utils::is_pe(&data)
|
||||
|| libsui::utils::is_macho(&data)
|
||||
}
|
||||
|
||||
/// This function will try to run this binary as a standalone binary
|
||||
|
|
|
@ -34,6 +34,17 @@ fn compile_basic() {
|
|||
output.assert_matches_text("Welcome to Deno!\n");
|
||||
}
|
||||
|
||||
// On arm64 macOS, check if `codesign -v` passes
|
||||
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
|
||||
{
|
||||
let output = std::process::Command::new("codesign")
|
||||
.arg("-v")
|
||||
.arg(&exe)
|
||||
.output()
|
||||
.unwrap();
|
||||
assert!(output.status.success());
|
||||
}
|
||||
|
||||
// now ensure this works when the deno_dir is readonly
|
||||
let readonly_dir = dir.path().join("readonly");
|
||||
readonly_dir.make_dir_readonly();
|
||||
|
|
Loading…
Reference in a new issue