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

[net8.0] [dotnet] Add support for multi-targeting. #18931

Merged

Conversation

rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Sep 6, 2023

[net8.0] [dotnet] Add support for multi-targeting.

Multi targetting is described here:
https://github.com/xamarin/xamarin-macios/blob/main/docs/multi-target-framework.md

This PR implements support for:

  • Building using the first .NET 7 packages we shipped.
  • Building using the last .NET 7 packages we've shipped.

In both cases by specifying the OS version in the target framework.

Additionally adding support for any other API/OS version is trivial: it's just
a matter of listing the corresponding versions in a few files (this is
particularly interesting to add support for preview versions).

It does so by:

  • Renaming the ref, sdk and runtime packs to contain the target framework and
    the target platfrom version, so the packages will now be named:

    • iOS

      • Microsoft.iOS.Sdk.net8.0_16.4
      • Microsoft.iOS.Ref.net8.0_16.4
      • Microsoft.iOS.Runtime.ios-arm64.net8.0_16.4
      • Microsoft.iOS.Runtime.iossimulator-arm64.net8.0_16.4
      • Microsoft.iOS.Runtime.iossimulator-x64.net8.0_16.4
    • tvOS

      • Microsoft.tvOS.Sdk.net8.0_16.4
      • Microsoft.tvOS.Ref.net8.0_16.4
      • Microsoft.tvOS.Runtime.ios-arm64.net8.0_16.4
      • Microsoft.tvOS.Runtime.iossimulator-arm64.net8.0_16.4
      • Microsoft.tvOS.Runtime.iossimulator-x64.net8.0_16.4
    • Mac Catalyst

      • Microsoft.MacCatalyst.Sdk.net8.0_16.4
      • Microsoft.MacCatalyst.Ref.net8.0_16.4
      • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net8.0_16.4
      • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net8.0_16.4
    • macOS

      • Microsoft.macOS.Sdk.net8.0_13.3
      • Microsoft.macOS.Ref.net8.0_13.3
      • Microsoft.macOS.Runtime.osx-x64.net8.0_13.3
      • Microsoft.macOS.Runtime.osx-arm64.net8.0_13.3
  • Updating the WorkloadManifest.json and WorkloadManifest.targets files to
    load the correct packs according to the TargetFramework in the developer's
    project.

  • We're also now giving a better error message for invalid/unsupported/eol'ed
    target frameworks. Fixes Improve error message when targeting net6.0-ios and net6.0-macos from net 8 #18790.

  • Add a few tests.

Fixes:

Contributes towards:

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Failed to compare API and create generator diff 🔥

Failed to update apidiff references

Pipeline on Agent
Hash: eaa69e79b766b3c360a0cd6be216c77ea42f36eb [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: eaa69e79b766b3c360a0cd6be216c77ea42f36eb [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [PR build]

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

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

👍

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 3 tests failed, 230 tests passed.

Failures

❌ xammac tests

3 tests failed, 0 tests passed.
  • xammac tests/Mac Modern/Debug: Failed (Test run failed.
    Tests run: 2846 Passed: 2751 Inconclusive: 8 Failed: 2 Ignored: 93)
  • xammac tests/Mac Modern/Release: Failed (Test run failed.
    Tests run: 2843 Passed: 2748 Inconclusive: 8 Failed: 1 Ignored: 94)
  • xammac tests/Mac Modern/Release (all optimizations): Failed (Test run failed.
    Tests run: 2843 Passed: 2749 Inconclusive: 8 Failed: 2 Ignored: 92)

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 39 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: eaa69e79b766b3c360a0cd6be216c77ea42f36eb [PR build]

@rolfbjarne
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try to show a helpful error message with an invalid OS version in the TFM
3 participants