Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Create Microsoft.iOS.Windows.Sdk workload pack #11251

Merged
merged 9 commits into from
Apr 27, 2021

Conversation

pjcollins
Copy link
Member

@pjcollins pjcollins commented Apr 21, 2021

Converts the Microsoft.iOS.Windows.Sdk NuGet package into a proper
workload SDK pack. The entry point for this pack has been changed,
and it is now imported through the WorkloadManifest.targets file
included in Microsoft.NET.Workload.iOS, rather than being imported
directly from Microsoft.iOS.Sdk.

Import ordering has otherwise changed slightly. The following files are
now imported before the majority of the Microsoft.iOS.Sdk (and the
majority of the .NET SDK targets):

  • Xamarin.iOS.Common.Before.props
  • Xamarin.iOS.Common.Before.targets

After this the majority of the .NET SDK targets will load, followed by
the Microsoft.iOS.Sdk targets. Finally, everything declared in the
<AfterMicrosoftNETSdkTargets/> hook loads, which consists of:

  • Microsoft.iOS.Windows.Sdk.targets
  • tools/msbuild/*

Comment on lines +124 to +125
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA), \
$(if $(findstring $(platform),$(DOTNET_WINDOWS_PLATFORMS)),targets/WorkloadManifest.windows.template.json,targets/WorkloadManifest.template.json))))
Copy link
Member

Choose a reason for hiding this comment

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

I think this will stop generating workloads for platforms included in DOTNET_WINDOWS_PLATFORMS, are you sure you don't want to add a line instead:

Suggested change
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA), \
$(if $(findstring $(platform),$(DOTNET_WINDOWS_PLATFORMS)),targets/WorkloadManifest.windows.template.json,targets/WorkloadManifest.template.json))))
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA,targets/WorkloadManifest.template.json))))
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call WorkloadTargets,$(platform),$(shell echo $(platform) | tr A-Z a-z),$($(platform)_NUGET_VERSION_NO_METADATA,targets/WorkloadManifest.windows.template.json))))

Copy link
Member Author

@pjcollins pjcollins Apr 21, 2021

Choose a reason for hiding this comment

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

I want to use the new "windows" template file for all workloads in $(DOTNET_PLATFORMS) that include a windows SDK. These changes should result in the Microsoft.NET.Workload.iOS workload declaring this new Windows only pack, however since it's conditionally imported in WorkloadManifest.targets it will never need to be installed on macOS. This all seemed to work locally but it looks like CI didn't run for this yesterday so I'm still waiting to check an official build. I don't want to introduce new Windows specific workloads (just one new workload pack). We should be able to continue to ship the same Microsoft.NET.Workload.iOS workload on both macOS and Windows.

@spouliot spouliot added the not-notes-worthy Ignore for release notes label Apr 21, 2021
@pjcollins pjcollins force-pushed the windows-workload-packs branch from 7fa2a18 to d6543fb Compare April 21, 2021 15:19
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

1 tests failed, 98 tests passed.

Failed tests

  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed

Pipeline on Agent XAMBOT-1099'
Merge d6543fb into 6d12766

@rolfbjarne rolfbjarne requested a review from emaf April 22, 2021 06:04
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

🎉 All 102 tests passed 🎉

Pipeline on Agent XAMBOT-1103'
Merge 40e87ae into e2082fd

@pjcollins pjcollins marked this pull request as ready for review April 22, 2021 15:01
@@ -0,0 +1,32 @@
{
"version": 5,
"workloads": {
Copy link
Member

Choose a reason for hiding this comment

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

I'm confused by this file, do we need two WorkloadManifest.json files?

We also have:

https://github.com/xamarin/xamarin-macios/blob/main/dotnet/targets/WorkloadManifest.template.json

If we need Microsoft.@PLATFORM@.Windows.Sdk to only get included on Windows, I think we can do that in a single file with platforms. They have some examples in this one:

https://github.com/dotnet/runtime/pull/51327/files#diff-64281a49401453e112876a358cf32e129406068f49ae6e3ad7c446d0b29931b5R144

I think we could have:

"Microsoft.@PLATFORM@.Windows.Sdk": {
	"kind": "sdk",
	"version": "@VERSION@",
	"platforms": [ "win-x86", "win-x64" ]
},

Related: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md#pack-definitions

Copy link
Member Author

@pjcollins pjcollins Apr 22, 2021

Choose a reason for hiding this comment

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

The reasoning behind the two files is that WorkloadManifest.template.json is used for all other platforms (mac, watch, tv), and these workloads don't (and some will never?) have a *.Windows.Sdk entry.

Rather than adding more complex string manipulation to dotnet/Makefile to conditionally add this windows entry to only the iOS manifest, I added a new template for workloads that should include a "Windows" Sdk. I suppose we could always have a "Microsoft.@PLATFORM@.Windows.Sdk" entry in those other workloads that ultimately mapped to nothing, but it seems uglier.

We may want add the "platforms": [ "win-x86", "win-x64" ] declaration here, though the conditional import in the iOS WorkloadManifest.targets file allows the new manifest which declares a windows specific pack to work on macOS even when the pack is not installed.

Copy link
Member

Choose a reason for hiding this comment

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

Ok makes sense 👍

I think we need to put platforms so that the future dotnet workload install commands won't install these Windows packs on Mac.

Copy link
Member Author

@pjcollins pjcollins Apr 23, 2021

Choose a reason for hiding this comment

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

It looks like this feature may not work when declared directly on a pack entry, I'm going to revert this portion for now dotnet/sdk#17151

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

🎉 All 104 tests passed 🎉

Pipeline on Agent XAMBOT-1104.BigSur
Merge 3e032bd into 0924ce5

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Test results

26 tests failed, 78 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Debug [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Debug (LinkSdk) [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Release (all optimizations) [dotnet]: BuildFailure
  • interdependent-binding-projects/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • introspection/tvOS - simulator/Debug [dotnet]: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • dont link/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • dont link/tvOS - simulator/Debug [dotnet]: BuildFailure
  • dont link/tvOS - simulator/Release [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link all/tvOS - simulator/Debug [dotnet]: BuildFailure
  • link all/tvOS - simulator/Release [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link sdk/tvOS - simulator/Debug [dotnet]: BuildFailure
  • link sdk/tvOS - simulator/Release [dotnet]: BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1101'
Merge 71c3e55 into 94caf96

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

🎉 All 104 tests passed 🎉

Pipeline on Agent XAMBOT-1101
Merge 749e1c1 into 5d42c93

@rolfbjarne
Copy link
Member

Waiting on review from @emaf to merge.

@rolfbjarne rolfbjarne merged commit b88c3bb into dotnet:main Apr 27, 2021
@spouliot
Copy link
Contributor

/sudo backport d16-10

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch d16-10 Created! The magic is happening here

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Oh no! Backport failed! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4804552 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants