Skip to content

Commit

Permalink
[msbuild] Use the full path to the symbols list file. Fixes #15046. (#…
Browse files Browse the repository at this point in the history
…15105)

Give the full path to the symbols list file in the extension project to the
main project, so that strip can find it.

When building a solution remotely from Windows, we can't compute a relative
path between projects, because they're laid out differently on disk. This
means that we have to use full paths when passing paths between projects (such
as the path to the symbol list file).

Fixes #15046.
  • Loading branch information
rolfbjarne authored May 30, 2022
1 parent ab7f078 commit 6ecc102
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2389,6 +2389,17 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<Output TaskParameter="Items" ItemName="_WatchAppPostProcessingItems" />
</ReadItemsFromFile>

<!--
For App Extensions, we delay running dsymutil & strip until it has been copied into the main app bundle.
This means that we need the path to the symbols list in the main app's project, and it needs to be a full path when executing remotely from Windows,
because the projects are not in the same position relative to eachother when building remotely (so a relative path doesn't work).
This needs to be executed in a task (and not here inside the target) so the execution always occur on the mac, even when the build is done from Windows.
Ref: https://github.com/xamarin/xamarin-macios/issues/15046
-->
<GetFullPath SessionId="$(BuildSessionId)" Condition="'$(IsMacEnabled)' == 'true'" RelativePath="$(_MtouchSymbolsList)">
<Output TaskParameter="FullPath" PropertyName="_SymbolsListFullPath" />
</GetFullPath>

<ItemGroup>
<!-- add frameworks, with the path relative to the app bundle -->
<_PostProcessingItem Include="@(_ResolvedNativeReference->'$(_AppBundleName)$(AppBundleExtension/$(_AppFrameworksRelativePath)%(Filename).framework/%(Filename)')" Condition="'%(_ResolvedNativeReference.Kind' == 'Framework'">
Expand All @@ -2409,7 +2420,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<DSymName>%(_ResolvedNativeReference.Filename)%(_ResolvedNativeReference.Extension).dSYM</DSymName>
</_PostProcessingItem>
<_PostProcessingItem Include="$([System.IO.Path]::GetFileName('$(AppBundleDir)'))/$(_NativeExecutableRelativePath)" Condition="'$(IsWatchApp)' != 'true'">
<SymbolFile>$(_MtouchSymbolsList)</SymbolFile>
<SymbolFile>$(_SymbolsListFullPath)</SymbolFile>
<DSymName>$(_AppBundleName)$(AppBundleExtension).dSYM</DSymName>
</_PostProcessingItem>

Expand All @@ -2425,10 +2436,7 @@ Copyright (C) 2018 Microsoft. All rights reserved.
</_PostProcessingItem>

<!-- Add any items from app extensions -->
<!-- We must update metadata with paths relative to the root of the contained app bundle to be relative to the root of the current app bundle -->
<_PostProcessingItem Include="@(_AppExtensionPostProcessingItems -> '$(_AppBundleName)$(AppBundleExtension)\$(_AppPlugInsRelativePath)%(Identity)')" Condition="@(_AppExtensionPostProcessingItems->Count()) &gt; 0"> <!-- The condition here shouldn't be necessary, but https://github.com/dotnet/msbuild/issues/4056 -->
<SymbolFile>$([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)','%(_AppExtensionPostProcessingItems.SourceProjectPath)/%(_AppExtensionPostProcessingItems.SymbolFile)'))</SymbolFile>
</_PostProcessingItem>
<_PostProcessingItem Include="@(_AppExtensionPostProcessingItems -> '$(_AppBundleName)$(AppBundleExtension)\$(_AppPlugInsRelativePath)%(Identity)')" Condition="@(_AppExtensionPostProcessingItems->Count()) &gt; 0" /> <!-- The condition here shouldn't be necessary, but https://github.com/dotnet/msbuild/issues/4056 -->

<!-- Add any items from watch app -->
<!-- We must update metadata with paths relative to the root of the app bundle to be relative to the root of the current app bundle -->
Expand Down

5 comments on commit 6ecc102

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 [CI Build] API Diff 📋

API diff (for current PR)

ℹ️ API Diff (from PR only) (please review changes)

API diff: vsdrops gist

Xamarin
.NET
Xamarin vs .NET
iOS vs Mac Catalyst (.NET)

API diff (vs stable)

✅ API Diff from stable

API diff: vsdrops gist

Xamarin
.NET
Xamarin vs .NET
iOS vs Mac Catalyst (.NET)

Generator diff

Generator Diff (no change)

Pipeline on Agent XAMMINI-054.Monterey'
Hash: 6ecc102b5b259e435699972c1a9f3265c66bff7d

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 6ecc102b5b259e435699972c1a9f3265c66bff7d

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • linkall
  • xammac_tests
  • monotouch-test

Pipeline on Agent
Hash: 6ecc102b5b259e435699972c1a9f3265c66bff7d

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMMINI-055.Monterey
Hash: 6ecc102b5b259e435699972c1a9f3265c66bff7d

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

7 tests failed, 227 tests passed.

Failed tests

  • fsharp/watchOS 32-bits - simulator/Debug: Crashed
  • [NUnit] Mono SystemXmlTests/watchOS 32-bits - simulator/Debug: Crashed
  • [NUnit] Mono SystemDataTests/watchOS 32-bits - simulator/Debug: Crashed
  • [NUnit] Mono SystemWebServicesTests/watchOS 32-bits - simulator/Debug: Crashed
  • [xUnit] Mono MicrosoftCSharpXunit/watchOS 32-bits - simulator/Debug: Crashed
  • mscorlib Part 2/watchOS 32-bits - simulator/Debug: Crashed
  • [xUnit] Mono SystemCoreXunit Part 2/watchOS 32-bits - simulator/Debug: Crashed

Pipeline on Agent XAMBOT-1108.Monterey'
[msbuild] Use the full path to the symbols list file. Fixes #15046. (#15105)

Please sign in to comment.