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] Make it so that 'net6.0-*' TargetFrameworks work when building with .NET 7. Fixes #15672. #15761

Merged

Conversation

rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Aug 24, 2022

No description provided.

@rolfbjarne rolfbjarne added the not-notes-worthy Ignore for release notes label Aug 24, 2022
@rolfbjarne rolfbjarne changed the base branch from net7.0 to release/7.0.1xx-rc1 August 25, 2022 07:04
@rolfbjarne rolfbjarne force-pushed the net7.0-rc1-build-for-net6.0 branch from 46e51a4 to 82fb269 Compare August 25, 2022 07:08
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

We can now use these projects with a .NET 6 TFM.

New commits in migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@558958b Revert "[MonoTouch.Dialog] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files. (migueldeicaza/MonoTouch.Dialogspouliot/Touch.Unit#261)"
* migueldeicaza/MonoTouch.Dialog@8e859cc [MonoTouch.Dialog] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files.

Removed commits from migueldeicaza/MonoTouch.Dialog:

* migueldeicaza/MonoTouch.Dialog@eaa2202 [MonoTouch.Dialog] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files.

Diff: https://github.com/migueldeicaza/MonoTouch.Dialog/compare/eaa22021dda3969a73117959a8f638f78a565690..558958b0a2de19036cf6fdd21401573a65239017

New commits in spouliot/Touch.Unit:

* xamarin/Touch.Unit@564433f Revert "[Touch.Client] Use 'BundledNETCoreAppTargetFrameworkVersion' to specify the .NET version in the project files. (xamarin/Touch.Unit#113)"
* xamarin/Touch.Unit@6963a2a [TouchRunner] Flush the console before exiting.

Diff: https://github.com/spouliot/Touch.Unit/compare/be3a8d0855b8291848d02c9c9d99748cb41c56c2..564433f35c8ab6b7bb0709f83e1b81a89c406956
…eworks work when building with .NET 7. Fixes dotnet#15375.

The KnownFrameworkReference now references the exact versions of the ref and runtime
packs we're shipping with the sdk pack, instead of telling the build to use whatever
version is defined in the workload.

Then in the workload we specify the latest released version of the .NET 6 for the
ref and runtime packs.

Finally we add an aliased sdk pack, which points to the .NET 6 sdk pack, and
when we're building a .NET 6 TargetFramework we load this aliased sdk pack
instead of the one we're shipping with this workload.

Putting this together means that:

* When we're building a .NET 7 TargetFramework, we load the sdk pack shipped
  with the workload, which adds a KnownFrameworkReference which references the
  ref and runtime packs with the same version as the sdk pack.
* When we're building a .NET 6 TargetFramework, we load the (aliased) sdk pack
  which points to the latest stable .NET 6 sdk pack. That sdk pack will add a
  KnownFrameworkReference that tells the build to use the ref and runtime pack
  versions specified in the workload - which are now pointing to the .NET 6
  ref and runtime pack versions.

Thus we use the .NET 6 sdk, ref and runtime packs when building a .NET 6
TargetFramework, and we use the .NET 7 sdk, ref and runtime packs when
building a .NET 7 TargetFramework.

According to the workload design spec [1], this is supposed to be implemented
by using aliased ref and runtime packs, but that doesn't work due to
dotnet/sdk#26384.

Fixes dotnet#15375.

[1]: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md?rgh-link-date=2022-06-30T08%3A25%3A10Z#side-by-side-workload-pattern
… variants in there.

This way a workload restore will get the .NET 7 runtime packs.
@rolfbjarne rolfbjarne force-pushed the net7.0-rc1-build-for-net6.0 branch from b997816 to c6df1e3 Compare August 26, 2022 06:36
@rolfbjarne rolfbjarne changed the title [DRAFT] [dotnet] Make it so that 'net6.0-*' TargetFrameworks work when building with .NET 7. Fixes #15672. [dotnet] Make it so that 'net6.0-*' TargetFrameworks work when building with .NET 7. Fixes #15672. Aug 26, 2022
@rolfbjarne rolfbjarne marked this pull request as ready for review August 26, 2022 06:44
@rolfbjarne rolfbjarne requested a review from chamons as a code owner August 26, 2022 06:44
@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Failed to compare API and create generator diff 🔥

Error: 'make' failed for the hash cc4db01.

Pipeline on Agent
Hash: c6df1e3d790e8943010f9f84b96396f46bc06a96 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1042.Monterey
Hash: c6df1e3d790e8943010f9f84b96396f46bc06a96 [PR build]

@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: c6df1e3d790e8943010f9f84b96396f46bc06a96 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Failed tests are:

  • introspection
  • monotouch-test

Pipeline on Agent
Hash: c6df1e3d790e8943010f9f84b96396f46bc06a96 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 1 tests failed, 222 tests passed.

Failures

❌ mmp tests

1 tests failed, 1 tests passed.
  • mmptest/macOS/Debug: Failed (Execution failed with exit code 2)

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
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 23 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 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: [PR build]

@rolfbjarne
Copy link
Member Author

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

@rolfbjarne rolfbjarne merged commit 5ef440f into dotnet:release/7.0.1xx-rc1 Aug 26, 2022
@rolfbjarne rolfbjarne deleted the net7.0-rc1-build-for-net6.0 branch August 26, 2022 13:34
@rolfbjarne
Copy link
Member Author

/sudo backport net7.0

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Backport Job to branch net7.0 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=6612058 for more details.

rolfbjarne pushed a commit that referenced this pull request Aug 26, 2022
Context: xamarin/yaml-templates#180
Context: xamarin/yaml-templates#195
Context: xamarin/yaml-templates#199
Context: #15761

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts.  The MSI and
VSMAN files generated for SDK packs have been split out into a new
`vsdrop-multitarget-signed` artifact, allowing us to include multiple
versions of the SDK packs in VS.

All of the SDK packs have been renamed to include a `.net6` suffix to
match the pack aliases that will be referenced in the .NET 7 manifests.
pjcollins added a commit that referenced this pull request Aug 26, 2022
Context: xamarin/yaml-templates#180
Context: xamarin/yaml-templates#195
Context: xamarin/yaml-templates#199
Context: #15761

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts.  The MSI and
VSMAN files generated for SDK packs have been split out into a new
`vsdrop-multitarget-signed` artifact, allowing us to include multiple
versions of the SDK packs in VS.
rolfbjarne pushed a commit that referenced this pull request Aug 29, 2022
Context: xamarin/yaml-templates#180
Context: xamarin/yaml-templates#195
Context: xamarin/yaml-templates#199
Context: #15761

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts.  The MSI and
VSMAN files generated for SDK packs have been split out into a new
`vsdrop-multitarget-signed` artifact, allowing us to include multiple
versions of the SDK packs in VS.

All of the SDK packs have been renamed to include a `.net6` suffix to
match the pack aliases that will be referenced in the .NET 7 manifests.


Backport of #15776

Co-authored-by: Peter Collins <[email protected]>
rolfbjarne pushed a commit that referenced this pull request Aug 29, 2022
Context: xamarin/yaml-templates#180
Context: xamarin/yaml-templates#195
Context: xamarin/yaml-templates#199
Context: #15761

Updates the build to use the latest MSI generation template. The v3
template uses the latest changes from arcade which include a large
refactoring, support for multi-targeting, and support for workload pack
group MSIs.

The build will now produce two different VS Drop artifacts.  The MSI and
VSMAN files generated for SDK packs have been split out into a new
`vsdrop-multitarget-signed` artifact, allowing us to include multiple
versions of the SDK packs in VS.
rolfbjarne added a commit that referenced this pull request Sep 7, 2022
  #15672. (#15785)

"Backport" of #15761.

This required a few changes:

* The KnownFrameworkReference now references the exact versions of the ref and
  runtime packs we're shipping with the sdk pack, instead of telling the build
  to use whatever version is defined in the workload.

* Then in the workload we specify the latest released version of the .NET 6
  for the ref and runtime packs.

* Finally we add an aliased sdk pack, which points to the .NET 6 sdk pack, and
  when we're building a .NET 6 TargetFramework we load this aliased sdk pack
  instead of the one we're shipping with this workload.

Putting this together means that:

* When we're building a .NET 7 TargetFramework, we load the sdk pack shipped
  with the workload, which adds a KnownFrameworkReference which references the
  ref and runtime packs with the same version as the sdk pack.

* When we're building a .NET 6 TargetFramework, we load the (aliased) sdk pack
  which points to the latest stable .NET 6 sdk pack. That sdk pack will add a
  KnownFrameworkReference that tells the build to use the ref and runtime pack
  versions specified in the workload - which are now pointing to the .NET 6
  ref and runtime pack versions.

Thus we use the .NET 6 sdk, ref and runtime packs when building a .NET 6
TargetFramework, and we use the .NET 7 sdk, ref and runtime packs when
building a .NET 7 TargetFramework.

According to the workload design spec [1], this is supposed to be implemented
by using aliased ref and runtime packs, but that doesn't work due to
dotnet/sdk#26384.

There were a few other related changes:

* Bump MonoTouch.Dialog and Touch.Unit to a get a version where the project
  files uses 'net6.0'. This way these projects partly work as tests.
* We need to remove any global nfloat usings added by any .NET 6 packs because
  we implement the same functionality different in .NET 7 (and they clash).
* Add a test.

Fixes #15672.

[1]: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workload-manifest.md#side-by-side-workload-pattern
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