-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Use refasm-only items for compilation #19146
Use refasm-only items for compilation #19146
Conversation
@jcouv: implemented as discussed in dotnet/msbuild#1986 (comment). |
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.
Done with review pass. Thanks!
<Target Name="CoreCompile" | ||
Inputs="$(MSBuildAllProjects); | ||
@(Compile); | ||
@(_CoreCompileResourceInputs); | ||
$(ApplicationIcon); | ||
$(AssemblyOriginatorKeyFile); | ||
@(ReferencePath); | ||
@(ReferencePathWithInterfaceOnlyAssemblies); |
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.
Consider "ReferencePathWithRefAssemblies".
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.
Also, can you clarify the benefit of introducing a new name (why not keep "ReferencePath", but feed annotated content into it)?
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.
Also, can you clarify the benefit of introducing a new name (why not keep "ReferencePath", but feed annotated content into it)?
Never mind, I see you already explained the options in dotnet/msbuild#1986 (comment) Thanks!
<Target Name="ShimReferencePathsWhenCommonTargetsDoesNotUnderstandReferenceAssemblies" | ||
BeforeTargets="CoreCompile" | ||
Condition="'@(ReferencePathWithInterfaceOnlyAssemblies)' == ''"> | ||
<!-- Common targets should populate this item from 15.3, but this file |
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: "dev15.3"
@jaredpar @agocke @jasonmalinowski for review. |
I wasn't involved in the conversations of the ultimate decision to move to a new item type. @rainersigwald are the motivations there documented and written up somewhere? The MSBuild item I see has some discussions but didn't quite give the backstory. I am very worried about project system and extensibility impact, and I want to make sure those were thought about. |
@jasonmalinowski I think dotnet/msbuild#1986 (comment) will answer your questions. |
That was my reasoning. It's entirely possible I've missed something important, though! What project-system/extensibility impact are you worried about? |
There are two impacts I'm concerned about:
To be clear: I don't think this is the wrong approach...I just don't (personally) know if it's the right approach either. 😄 |
build/scripts/build.ps1
Outdated
@@ -25,7 +25,7 @@ function Print-Usage() { | |||
} | |||
|
|||
function Run-Build() { | |||
$buildArgs = "/v:m /m" |
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.
Is this intended?
@@ -64,3 +64,5 @@ public override SourceText GetText(CancellationToken cancellationToken = default | |||
internal IList<DiagnosticInfo> Diagnostics => _diagnostics; | |||
} | |||
} | |||
|
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.
Please revert this file and the one below (empty changes). Thanks
@dotnet/roslyn-compiler for review. I will try to produce a new signed build with this for end-to-end testing in VS tomorrow. @jasonmalinowski Is there anyone else that we should pull in to review integration with project system? |
build/scripts/build.ps1
Outdated
@@ -25,7 +25,7 @@ function Print-Usage() { | |||
} | |||
|
|||
function Run-Build() { | |||
$buildArgs = "/v:m /m" | |||
$buildArgs = "/v:m /m /flp:v=diag" |
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 slows down our build considerably. Why do we need to make this a part of the dev workflow?
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.
You don't, local testing change escaped when I git commit -am
-ed. Will revert.
I'm concerned about lack of tests here. How are we supposed to verify this change? |
ed0945c
to
ae43f4d
Compare
@dotnet/project-system can help review the project system impacts, as well as @dotnet/roslyn-ide who might have some knowledge of the legacy project system impacts. |
@agocke Yes, I ran into this problem in my own recent change for targets file :-( I did local verification then. That said, we're planning to produce a VS build with refout bits from msbuild and Roslyn, this week, so that we can do end-to-end validation. That will help cover. |
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.
LGTM
may be used (via NuGet package) on earlier MSBuilds. If the | ||
adjusted-for-reference-assemblies item is not populated, just use | ||
the older item's contents. --> | ||
<ItemGroup> |
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're using a newer MSBuild is there any legitimate reason that ReferencePathWithRefAssemblies
would be empty? If so are we breaking anything by forcing a value?
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.
The new common targets from dotnet/msbuild#2039 unconditionally populate @(ReferencePathWithRefAssemblies)
here, so no--it shouldn't be empty unless @(ReferencePath)
was too, in which case this should be harmless.
@agocke Unfortunately, testing this kind of change in isolation is very difficult. MSBuild still runs a fairly large suite of (internal) tests that run builds of projects end-to-end and test for certain behaviors, and we should augment that test suite with some specific tests for ref-asm behavior. Does Roslyn have a similar suite, or are y'all dependent on others to catch build flow regressions? RPS scenarios also cover many build end-to-end configurations. One major problem with the existing tests is that they work in VS-land, which requires having insertions of outside-the-VS-repo code. In order to run those tests, this change needs to be available in a Roslyn VSIX, so that it can be combined with an MSBuild VSIX built from the feature branch on our side and tested end-to-end. In MSBuild, we don't have a strict review policy on creating such a feature branch, getting a build from it, and testing it in VS--anyone on the core team can do that at their discretion. I don't know what the policies are in this repo. This PR is what I'd like to see tested in that way--I would not be surprised if that testing revealed problems which will require followup, either here or in MSBuild. But I think the best way to gain confidence in this approach is to test it in VS. |
Reviewers, any other feedback/questions/blockers? |
@jcouv Do we have the test plan written up somewhere? |
@jasonmalinowski Short answer is no, but I can work on that. Is there anything specific you'd like to see? |
@jcouv I'll add comments over there. |
@rainersigwald @jcouv Is there any way we could get this into our bootstrap build before merging? Say, if we produced the MSBuild bits first and then updated Roslyn to consume them, then verified in the bootstrap build that we saw the expected behavior? |
@jaredpar IIRC you added some validation to our bootstrap build to a build task before. Is that a viable option now? |
Use the new item provided by common targets to avoid recompiling a project when a reference has changed only in implementation, not interface. Include a shim so that these targets can continue to work on older MSBuild distributions. That keeps the NuGet-package-for-downlevel scenario working, as well as making an easy transition period to the new logic. Requires dotnet/msbuild#2039 to enable end-to-end use of reference assemblies, but is compatible with earlier MSBuilds (without using reference assemblies).
The Microsoft.Net.Compilers package delivers UsingTasks to override the "standard" ones provided by MSBuild's Microsoft.Common.tasks. That should include the new CopyRefAssembly.
ae43f4d
to
ae50fe8
Compare
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.
Talked with @jcouv. I'm convinced there's nothing we can do right now to improve validation within Roslyn. Once more bits are merged into master we can re-evaluate
Relates to #18612 |
Use the new item provided by common targets to avoid recompiling a
project when a reference has changed only in implementation, not
interface.
Include a shim so that these targets can continue to work on older
MSBuild distributions. That keeps the NuGet-package-for-downlevel
scenario working, as well as making an easy transition period to the new
logic.
Requires dotnet/msbuild#2039.