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

[release/7.0] Target only net7.0 during source-build #75168

Merged
merged 9 commits into from
Sep 12, 2022

Conversation

lbussell
Copy link
Contributor

@lbussell lbussell commented Sep 6, 2022

See dotnet/source-build#2966 for more context.

This is needed for net7.0 RC2 in order to ship source-build without prebuilts. We have a working branch with these changes as a patch here, showing that the changes are at least functional and pass our tests: dotnet/installer#14167

@ghost
Copy link

ghost commented Sep 6, 2022

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

See dotnet/source-build#2966 for more context.

This is needed for net7.0 RC2 in order to ship source-build without prebuilts. We have a working branch with these changes as a patch here, showing that the changes are at least functional and pass our tests: dotnet/installer#14167

Author: lbussell
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

Directory.Build.props Outdated Show resolved Hide resolved
Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

The compatibility suppression file changes result in package validation failing during a non source build as the suppressions are missing for net6.0. Instead consider disabling package validation during source build by adding the following switch to SourceBuild.props: /p:EnablePackageValidation=false.

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label Sep 7, 2022
@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Sep 7, 2022
@@ -7,7 +7,7 @@
<EnableTrimAnalyzer Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">false</EnableTrimAnalyzer>
<IsPackable>true</IsPackable>
<!-- Lifetime rules introduced in C# 11 impact scenarios in net6 framework -->
<LangVersion Condition="'$(TargetFramework)' == 'net6.0'">10</LangVersion>
<LangVersion Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0'">10</LangVersion>
Copy link
Member

Choose a reason for hiding this comment

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

This change doesn't look right. We were already targeting net7.0 before. Why wasn't that needed? cc @tarekgh

Copy link
Member

Choose a reason for hiding this comment

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

CC @AaronRobinsonMSFT as he is the one introduced this.

Copy link
Member

Choose a reason for hiding this comment

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

This was because of the ref field support and the project using the .NET 7 Preview ref assemblies instead of the live build assemblies. Once the SDK for the repo was updated, this can likely be removed and the code fixed up a bit.

/cc @jakobbotsch

Copy link
Member

Choose a reason for hiding this comment

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

Based on Aaron's reply, this setting shouldn't be needed anymore:

Suggested change
<LangVersion Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0'">10</LangVersion>

Copy link
Member

Choose a reason for hiding this comment

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

This change should also be forward ported into main.

@@ -23,7 +23,7 @@

<PropertyGroup>
<_NetCoreAppCurrent>net7.0</_NetCoreAppCurrent>
<_NetCoreAppToolCurrent>net6.0</_NetCoreAppToolCurrent>
<_NetCoreAppToolCurrent>net7.0</_NetCoreAppToolCurrent>
Copy link
Member

Choose a reason for hiding this comment

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

@akoeplinger can you please help me understand why this file duplicates these common properties?

Copy link
Member

Choose a reason for hiding this comment

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

@ViktorHofer the intention of this file is to be used outside of the dotnet/runtime repo where we don't have access to the common properties (see the description above), i.e. you'd include this .props file in a test .csproj and set RuntimeSrcDir/RuntimeConfig and use your locally built runtime.

We could probably generate this file so we could inject the values for _NetCoreAppCurrent/_NetCoreAppToolCurrent

Copy link
Member

Choose a reason for hiding this comment

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

Generating this file would be helpful to avoid multiple sources of truth for the tfm and the version properties.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please file an issue?

Copy link
Member

Choose a reason for hiding this comment

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

@carlossanlop carlossanlop changed the title Target only net7.0 during source-build [release/7.0] Target only net7.0 during source-build Sep 7, 2022
@carlossanlop
Copy link
Member

@ViktorHofer any chance you can take a look again? There are new commits.

@@ -54,6 +54,7 @@
<NetCoreAppCurrentBrandName>.NET $(NetCoreAppCurrentVersion)</NetCoreAppCurrentBrandName>
<NetCoreAppCurrent>net$(NetCoreAppCurrentVersion)</NetCoreAppCurrent>
<NetCoreAppMinimum>net6.0</NetCoreAppMinimum>
<NetCoreAppMinimum Condition="'$(DotNetBuildFromSource)' == 'true'">$(NetCoreAppCurrent)</NetCoreAppMinimum>
Copy link
Member

Choose a reason for hiding this comment

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

This is the only change here that worries me a bit but if it works then LGTM.

@carlossanlop
Copy link
Member

Thanks for signing off, @ViktorHofer.
CI passed, and this is infra/test only.
Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit 01e9fdd into dotnet:release/7.0 Sep 12, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants