Skip to content

feat: add code signing support for macOS and Windows binaries#2208

Draft
wolfv wants to merge 5 commits intomainfrom
claude/add-code-signing-yGXa8
Draft

feat: add code signing support for macOS and Windows binaries#2208
wolfv wants to merge 5 commits intomainfrom
claude/add-code-signing-yGXa8

Conversation

@wolfv
Copy link
Member

@wolfv wolfv commented Feb 24, 2026

Motivation

We want to replace cargo-dist by building the Pixi (and rattler-build) binaries with rattler-build, including proper signing. We would then extract the files from the conda package for the release.

Claude comments

Add a new build.signing section to the recipe schema that allows configuring native code signing for macOS (codesign) and Windows (signtool or Azure Trusted Signing).

Key changes:

  • Recipe schema: build.signing.macos (identity, keychain, entitlements, options) and build.signing.windows (local certificate via signtool OR Azure Trusted Signing via azure_endpoint/account/profile)
  • Stage0 parsing + Stage1 evaluation for signing configuration
  • New post_process::signing module that signs all Mach-O/PE binaries after relinking but before packaging
  • Signature verification after signing
  • Safety check: errors if signed binaries contain the build prefix (which would be corrupted by conda's prefix replacement at install time)
  • Added Signtool to system_tools enum

The signing step integrates into the packaging pipeline after relinking and post-processing but before metadata creation, ensuring archives contain properly signed binaries.

https://claude.ai/code/session_017eLvzM9YezN2oJ6Q7etqHu

claude and others added 5 commits February 24, 2026 12:22
Add a new `build.signing` section to the recipe schema that allows
configuring native code signing for macOS (codesign) and Windows
(signtool or Azure Trusted Signing).

Key changes:
- Recipe schema: `build.signing.macos` (identity, keychain, entitlements,
  options) and `build.signing.windows` (local certificate via signtool OR
  Azure Trusted Signing via azure_endpoint/account/profile)
- Stage0 parsing + Stage1 evaluation for signing configuration
- New `post_process::signing` module that signs all Mach-O/PE binaries
  after relinking but before packaging
- Signature verification after signing
- Safety check: errors if signed binaries contain the build prefix
  (which would be corrupted by conda's prefix replacement at install time)
- Added `Signtool` to system_tools enum

The signing step integrates into the packaging pipeline after relinking
and post-processing but before metadata creation, ensuring archives
contain properly signed binaries.

https://claude.ai/code/session_017eLvzM9YezN2oJ6Q7etqHu
…d_signing sub-objects

Instead of flat fields with azure_ prefixes, Windows signing now uses
grouped sub-objects for clearer separation of signing methods:

  signing:
    windows:
      signtool:
        certificate_file: "cert.pfx"
        certificate_password: "${{ env.PW }}"
      timestamp_url: "http://timestamp.digicert.com"

  # OR

  signing:
    windows:
      azure_trusted_signing:
        endpoint: "${{ env.ENDPOINT }}"
        account_name: "${{ env.ACCT }}"
        certificate_profile: "${{ env.PROF }}"

Shared settings (timestamp_url, digest_algorithm) remain at the
windows level. The parser validates mutual exclusivity at parse time.

https://claude.ai/code/session_017eLvzM9YezN2oJ6Q7etqHu
Comprehensive documentation covering:
- Why sign binaries in conda packages (prefix replacement problem)
- Pipeline order (signing happens after relinking, before archiving)
- macOS signing via codesign (identity, keychain, entitlements, options)
- Windows signing via signtool (local .pfx certificate)
- Windows signing via Azure Trusted Signing (cloud-based)
- Cross-platform configuration
- CI/CD examples for GitHub Actions (macOS + Windows)
- File type detection, troubleshooting, and links to related docs

https://claude.ai/code/session_017eLvzM9YezN2oJ6Q7etqHu
Adds examples/code-signing/ containing:
- A minimal C project (hello executable + libgreet shared library)
- recipe.yaml with macOS codesign + Windows signtool signing config
- GitHub Actions workflow that imports certificates from secrets,
  builds with rattler-build, and signs binaries on macOS + Windows
- README with instructions for copying into your own repo

Also updates docs/code_signing.md with a link to the example.

https://claude.ai/code/session_017eLvzM9YezN2oJ6Q7etqHu
@wolfv
Copy link
Member Author

wolfv commented Mar 13, 2026

Another motivating blog post: https://d34dl0ck.me/cargo-codesign/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants