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

Fix output path issues with customized builds #3270

Merged
merged 4 commits into from
Oct 19, 2020
Merged

Conversation

Nirmal4G
Copy link
Contributor

@Nirmal4G Nirmal4G commented Feb 29, 2020

This PR Fixes NuGet/Home#9234

  • This fixes a host of path related issues when doing a customized build with Pack targets.
  • It also obsoletes the PackageOutputPath in the SDK's DefaultOutputPaths targets.
  • It also ensures non-sdk style projects doesn't have to specify some default paths.

Requires dotnet/msbuild#5238

Copy link
Contributor

@dominoFire dominoFire left a comment

Choose a reason for hiding this comment

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

Thank you so much for your contribution. We need some tests for this change.

@zivkan zivkan added the Community PRs created by someone not in the NuGet team label Mar 5, 2020
@nkolev92 nkolev92 self-assigned this Mar 6, 2020
@Nirmal4G
Copy link
Contributor Author

Nirmal4G commented Mar 9, 2020

I have been going through the tests. Why are all tests written with project directory as the PackageOutputPath and only obj as NuSpecOutputPath instead of bin\{<Platform>\}Debug and obj\Debug as these were previous defaults?

Is it okay if I left them as it is?

The reason all the tests pass because all of them overrides the output paths from the command line invocation. So, No matter what we set they'll all pass. But when I rewrote the logic for invoking Pack cmd using the defaults, they all failed since they were hard coded for the above mentioned logic.

Do I fix all of the tests or add a default path test separately while keeping the others working?

@nkolev92
Copy link
Member

nkolev92 commented Mar 9, 2020

I have been going through the tests. Why are all tests written with project directory as the PackageOutputPath and only obj as NuSpecOutputPath instead of bin{}Debug and obj\Debug as these were previous defaults?

I don't think there's a super special reason for this. It's all at the mercy of the person writing the tests.

I'd don't change the tests, they are a good test that the packageoutputpath behavior is preserved.

Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

There are lots of formatting changes in the targets file.

The way I see it, I don't tihnk this change set needs to be bigger than 10 lines.

Can you please fix the formatting changes without a functional impact.

Thanks!

@Nirmal4G Nirmal4G requested a review from nkolev92 March 11, 2020 15:42
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

Hey @Nirmal4G,

We really appreciate all the effort you have put into this PR, especially your analysis which has been extremely detailed and spans more than just NuGet.

One of the things that would really help us expedite code reviews and the validation process is keeping PRs small and focused on solving one problem at the time. Therefore, we’d prefer it if you could move changes unrelated to the pack code in question to separate PRs as appropriate:

o Test code refactoring
o Build script improvements.

Doing this will also ensure that we can identify and revert potential regressions quickly without pulling out all the improvements that you have been kindly working on.

Again, on behalf of the @NuGet/nuget-client team thank you for your contributions, and we are looking forward to working with you on many more.

This fixes a host of path related issues when doing a customized build with Pack targets.
It also obsoletes the 'PackageOutputPath' in the SDK's 'DefaultOutputPaths' targets.
It also ensures non-sdk style projects doesn't have to specify some default paths.
The Default is now implied and points to the same directory.
It is now redundant, and by removing it, the tests should not fail.
- Checks the default output paths from Project/Solution builds.
- Check both the default and custom paths from continuous Project/Solution builds.
The duplicate logic is not needed.
(edited anyway but will push if anyone approves)
@Nirmal4G Nirmal4G marked this pull request as ready for review October 12, 2020 18:23
@Nirmal4G Nirmal4G requested a review from a team as a code owner October 12, 2020 18:23
@Nirmal4G
Copy link
Contributor Author

I have simplified this PR to only contain the PackageOutputPath changes only for SDK style projects. The testing for non-SDK style projects has been separated into a new PR which I'll open once this is merged.

Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

Thanks @Nirmal4G

@Nirmal4G
Copy link
Contributor Author

@nkolev92 All green, good to go!

@nkolev92
Copy link
Member

@dominoFire your review is blocking the PR, can you please take a look.

You can dismiss it if you'd rather not re-review.

@dominoFire dominoFire dismissed their stale review October 16, 2020 22:21

Already addressed.

@nkolev92 nkolev92 merged commit b6a116e into NuGet:dev Oct 19, 2020
@Nirmal4G Nirmal4G deleted the patch-1 branch October 20, 2020 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PRs created by someone not in the NuGet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OutputPath logic in Pack targets in a customized build doesn't work properly
5 participants