Skip to content

Fix iossimulator build with XCode 26.4#128893

Merged
BrzVlad merged 1 commit into
dotnet:mainfrom
BrzVlad:fix-simulator-build
Jun 3, 2026
Merged

Fix iossimulator build with XCode 26.4#128893
BrzVlad merged 1 commit into
dotnet:mainfrom
BrzVlad:fix-simulator-build

Conversation

@BrzVlad

@BrzVlad BrzVlad commented Jun 2, 2026

Copy link
Copy Markdown
Member

It seems that our CI jobs are using XCode 16.4 and the latest version of XCode, 26.4, bumped clang to version 21 which adds some new warnings (-Wimplicit-int-enum-cast and -Wimplicit-void-ptr-cast). These warnings are picked locally as build errors. This fixes the local build by adding some explicit casting.

Build command used locally:

./build.sh -arch arm64 -os iossimulator  -s clr+clr.runtime+libs+packs+libs.tests -c Release /p:UseMonoRuntime=false /p:UseNativeAOTRuntime=false /p:EnableAdditionalTimezoneChecks=true /p:EnableAggressiveTrimming=true

It seems that our CI jobs are using XCode 16.4 and the latest version of XCode, 26.4, bumped clang to version 21 which adds some new warnings (`-Wimplicit-int-enum-cast` and `-Wimplicit-void-ptr-cast`). These warnings are picked locally as build errors. This fixes the local build.

Build command used locally:
```
./build.sh -arch arm64 -os iossimulator  -s clr+clr.runtime+libs+packs+libs.tests -c Release /p:UseMonoRuntime=false /p:UseNativeAOTRuntime=false /p:EnableAdditionalTimezoneChecks=true /p:EnableAggressiveTrimming=true
```
Copilot AI review requested due to automatic review settings June 2, 2026 12:36
@BrzVlad BrzVlad added the os-ios Apple iOS label Jun 2, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

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.

Pull request overview

This PR makes small, targeted Objective-C/C changes in Apple native shims to avoid newer Clang warnings-as-errors by replacing implicit integer/void-pointer conversions with explicit casts, improving iossimulator build compatibility with newer Xcode toolchains.

Changes:

  • Add explicit casts when converting CFArrayGetValueAtIndex results to CFDictionaryRef in the PKCS#12 import paths.
  • Add explicit casts for CompareOptions and various NS_*Options/NSCalendarUnit zero/bitmask usages to avoid implicit int→enum conversions.
  • Keep behavior unchanged while making the intent explicit to the compiler.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_ios.c Explicitly casts CFArrayGetValueAtIndex results to CFDictionaryRef in PKCS#12 parsing paths.
src/native/libs/System.Globalization.Native/pal_collation.m Adds explicit casts for CompareOptions and option-typed 0 arguments to satisfy stricter Clang warnings.
src/native/libs/System.Globalization.Native/pal_calendarData.m Casts NSCalendarUnit bitmask expression to the expected options type for components:fromDate:.

@kotlarmilos kotlarmilos 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.

LGTM, thanks!

@BrzVlad

BrzVlad commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

/ba-g failures unrelated

@BrzVlad BrzVlad merged commit c7bd259 into dotnet:main Jun 3, 2026
183 of 192 checks passed
@akoeplinger

Copy link
Copy Markdown
Member

/backport to release/10.0

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants