Skip to content

Commit eafd219

Browse files
authored
Revert "[dotnet] Pass --preserve-symbol-paths to the trimmer to ensure trimmed assemblies aren't different between architectures. (#23858)"
This reverts commit dc79f3e. The problem is that we need the assembly to point to the linked version of the pdb, otherwise the debugger will refuse to load debug info, saying the pdb doesn't match the dll. Eventually we might need a way to write just the filename of the pdb in the assembly, and not a full path, that that's a much more involved fix. Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2614232.
1 parent 6fd8259 commit eafd219

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -639,17 +639,6 @@
639639
-->
640640
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) -b</_ExtraTrimmerArgs>
641641

642-
<!--
643-
Always preserve symbol paths, which will preserve the original path to the pdb in the trimmed assembly.
644-
This ensures that building for different architectures don't end up with different trimmed assemblies
645-
only because the path to the pdb in the trimmed assembly is different between those builds.
646-
References:
647-
* https://github.com/dotnet/runtime/pull/103295
648-
* https://github.com/jbevain/cecil/pull/554
649-
* https://github.com/rolfbjarne/macios/commit/53874c863996656eaba43a5582731b93eb6f53b7
650-
-->
651-
<_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --preserve-symbol-paths</_ExtraTrimmerArgs>
652-
653642
<!--
654643
655644
The linker will treat type checks as a constant value (false),

tests/dotnet/UnitTests/BundleStructureTest.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,7 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable
290290
AddExpectedFrameworkFiles (platform, expectedFiles, "FrameworkTest4", isSigned);
291291
AddExpectedFrameworkFiles (platform, expectedFiles, "FrameworkTest5", isSigned);
292292

293-
expectedFiles.Add (Path.Combine (assemblyDirectory, "bindings-framework-test.dll"));
294-
if (includeDebugFiles)
295-
expectedFiles.Add (Path.Combine (assemblyDirectory, "bindings-framework-test.pdb"));
293+
AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "bindings-framework-test", runtimeIdentifiers, forceSingleRid: platform != ApplePlatform.MacCatalyst, includeDebugFiles: includeDebugFiles);
296294
AddExpectedFrameworkFiles (platform, expectedFiles, "XTest", isSigned);
297295

298296
AddExpectedFrameworkFiles (platform, expectedFiles, "FrameworkWithLongFileNames", isSigned, longHeader: true);
@@ -313,9 +311,7 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable
313311
expectedFiles.Add (Path.Combine (assemblyDirectory, "nunit.framework.dll"));
314312
expectedFiles.Add (Path.Combine (assemblyDirectory, "nunitlite.dll"));
315313
expectedFiles.Add (Path.Combine (assemblyDirectory, "Mono.Options.dll"));
316-
expectedFiles.Add (Path.Combine (assemblyDirectory, "Touch.Client.dll"));
317-
if (includeDebugFiles)
318-
expectedFiles.Add (Path.Combine (assemblyDirectory, "Touch.Client.pdb"));
314+
AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, "Touch.Client", runtimeIdentifiers, platform == ApplePlatform.MacOSX || (platform == ApplePlatform.MacCatalyst && !isReleaseBuild), includeDebugFiles: includeDebugFiles);
319315
AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform)), runtimeIdentifiers, platform == ApplePlatform.MacOSX, includeDebugFiles: includeDebugFiles);
320316
expectedFiles.Add (Path.Combine (assemblyDirectory, "runtimeconfig.bin"));
321317

0 commit comments

Comments
 (0)