Re-enable symbol stripping for Apple platforms#124266
Re-enable symbol stripping for Apple platforms#124266kotlarmilos wants to merge 18 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR re-enables symbol stripping for Apple platforms by removing a temporary workaround that was added in PR #123386. The workaround disabled symbol stripping (StripSymbols=false) to avoid dsymutil module cache errors that occurred when Swift code was compiled with -g (full debug info). Now that the underlying Swift compilation has been fixed to use -gline-tables-only instead, symbol stripping can be safely re-enabled.
Changes:
- Removes
StripSymbols=falseworkaround from three .csproj files (ILCompiler, crossgen2, and XUnitLogChecker) - Adds symbol stripping logic to the CrossGen2 test script for Apple mobile runtime tests
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj | Removes the StripSymbols=false workaround, allowing default symbol stripping behavior to apply |
| src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj | Removes the StripSymbols=false workaround, allowing default symbol stripping behavior to apply |
| src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj | Removes the StripSymbols=false workaround, allowing default symbol stripping behavior to apply |
| src/tests/Common/CLRTest.CrossGen.targets | Adds symbol stripping command after linking for Mach-O format outputs when StripSymbols is true |
|
The macOS jobs are still reporting missing module cache files (.pcm). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
dsymutil outputs 'error: <path>.pcm: No such file or directory' messages to stdout (not stderr) when processing binaries linked against Apple's Swift runtime static libraries. The previous 2>/dev/null only suppressed stderr, leaving stdout errors visible to MSBuild's error pattern matching. Change to >/dev/null 2>&1 to suppress both streams since dsymutil's diagnostic output is not needed (the .dwarf file is the actual output). This fix applies regardless of whether local or NuGet package NativeAOT targets are used, since DsymUtilOptions is set in eng/toolAot.targets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the Apple platform settings (DsymUtilOptions, NativeSymbolExt) out of the AotOrSingleFile condition gate into a UseNativeAotForComponents-only PropertyGroup. This ensures projects like XUnitLogChecker that set PublishAot directly (without AotOrSingleFile) also get the dsymutil stdout suppression needed to avoid non-fatal PCM error messages breaking the build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
You can also share your feedback on Copilot code review. Take the survey.
- Revert -gline-tables-only from src/native/libs/CMakeLists.txt - Revert -gnone back to -gline-tables-only for Swift compilation - Revert CLRTest.CrossGen.targets stripping change - Remove >/dev/null 2>&1 from DsymUtilOptions (redundant with IgnoreStandardErrorWarningFormat) - Consolidate PropertyGroups in eng/toolAot.targets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsymutil outputs non-fatal PCM module cache errors to stdout (not stderr). IgnoreStandardErrorWarningFormat alone is insufficient to prevent MSBuild from treating these as build errors. Redirect dsymutil output to suppress the non-fatal PCM warnings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b6f2be8 to
431d196
Compare
|
@steveisok @jkoritzinsky Please take a look again |
Description
Re-enables symbol stripping for Apple platforms by removing the
StripSymbols=falseworkarounds fromILCompiler_publish.csproj,crossgen2_publish.csproj,ilasm.csproj, andXUnitLogChecker.csproj. Apple's pre-built Swift runtime static libraries contain DWARF debug info with-gmodulesreferences to.pcmmodule cache files that only existed on Apple's build machines, causingdsymutilto outputerror:messages even though it exits with code 0.To handle this,
IgnoreStandardErrorWarningFormat="true"is added to the dsymutilExectasks inMicrosoft.NETCore.Native.targets,Microsoft.NET.CrossGen.targets, andnative-library.targets, preventing MSBuild from incorrectly counting these output lines as build errors while still catching real failures via non-zero exit codes.Additionally, Apple platform detection in
eng/toolAot.targetsis fixed by usingPortableOSinstead of_IsApplePlatform(which is unavailable at that evaluation point) and broadening the condition toUseNativeAotForComponentsto cover components like XUnitLogChecker that setPublishAotdirectly.Fixes #123687