Skip to content

Use stable signing identifiers for macOS .NET tools - #10197

Merged
hoyosjs merged 9 commits into
dotnet:mainfrom
hoyosjs:juhoyosa/mac-sign
Oct 20, 2026
Merged

hoyosjs merged 9 commits into
dotnet:mainfrom
hoyosjs:juhoyosa/mac-sign

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Oct 14, 2026

Copy link
Copy Markdown
Member

Give concrete macOS .NET tools stable signing identifiers instead of filename- or UUID-derived identities. Embed bundle metadata in native hosts and NativeAOT tools, and explicitly apply the identifiers when ad hoc signing NativeAOT tools and SDK-created apphosts. Existing entitlements are retained; NativeAOT tools do not gain JIT entitlements. Reusable apphost templates remain application-neutral.

Identifiers use com.microsoft.dotnet.<tool-name> in lowercase. Embedded CFBundleName values are the plain tool names.

Tool Identifier
dotnet com.microsoft.dotnet.dotnet
createdump com.microsoft.dotnet.createdump
corerun com.microsoft.dotnet.corerun
ilasm com.microsoft.dotnet.ilasm
ildasm com.microsoft.dotnet.ildasm
mono-sgen com.microsoft.dotnet.mono-sgen
crossgen2 com.microsoft.dotnet.crossgen2
ilc com.microsoft.dotnet.ilc
csc com.microsoft.dotnet.csc
vbc com.microsoft.dotnet.vbc
VBCSCompiler com.microsoft.dotnet.vbcscompiler
MSBuild com.microsoft.dotnet.msbuild
dotnet-dev-certs com.microsoft.dotnet.dotnet-dev-certs
dotnet-user-jwts com.microsoft.dotnet.dotnet-user-jwts
dotnet-user-secrets com.microsoft.dotnet.dotnet-user-secrets

ASP.NET Core native shims are signed in the SDK layout; standalone tool-package signing remains producer-owned follow-up work.

Manual validation: inspected the signed ARM64 SDK 12.0.100-alpha.1.26513.113. All 28 Mach-O files had valid Microsoft Developer ID signatures, and the nine targeted executables present retained their expected identifiers and entitlements. With DOTNET_ROOT pointing to that SDK, created, built and ran a console project and its apphost, exercised the shipped tools' help, and verified isolated compiler-server startup. Native metadata and ad hoc signing were also exercised with arm64/x64 fixtures. The temporary pipeline changes are reverted.

Note

This description was prepared with GitHub Copilot.

hoyosjs and others added 5 commits October 13, 2026 10:33
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Restore the official VMR build matrix after validating macOS signing.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Copilot AI balanced review requested due to automatic review settings October 14, 2026 00:39
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The NativeAOT plist emits a four-component CFBundleVersion, which does not conform to Apple’s bundle-version format.

2 open findings
What changed in this PR

Adds stable macOS signing identifiers and bundle metadata to concrete .NET tools across Runtime and SDK layout generation.

Changes:

  • Embeds stable identifiers in native and NativeAOT tools.
  • Applies identifiers during SDK layout ad hoc signing.
  • Documents signing conventions and ownership.
File Description
src/​sdk/​src/​Layout/​redist/​targets/​GenerateLayout.targets Signs Roslyn and MSBuild apphosts with stable identifiers.
src/​sdk/​src/​Layout/​redist/​targets/​BundledDotnetTools.targets Signs bundled ASP.NET Core tool hosts.
src/​sdk/​src/​Layout/​Directory.Build.props Defines SDK apphost signing identifiers.
src/​sdk/​src/​Layout/​AGENTS.md Documents SDK signing conventions.
src/​runtime/​src/​tools/​ilasm/​src/​ilasm/​ilasm.csproj Adds ilasm bundle metadata.
src/​runtime/​src/​native/​corehost/​dotnet/​CMakeLists.txt Adds dotnet host metadata.
src/​runtime/​src/​mono/​mono/​mini/​CMakeLists.txt Adds mono-sgen metadata.
src/​runtime/​src/​coreclr/​tools/​aot/​ILCompiler/​ILCompiler_publish.csproj Adds ilc bundle metadata.
src/​runtime/​src/​coreclr/​tools/​aot/​crossgen2/​crossgen2_publish.csproj Adds crossgen2 bundle metadata.
src/​runtime/​src/​coreclr/​README.md Documents NativeAOT metadata and signing.
src/​runtime/​src/​coreclr/​ildasm/​exe/​CMakeLists.txt Adds ildasm metadata.
src/​runtime/​src/​coreclr/​ilasm/​CMakeLists.txt Adds native ilasm metadata.
src/​runtime/​src/​coreclr/​hosts/​corerun/​CMakeLists.txt Adds corerun metadata.
src/​runtime/​src/​coreclr/​debug/​createdump/​CMakeLists.txt Adds createdump metadata.
src/​runtime/​eng/​toolAot.targets Generates plist metadata and signs NativeAOT hosts.
src/​runtime/​eng/​native/​Info.plist.in Defines native executable plist template.
src/​runtime/​eng/​native/​functions.cmake Adds reusable macOS metadata embedding.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/runtime/eng/toolAot.targets Resolved
Comment thread src/sdk/src/Layout/AGENTS.md Resolved
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Comment thread src/runtime/eng/toolAot.targets Resolved

@mmitche mmitche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor comment.

Comment thread src/runtime/eng/toolAot.targets Resolved
hoyosjs and others added 2 commits October 19, 2026 12:32
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Use the pinned templating task for the shared plist and preserve existing entitlements when signing NativeAOT tool hosts.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
Retain requirements, signing flags, hardened runtime version, and launch and library constraints alongside entitlements when signing tool hosts. Continue explicitly supplying the intended identifiers and apphost entitlement files.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
@hoyosjs
hoyosjs merged commit 349de2d into dotnet:main Oct 20, 2026
11 checks passed
@hoyosjs
hoyosjs deleted the juhoyosa/mac-sign branch October 20, 2026 18:46
hoyosjs added a commit that referenced this pull request Oct 20, 2026
Backport the macOS signing fix and review corrections from #10197 for the hosts present in .NET 10. Use the pinned templating task with staged rendering to preserve incremental linking.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 7428b286-6075-4523-8c20-a8e1e959ed1a
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.

6 participants