diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-07-31 21:15:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 09:45:13 +0530 |
commit | 5bd76609f7f3116b2804f1be24320d11bc45e151 (patch) | |
tree | fba6d738e2f5c6cdd5c6962298ca6bb1b80d3d3b /cli/tools/compile.rs | |
parent | f57745fe2106a4d26dd2209e1b2cacb2d6430245 (diff) |
feat: codesign for deno compile binaries (#24604)
Uses [sui](https://github.com/littledivy/sui) to inject metadata as a
custom section in the denort binary.
Metadata is stored as a Mach-O segment on macOS and PE `RT_RCDATA`
resource on Windows.
Fixes #11154
Fixes https://github.com/denoland/deno/issues/17753
```cpp
deno compile app.tsx
# on macOS
codesign --sign - ./app
# on Windows
signtool sign /fd SHA256 .\app.exe
```
---------
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/tools/compile.rs')
-rw-r--r-- | cli/tools/compile.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs index bb03f03d2..f0534abc3 100644 --- a/cli/tools/compile.rs +++ b/cli/tools/compile.rs @@ -124,12 +124,13 @@ pub async fn compile( )); let temp_path = output_path.with_file_name(temp_filename); - let mut file = std::fs::File::create(&temp_path).with_context(|| { + let file = std::fs::File::create(&temp_path).with_context(|| { format!("Opening temporary file '{}'", temp_path.display()) })?; + let write_result = binary_writer .write_bin( - &mut file, + file, eszip, root_dir_url, &module_specifier, @@ -140,7 +141,6 @@ pub async fn compile( .with_context(|| { format!("Writing temporary file '{}'", temp_path.display()) }); - drop(file); // set it as executable #[cfg(unix)] |