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

Add warning for optional workload EOL #32426

Merged
merged 3 commits into from
May 15, 2023

Conversation

jonathanpeppers
Copy link
Member

Context: https://aka.ms/maui-support-policy
Context: dotnet/android#8030

For out-of-support .NET 6 MAUI projects, we'd like to emit the warning:

Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
warning NETSDK1138: The workload 'android' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

Where each optional workload can opt into this warning via AutoImport.props:

<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
  <EolWorkload Include="android" Url="https://aka.ms/maui-support-policy" />
</ItemGroup>

We would add to this MSBuild item group in the android, ios, macos, maccatalyst, tvos and maui workloads. In the future, wasm-tools could opt into the warning and leave %(Url) blank if desired.

Customers can opt out of the warning in their .csproj by either:

<PropertyGroup>
  <CheckEolWorkloads>false</CheckEolWorkloads>
</PropertyGroup>
<ItemGroup>
  <EolWorkload Remove="android" />
</ItemGroup>

See dotnet/android#8030 for the exact changes we'd make in optional workloads.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels May 10, 2023
Comment on lines +35 to +36
<NETSdkWarning ResourceName="WorkloadIsEol"
FormatArguments="%(EolWorkload.Identity);$([MSBuild]::ValueOrDefault('%(EolWorkload.Url)', 'https://aka.ms/dotnet-core-support'))" />
Copy link
Member Author

Choose a reason for hiding this comment

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

I batched this as you'll probably get a warning for maui and android, even in a project with a single TargetFramework=net6.0-android.

src/Tasks/Common/Resources/Strings.resx Outdated Show resolved Hide resolved
@jonathanpeppers jonathanpeppers force-pushed the CheckEolWorkloads branch 2 times, most recently from dd5aa53 to 4830ebd Compare May 11, 2023 15:43
Context: https://aka.ms/maui-support-policy
Context: dotnet/android#8030

For out-of-support .NET 6 MAUI projects, we'd like to emit the warning:

    Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1138: The workload 'android' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

Where each optional workload can opt into this warning via
`AutoImport.props`:

    <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="android" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

We would add to this MSBuild item group in the `android`, `ios`,
`macos`, `maccatalyst`, `tvos` and `maui` workloads. In the future,
`wasm-tools` could opt into the warning and leave `%(Url)` blank if
desired.

Customers can opt out of the warning in their `.csproj` by either:

    <PropertyGroup>
      <CheckEolWorkloads>false</CheckEolWorkloads>
    </PropertyGroup>
    <ItemGroup>
      <EolWorkload Remove="android" />
    </ItemGroup>

See dotnet/android#8030 for the exact changes we'd make in
optional workloads.
@jonathanpeppers
Copy link
Member Author

I kept getting merge conflicts about the src/Tasks/Common/Resources/xlf/Strings.*.xlf files. Will something update those anyway? No need to commit them?

@dsplaisted
Copy link
Member

When you do a local build, the .xlf files should be updated. If you're getting conflicts you may need to merge in the upstream changes from the corresponding .resx files.

@jonathanpeppers jonathanpeppers merged commit 86898db into dotnet:main May 15, 2023
@jonathanpeppers jonathanpeppers deleted the CheckEolWorkloads branch May 15, 2023 18:15
@jonathanpeppers
Copy link
Member Author

@dsplaisted @marcpopMSFT what would we need to do to backport to .NET 6 and 7 for this one?

@dsplaisted
Copy link
Member

You'd need to cherry-pick it to branches such as release/7.0.4xx. For servicing branches, we'd need to submit it to .NET Tactics.

@jonathanpeppers
Copy link
Member Author

Is there a magic comment that does this? Or do you manually open a PR and put servicing-requested label?

@dsplaisted
Copy link
Member

No, backports are manual in the SDK repo. For a lot of our active older branches there is automatic codeflow to newer releases.

The label we use is servicing-consider. Here's an example of a PR with the approval template: #30686

It's probably fine to only fill out the template for one PR, and when you send the approval email you can link all of the PRs in the mail and paste the approval template.

jonpryor pushed a commit to dotnet/android that referenced this pull request May 16, 2023
Context: https://aka.ms/maui-support-policy
Context: #8003
Context: dotnet/sdk#32426

.NET Android is part of .NET MAUI, and the support policy for
.NET MAUI is:

> A major version of .NET MAUI receives support for a minimum of 6
> months after a successor (the next major release) ships.

We are now (roughly) at the "6 months after a successor ships" window:
[.NET MAUI for .NET 7.0 was released 2022-Nov-8][0], meaning support
for .NET MAUI for .NET 6.0 ends May 2023, i.e. "now".

dotnet/sdk#32426 adds support for an optional workload to specify
that it is no longer supported by adding an item to the
`@(EolWorkload)` item group:

	<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
	  <EolWorkload Include="android" Url="https://aka.ms/maui-support-policy" />
	</ItemGroup>

This will cause `dotnet build` to issue a new NETSDK1138 build warning:

	dotnet\sdk\6.0.409\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
	warning NETSDK1138: The workload 'android' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which will gracefully inform our customers that the version they're
using is no longer supported.  If necessary, the warning can be
disabled by setting the `$(CheckEolWorkloads)` MSBuild property to False.

TODO: This does not fully solve issue #8003 as future changes are
likely needed in the .NET 8 `android` workload.

[0]: https://devblogs.microsoft.com/dotnet/dotnet-maui-dotnet-7/
jonathanpeppers added a commit to jonathanpeppers/xamarin-macios that referenced this pull request May 16, 2023
Context: https://aka.ms/maui-support-policy
Context: dotnet/android@25cb50d
Context: dotnet/sdk#32426

dotnet/sdk#32426 adds support for an optional workload to specify
that it is no longer supported by adding an item to the
`@(EolWorkload)` item group:

    <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'iOS' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="ios" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

This will cause `dotnet build` to issue a new NETSDK1202 build warning:

    dotnet\sdk\6.0.409\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1202: The workload 'ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

I had to update the `Makefile` to do a `@PLATFORM_LOWERCASE@`
replacement for this.
jonathanpeppers added a commit to jonathanpeppers/maui that referenced this pull request May 16, 2023
Context: https://aka.ms/maui-support-policy
Context: dotnet/android@25cb50d
Context: dotnet/sdk#32426

dotnet/sdk#32426 adds support for an optional workload to specify that
it is no longer supported by adding an item to the `@(EolWorkload)`
item group:

    <ItemGroup Condition=" '$(UseMaui)' == 'true' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="maui" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

This will cause `dotnet build` to issue a new NETSDK1202 build warning:

    dotnet\sdk\6.0.409\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1202: The workload 'maui' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

I also included the message for any one of `$(UseMaui)`,
`$(UseMauiAssets)`, `$(UseMauiCore)`, or `$(UseMauiEssentials)`.
rolfbjarne pushed a commit to xamarin/xamarin-macios that referenced this pull request May 17, 2023
Context: https://aka.ms/maui-support-policy
Context: dotnet/android@25cb50d
Context: dotnet/sdk#32426

dotnet/sdk#32426 adds support for an optional workload to specify that it is no longer supported by adding an item to the `@(EolWorkload)` item group:

    <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'iOS' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="ios" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

This will cause `dotnet build` to issue a new NETSDK1202 build warning:

    dotnet\sdk\6.0.409\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1202: The workload 'ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

I had to update the `Makefile` to do a `@PLATFORM_LOWERCASE@` replacement for this.
rmarinho pushed a commit to dotnet/maui that referenced this pull request May 18, 2023
* [workload] add metadata about .NET 6 EOL

Context: https://aka.ms/maui-support-policy
Context: dotnet/android@25cb50d
Context: dotnet/sdk#32426

dotnet/sdk#32426 adds support for an optional workload to specify that
it is no longer supported by adding an item to the `@(EolWorkload)`
item group:

    <ItemGroup Condition=" '$(UseMaui)' == 'true' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="maui" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

This will cause `dotnet build` to issue a new NETSDK1202 build warning:

    dotnet\sdk\6.0.409\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1202: The workload 'maui' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

I also included the message for any one of `$(UseMaui)`,
`$(UseMauiAssets)`, `$(UseMauiCore)`, or `$(UseMauiEssentials)`.

* Check if `$(TargetFrameworkVersion)` is blank

We were doing this in other conditions in this file.
jonathanpeppers added a commit to jonathanpeppers/sdk that referenced this pull request May 18, 2023
Backport of dotnet#32426

Context: https://aka.ms/maui-support-policy
Context: dotnet/android#8030

For out-of-support .NET 6 MAUI projects, we'd like to emit the warning:

    Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1202: The workload 'android' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

Where each optional workload can opt into this warning via `AutoImport.props`:

    <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="android" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

We would add to this MSBuild item group in the `android`, `ios`, `macos`, `maccatalyst`, `tvos` and `maui` workloads. In the future, `wasm-tools` could opt into the warning and leave `%(Url)` blank if desired.

Customers can opt out of the warning in their `.csproj` by either:

    <PropertyGroup>
      <CheckEolWorkloads>false</CheckEolWorkloads>
    </PropertyGroup>
    <ItemGroup>
      <EolWorkload Remove="android" />
    </ItemGroup>

See dotnet/android#8030 for the exact changes we'd make in optional workloads.
jonathanpeppers added a commit to jonathanpeppers/sdk that referenced this pull request May 18, 2023
Backport of dotnet#32426

Context: https://aka.ms/maui-support-policy
Context: dotnet/android#8030

For out-of-support .NET 6 MAUI projects, we'd like to emit the warning:

    Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(35,5):
    warning NETSDK1202: The workload 'android' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

Where each optional workload can opt into this warning via `AutoImport.props`:

    <ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
      <EolWorkload Include="android" Url="https://aka.ms/maui-support-policy" />
    </ItemGroup>

We would add to this MSBuild item group in the `android`, `ios`, `macos`, `maccatalyst`, `tvos` and `maui` workloads. In the future, `wasm-tools` could opt into the warning and leave `%(Url)` blank if desired.

Customers can opt out of the warning in their `.csproj` by either:

    <PropertyGroup>
      <CheckEolWorkloads>false</CheckEolWorkloads>
    </PropertyGroup>
    <ItemGroup>
      <EolWorkload Remove="android" />
    </ItemGroup>

See dotnet/android#8030 for the exact changes we'd make in optional workloads.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this pull request Feb 19, 2024
…on't support.

If a project tried to use a .NET 6 project (say TargetFramework=net6.0-ios), then
we used to show these rather unhelpful errors:

    error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
    error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

The underlying problem is that we don't support .NET 6 anymore, so with this fix we now show:

    error NETSDK1202: The workload 'net6.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which is much more helpful.

References:

* dotnet/sdk#32426
* dotnet/android#8047

Fixes xamarin#18790.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this pull request Feb 20, 2024
…on't support.

If a project tried to use a .NET 6 project (say TargetFramework=net6.0-ios), then
we used to show these rather unhelpful errors:

    error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
    error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

The underlying problem is that we don't support .NET 6 anymore, so with this fix we now show:

    error NETSDK1202: The workload 'net6.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which is much more helpful.

References:

* dotnet/sdk#32426
* dotnet/android#8047

Fixes xamarin#18790.
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this pull request Feb 21, 2024
…on't support. (#20142)

If a project tried to use a .NET 6 project (say TargetFramework=net6.0-ios), then
we used to show these rather unhelpful errors:

    error NETSDK1147: To build this project, the following workloads must be installed: wasm-tools-net6
    error NETSDK1147: To install these workloads, run the following command: dotnet workload restore

The underlying problem is that we don't support .NET 6 anymore, so with this fix we now show:

    error NETSDK1202: The workload 'net6.0-ios' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/maui-support-policy for more information about the support policy.

which is much more helpful.

References:

* dotnet/sdk#32426
* dotnet/android#8047

Fixes #18790.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants