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

[dotnet] Condition default inclusion on the target framework version. #15196

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

rolfbjarne
Copy link
Member

One problem we hit when trying to build net6.0-ios projects from
a .NET 7 SDK & iOS workload, was that we ended up importing two
AutoImport.props files.

These are imported for any pack in WorkloadManifest.json declared as
an SDK:

"packs": {
  "Microsoft.iOS.Sdk": {
    "kind": "sdk",

So the way this has to work is that ny <ItemGroup> must be conditioned so
that $(TargetFrameworkVersion) matches the expected .NET SDK version.

I used [MSBuild]::VersionEquals() for all checks, because the value
is v6.0 and the helper method properly handles this case for us.

When this change ships in a .NET 6 servicing release, we can then
update our .NET 7 packages to rely on this change.

This is equivalent to Android's change here:
dotnet/android@38b3fa6

One problem we hit when trying to build `net6.0-ios` projects from
a .NET 7 SDK & iOS workload, was that we ended up importing *two*
`AutoImport.props` files.

These are imported for any pack in `WorkloadManifest.json` declared as
an SDK:

    "packs": {
      "Microsoft.iOS.Sdk": {
        "kind": "sdk",

So the way this has to work is that ny `<ItemGroup>` must be conditioned so
that `$(TargetFrameworkVersion)` matches the expected .NET SDK version.

I used `[MSBuild]::VersionEquals()` for all checks, because the value
is `v6.0` and the helper method properly handles this case for us.

When this change ships in a .NET 6 servicing release, we can then
update our .NET 7 packages to rely on this change.

This is equivalent to Android's change here:
dotnet/android@38b3fa6
@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Jun 2, 2022
@rolfbjarne
Copy link
Member Author

/sudo backport release/6.0.4xx

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch release/6.0.4xx Created! The magic is happening here

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6236693 for more details.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📋 [PR 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 XAMBOT-1035.Monterey
Hash: 72d1964bd2ea8445f1307136c6d60f36abffb428

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [PR Build] Build failed 🔥

Build failed for the job 'Build packages'

Pipeline on Agent
Hash:

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1043.Monterey
Hash: 72d1964bd2ea8445f1307136c6d60f36abffb428

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 72d1964bd2ea8445f1307136c6d60f36abffb428

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Tests failed on VSTS: simulator tests iOS.

Test results

5 tests failed, 140 tests passed.

Failed tests

  • trimmode copy/Mac Catalyst [dotnet]/Debug [dotnet]: TimedOut ( (failed to parse the logs: The Writer is closed or in error state.))
  • fsharp/watchOS 32-bits - simulator/Debug: Crashed
  • interdependent-binding-projects/watchOS 32-bits - simulator/Debug: Crashed
  • introspection/watchOS 32-bits - simulator/Debug: Crashed
  • mono-native-compat/watchOS 32-bits - simulator/Debug: Crashed

Pipeline on Agent XAMBOT-1043.Monterey'
Merge 72d1964 into 980eacb

@rolfbjarne
Copy link
Member Author

Test failures are unrelated (https://github.com/xamarin/maccore/issues/2558).

@rolfbjarne rolfbjarne merged commit 5039634 into xamarin:main Jun 7, 2022
@rolfbjarne rolfbjarne deleted the dotnet-defaultitems-net6.0 branch June 7, 2022 07:45
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.

3 participants