Skip to content

Allow variable page sizes in codesign output in Microsoft.NET.HostModel.Tests - #134588

Merged
jtschuster merged 1 commit into
dotnet:mainfrom
akoeplinger:fix/macos-codesign-tests
Sep 24, 2026
Merged

jtschuster merged 1 commit into
dotnet:mainfrom
akoeplinger:fix/macos-codesign-tests

Conversation

@akoeplinger

Copy link
Copy Markdown
Member

Summary

  • accept the Page size= field emitted by codesign without requiring a 4 KiB value
  • cover both 4 KiB and 16 KiB code-signing page sizes in the parser test

Context

On macOS 26.7 arm64, /usr/bin/codesign reports Page size=16384 for the locally built apphost and singlefilehost. The existing parser required Page size=4096, causing two Microsoft.NET.HostModel.Tests failures.

The page size is not represented in CodesignOutputInfo or used by the subsequent comparison. The test validates the meaningful signature metadata and code/special-slot hashes, so the parser only needs to verify that the expected field is present.

This was not caught by the current macOS arm64 CI arrangement:

  • the native hosts are built and ad-hoc signed on a macOS 15 build agent, which produces signatures with 4 KiB code-directory pages
  • those pre-signed binaries are then sent to the OSX.26.Arm64.Open Helix queue
  • codesign --display --verbose=6 runs on the Helix machine, but reports the page size stored in the signature previously created on the macOS 15 build agent

A recent scheduled run confirmed that Microsoft.NET.HostModel.Tests executed on macOS 26.4.1 in Helix and passed all 148 tests (147 passed and one unrelated skip), while still observing the build-agent-created signatures.

Testing

./build.sh host.tests -rc release -lc release -test

All host test assemblies passed.

Note

This pull request description was generated with GitHub Copilot.

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

Copilot-Session: aab39968-c93b-478a-acee-e9f7b2eefc26
Copilot AI lite review requested due to automatic review settings September 24, 2026 13:15
@akoeplinger akoeplinger changed the title Allow variable page sizes in codesign output Allow variable page sizes in codesign output in Microsoft.NET.HostModel.Tests Sep 24, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 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.

Copilot review overview

🟢 Approval recommended

The parser now supports both tested page sizes without affecting signature metadata validation.

Review effort: Lite
Findings: None

What changed in this PR

Updates codesign parser tests to support both 4 KiB and 16 KiB macOS page sizes.

Changes:

  • Accepts variable Page size= values.
  • Tests parsing with 4096 and 16384 page sizes.
File Description
src/​installer/​tests/​Microsoft.NET.HostModel.Tests/​MachObjectSigning/​MachObjectTests.cs Adds test cases for both page sizes.
src/​installer/​tests/​Microsoft.NET.HostModel.Tests/​MachObjectSigning/​CodesignOutputInfo.cs Relaxes page-size parsing and parameterizes sample output.

@jtschuster
jtschuster merged commit 586bc32 into dotnet:main Sep 24, 2026
76 checks passed
@akoeplinger
akoeplinger deleted the fix/macos-codesign-tests branch September 24, 2026 17:06
@akoeplinger

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@akoeplinger

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 25, 2026
akoeplinger added a commit that referenced this pull request Oct 2, 2026
…oft.NET.HostModel.Tests (#134600)

Backport of #134588 to release/11.0

/cc @akoeplinger

## Customer Impact

- [ ] Customer reported
- [X] Found internally

None, this just fixes a test to be compatible with newer versions of
macOS.

## Regression

- [ ] Yes
- [x] No

## Testing

CI testing.

## Risk

None.

Co-authored-by: Alexander Köplinger <[email protected]>
Copilot-Session: aab39968-c93b-478a-acee-e9f7b2eefc26
akoeplinger added a commit that referenced this pull request Oct 2, 2026
…oft.NET.HostModel.Tests (#134599)

Backport of #134588 to release/10.0

/cc @akoeplinger


## Customer Impact

- [ ] Customer reported
- [X] Found internally

None, this just fixes a test to be compatible with newer versions of
macOS.

## Regression

- [ ] Yes
- [x] No

## Testing

CI testing.

## Risk

None.

Co-authored-by: Alexander Köplinger <[email protected]>
Copilot-Session: aab39968-c93b-478a-acee-e9f7b2eefc26
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants