-
Notifications
You must be signed in to change notification settings - Fork 340
Update sourcebuild configuration to build net previous and net current #4856
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
Conversation
Capturing a conversation @Evangelink and I had offline. The reported prebuilts are implicitly loaded by the SDK. Since the projects are now targeting NetPrevious, these packages are not available in the source-build graph and thus reported as a prebuilt. With the suggestion I provided in #4856 (comment), it would be acceptable to add these as allowed prebuilts in the SourceBuildPrebuiltBaseline.xml because these are only referenced in CI and not the actual product build. |
Co-authored-by: Michael Simons <msimons@microsoft.com>
targeting NetCurrent or NetPrevious hence we must produce both. | ||
--> | ||
<PropertyGroup Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' != 'Product' "> | ||
<TargetFrameworks>$(NetPrevious);$(NetCurrent)</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even when looking at the PR description I don't understand why vstest needs to build NetPrevious under source-build when not building the product. Why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we insert in both net8 and net9 and it's causing some insertion. That's the solution recommended by @MichaelSimons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This issue is that the dependent repos (e.g. SDK) target different TFM depending on the version. Therefore to support the repo level source-builds, this repo has to target multiple TFMs. This pattern is used in other repos like roslyn.
Fair feedback regarding documentation/tracability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to have regressed the source-build product build: dotnet/installer#18457.
@@ -2,7 +2,7 @@ | |||
|
|||
<PropertyGroup> | |||
<OutputType>Exe</OutputType> | |||
<TargetFramework>net6.0</TargetFramework> | |||
<TargetFrameworks>net6.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This regresses perf as TargetFrameworks kicks-off an inner build from the outer build, even though the project is actually single-targeting. I would revert this change and instead find a better pattern in Directory.Build.props to override the TFM for source-build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have some easy suggestion, I am happy to apply otherwise I fear that's not going to be a priority for me given the other tasks I have on my shoulders at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find any easy trick to unset TargetFramework
and replace it with TargetFrameworks
in case of source build.
…t current (microsoft#4856)" This reverts commit 98c26a1.
Description
Update sourcebuild configuration so we generate both net previous and net current to help with multi-insertion (today we insert both in net8 and net9). The fix is based on my understand of this comment dotnet/sdk#37983 (comment) but it's possible we will have to do a few iterations to have it all right.
Related issue
This should be fixing dotnet/sdk#37983