Skip to content

Commit

Permalink
[dotnet] Make bundling the 'createdump' utility opt-in. Fixes #16189. (
Browse files Browse the repository at this point in the history
…#18960)

Make bundling the 'createdump' utility opt-in by setting BundleCreateDump=true.

Fixes: #16189
  • Loading branch information
rolfbjarne authored Sep 11, 2023
1 parent 2fba9a8 commit b44b57e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@
PublishFolderType="Assembly"
/>
<ResolvedFileToPublish Remove="@(_CreateDumpExecutable)" />
<ResolvedFileToPublish Include="@(_CreateDumpExecutable)" />
<ResolvedFileToPublish Include="@(_CreateDumpExecutable)" Condition="'$(BundleCreateDump)' == 'true'" />

<!-- Remove any dylibs Mono told us not to link with -->
<ResolvedFileToPublish
Expand Down Expand Up @@ -1631,7 +1631,7 @@
<Target Name="_ComputeCodesignItems"
Outputs="$(_CodesignItemsPath)"
>
<ItemGroup Condition="'$(_RequireCodeSigning)' == 'true'">
<ItemGroup Condition="'$(_RequireCodeSigning)' == 'true' And '$(BundleCreateDump)' == 'true'">
<!-- The 'createdump' executable must be signed. -->
<!-- Ref: https://github.com/xamarin/xamarin-macios/issues/13417 -->
<_CreateDumpExecutableToSign Include="@(_CreateDumpExecutable -> '$(_DylibPublishDir)%(RelativePath)')" KeepMetadata="false">
Expand Down
3 changes: 0 additions & 3 deletions tests/dotnet/UnitTests/BundleStructureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable
AddMultiRidAssembly (platform, expectedFiles, assemblyDirectory, Path.GetFileNameWithoutExtension (Configuration.GetBaseLibraryName (platform, true)), runtimeIdentifiers, forceSingleRid: (platform == ApplePlatform.MacCatalyst && !isReleaseBuild) || platform == ApplePlatform.MacOSX, hasPdb: false, includeDebugFiles: includeDebugFiles);
expectedFiles.Add (Path.Combine (assemblyDirectory, "runtimeconfig.bin"));

if (platform == ApplePlatform.MacOSX)
expectedFiles.Add (Path.Combine ("Contents", "MonoBundle", "createdump"));

switch (platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
Expand Down
2 changes: 1 addition & 1 deletion tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ public void BuildCoreCLR (ApplePlatform platform, string runtimeIdentifiers)
ExecuteWithMagicWordAndAssert (platform, runtimeIdentifiers, appExecutable);

var createdump = Path.Combine (appPath, "Contents", "MonoBundle", "createdump");
Assert.That (createdump, Does.Exist, "createdump existence");
Assert.That (createdump, Does.Not.Exist, "createdump existence");
}

[Test]
Expand Down

6 comments on commit b44b57e

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.