Skip to content
New issue

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

fix: use codesign -f to replace existing signature #7183

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ Unreleased
- Fix regression where Merlin was unable to handle filenames with uppercase
letters under Windows. (#7577, @nojb)

- On nix+macos, pass `-f` to the codesign hook to avoid errors when the binary
is already signed (#7183, fixes #6265, @greedy)

3.7.1 (2023-04-04)
------------------

Expand Down
9 changes: 8 additions & 1 deletion src/dune_rules/artifact_substitution.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ type conf =
}

let mac_codesign_hook ~codesign path =
Process.run ~display:Quiet Strict codesign [ "-s"; "-"; Path.to_string path ]
let stdout_to =
Process.Io.make_stdout Execution_parameters.Action_output_on_success.Swallow
in
let stderr_to =
Process.Io.make_stderr Execution_parameters.Action_output_on_success.Swallow
in
Process.run ~stdout_to ~stderr_to ~display:Quiet Strict codesign
[ "-f"; "-s"; "-"; Path.to_string path ]

let sign_hook_of_context (context : Context.t) =
let config = context.ocaml_config in
Expand Down