ci: install prebuilt rcodesign instead of building from source - #2386
Merged
Conversation
bin/presign built apple-codesign from git via `cargo install`, compiling the whole Rust dependency tree on every macOS job. This cost several minutes on each of macos-x64 and macos-arm64. The `~/.cargo` cache could not help: `cargo install` compiles in a throwaway target directory, so caching ~/.cargo only avoids crate downloads, never the compile. It skipped the install entirely only when ~/.cargo/bin/rcodesign itself was restored, and that rarely happened for releases -- a run can restore caches only from its own ref or the default branch, so every release tag started cold. Download the pinned upstream 0.29.0 prebuilt binary instead and verify its sha256. Pinning a release also makes the tool that signs our releases reproducible, which `--branch main` did not. All flags used by bin/sign and bin/notarize work on 0.29.0; --entitlements-xml-path and --api-key-path are accepted aliases of the newer --entitlements-xml-file and --api-key-file. Drop the now-unused cargo caches from both macOS jobs and from the windows job, which never used Rust at all -- it signs via azure/trusted-signing-action, so that step restored and re-saved an empty ~/.cargo for nothing. Assisted-by: Claude:claude-opus-5[1m]
dividedmind
force-pushed
the
chore/macos-binary-codesign
branch
from
August 10, 2026 17:53
d7bf999 to
b827a18
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR speeds up macOS CI release signing by replacing a cargo install build-from-source of apple-codesign/rcodesign with a pinned, checksum-verified prebuilt rcodesign release, and removes now-unused Cargo caches from native build jobs.
Changes:
- Update
bin/presignto download a pinnedrcodesign(apple-codesign) universal macOS tarball and verify it via SHA-256 before installation. - Remove
~/.cargocache restore steps from macOS and Windows native build jobs to avoid wasted cache work.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| bin/presign | Switches rcodesign installation from cargo install (git main) to a pinned prebuilt release verified by sha256. |
| .github/workflows/build-native.yml | Removes Cargo cache restore steps from jobs that no longer need Rust/Cargo. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bin/presign built apple-codesign from git via
cargo install, compiling the whole Rust dependency tree on every macOS job. This cost several minutes on each of macos-x64 and macos-arm64.The
~/.cargocache could not help:cargo installcompiles in a throwaway target directory, so caching ~/.cargo only avoids crate downloads, never the compile. It skipped the install entirely only when ~/.cargo/bin/rcodesign itself was restored, and that rarely happened for releases -- a run can restore caches only from its own ref or the default branch, so every release tag started cold.Download the pinned upstream 0.29.0 prebuilt binary instead and verify its sha256. Pinning a release also makes the tool that signs our releases reproducible, which
--branch maindid not.All flags used by bin/sign and bin/notarize work on 0.29.0; --entitlements-xml-path and --api-key-path are accepted aliases of the newer --entitlements-xml-file and --api-key-file.
Drop the now-unused cargo caches from both macOS jobs and from the windows job, which never used Rust at all — it signs via azure/trusted-signing-action, so that step restored and re-saved an empty ~/.cargo for nothing.