-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 BaseOutputPath to common targets #5238
Conversation
I don't know who to tag. So, @rainersigwald NuGet Pack target needs this. Can you or anyone from the team take a look at this? |
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.
Team triage: we're amenable in theory to taking this in 16.7/SDK 3.1.400.
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 appear to have written up comments but not published them. Sorry!
Did a little bit of refactoring to place all the output logic in one place. Other than that, only changes include what you have suggested: Using Should I add tests for the |
I think this looks good to go (with the minor changes that are outstanding). Would you mind resolving conflicts? |
When I tested the above logic with and without Common targets, there's a noticeable difference of around 700ms-1s delay when using property functions. This is observed with running the test project again and again in Command Prompt and WSL manually. Is there any guide/tool to properly profile MSBuild builds? I have tested the above logic with
The Behaviour of
|
That's a shockingly large difference. Can you share exactly how you were testing?
We have a fairly detailed evaluation-time profiler, and can also use our ETW events.
The results you shared don't make any sense to me, no. Again, can you describe exactly how you got them? |
Here's the test projects with different variations of OutputPath definitions: MSBuild-5238-Repro.zip With both Desktop and Core MSBuild run the test projects with As you have suggested, we can also profile them with or without Common targets using |
Without having looked too carefully, does this also resolve #2308? |
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 need to look at the tests but other than the comments about "MPFProj" that I need clarification on this is looking good. Thanks for your patience!
While this is not officially supported on non-sdk projects, NuGet Pack targets need a common output path to put '.nupkg' across both type of projects
Replace 'HasTrailingSlash' conditional function with '[MSBuild]::EnsureTrailingSlash' property function Replace '[System.IO.Path]::Combine' property function with '[MSBuild]::NormalizePath' and '[MSBuild]::NormalizeDirectory' property functions
when using OutputPath without BaseOutputPath
…bine paths Usually, either '[MSBuild]::NormalizePath' or '[MSBuild]::NormalizeDirectory' property functions would be preferred for these cases. But, there's a bug (on Windows) which occurs when a drive relative path like 'C:Projects' is specified and it fails to return to the project directory. Usually, '[System.IO.Path]::Join' would be most preferred in this context. But, it's not available in NETFX. So, '[System.IO.Path]::Combine' is used instead.
Making sure that existing 'OutputPath' scenarios work, while allowing the use of 'BaseOutputPath' property
Adjust the wording to make it simple, brief and clear. Co-Authored-By: Rainer Sigwald <[email protected]> > Fixup with original commit when this patch is approved.
Silly ME! There were a lot of build errors from the Fakes targets. I was banging my head on which change caused this but finally found it. Guess being sick has its perks.
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.
Awesome, thanks!
@rainersigwald Sorry for the late reply!
|
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.
Looks good to me! Thanks for this!
Went to celebrate Diwali and came back with a bad case of cold.
I'm sorry to hear that. Glad you're feeling better!
I'm fine now. Thanks! |
Finally! 🥳 |
While this is not officially supported on non-sdk projects, NuGet Pack targets need a common output path to put '.nupkg' across both type of projects.
Required for NuGet/Home#9234 in PR NuGet/NuGet.Client#3270
Also Fixes #1664