Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Expand relative paths for CLI arguments - #9892

Merged
livarcocc merged 2 commits into
dotnet:masterfrom
dasMulli:feature/cwd-relative-paths
Sep 10, 2018
Merged

livarcocc merged 2 commits into
dotnet:masterfrom
dasMulli:feature/cwd-relative-paths

Conversation

@dasMulli

Copy link
Copy Markdown

Continuation of #7166 which was too late for 2.0

This changes the output directory for CLI commands to be expanded to a full path based on the current working directory.

This may be a breaking change for some users.

Fixes #6700, #4765

@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch from 53ff121 to 3e51ef3 Compare August 25, 2018 17:10
@dasMulli dasMulli changed the title Expand relative paths for CLI arguments [WIP] Expand relative paths for CLI arguments Aug 25, 2018
@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch 2 times, most recently from 5e25845 to 6a79edc Compare August 26, 2018 05:05
@wli3

wli3 commented Aug 27, 2018 •

Copy link
Copy Markdown

I like it. My concern is we don't have a good way to prevent people forgetting to use full path in the future. But it should be an improvement anyway.

Put that in master is appropriate. I am not confident there is no unexpected bug since we have existing mixed path, so it could get more testing. @dotnet/cli-contrib what do you think?

@dasMulli

dasMulli commented Aug 28, 2018 •

Copy link
Copy Markdown
Author

I still left it WIP because I wanted to do a few more manual test passes on at least win/Mac on some of the arguments to be certain all the modifications work.
Feedback is highly appreciated.

@peterhuene peterhuene added this to the 3.0.1xx milestone Aug 28, 2018

@peterhuene peterhuene left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Generally on board with these changes (really great to see this fixed, as it is definitely confusing to have paths relative to project files). My only question is whether or not we can leverage recent BCL methods for some of this implementation. With that answered, I can sign off.

Comment thread src/dotnet/CommandDirectoryContext.cs Resolved
@peterhuene

peterhuene commented Aug 28, 2018 •

Copy link
Copy Markdown

@dasMulli, thanks for being such an outstanding community member and for providing this work; it is something I think definitely needs to be fixed.

3.0 (master) would be a great place to land this since it is a breaking change, one which we will need to document, but I think greatly improves the command line UX.

@peterhuene peterhuene self-assigned this Aug 28, 2018
@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch 2 times, most recently from dddd470 to 83e49a5 Compare August 31, 2018 08:29
@dasMulli

Copy link
Copy Markdown
Author

test Debian8.2 x64 Debug Build
test Linux_NoSuffix x64 Release Build

@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch from 83e49a5 to f349395 Compare August 31, 2018 16:45
@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch from f349395 to 03d788f Compare August 31, 2018 17:29
@dasMulli dasMulli changed the title [WIP] Expand relative paths for CLI arguments Expand relative paths for CLI arguments Aug 31, 2018
@dasMulli

Copy link
Copy Markdown
Author

test Ubuntu x64 Release Build
test Linux_NoSuffix x64 Release Build

@dasMulli

Copy link
Copy Markdown
Author

Moving out of WIP since it appears to work fine.
Hardest part: naming all the things.

@dasMulli

dasMulli commented Sep 7, 2018

Copy link
Copy Markdown
Author

@peterhuene could you take another look?

Comment thread src/dotnet/CommandDirectoryContext.cs Resolved
Comment thread src/dotnet/CommandDirectoryContext.cs Resolved
Comment thread src/dotnet/CommandDirectoryContext.cs Resolved
Comment thread src/dotnet/CommandDirectoryContext.cs Resolved
Comment thread src/dotnet/CommandDirectoryContext.cs Resolved
@peterhuene

peterhuene commented Sep 7, 2018 •

Copy link
Copy Markdown

I'm finished reviewing, mostly nits regarding naming of things. This looks great! With the remaining nits dealt with, I think we're ready to merge this.

Ping @livarcocc regarding this PR since it is a breaking change (a good one, imo). Should we document this behavior for 3.0 release notes somewhere? Perhaps a "breaking change" label for us to filter by?

@livarcocc

Copy link
Copy Markdown

adding @leecow and @KathleenDollard for the breaking change documentation.

@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch from 6749e1e to abaf197 Compare September 7, 2018 20:02
@dasMulli

dasMulli commented Sep 7, 2018

Copy link
Copy Markdown
Author

@peterhuene thanks, addressed naming issues. #NamingIsHard

@dasMulli
dasMulli force-pushed the feature/cwd-relative-paths branch from abaf197 to 10da5a0 Compare September 7, 2018 21:33
@peterhuene

Copy link
Copy Markdown

@livarcocc any objections to merging this into 3.0?

@peterhuene peterhuene removed their assignment Sep 7, 2018
@leecow

leecow commented Sep 10, 2018

Copy link
Copy Markdown
Member

Definitely add a "breaking change" label.

@livarcocc

Copy link
Copy Markdown

I have marked the bugs and the PR with a breaking change label. I will merge the PR in a couple minutes.

@livarcocc
livarcocc merged commit 91ed1d8 into dotnet:master Sep 10, 2018
@livarcocc

Copy link
Copy Markdown

@dasMulli thank you very much for the contribution,

@mot256

mot256 commented May 22, 2019 •

Copy link
Copy Markdown

Can you please put this in the "what's new" documentation of .NET Core 3.0? This subtle change actually has a side effect on build servers that build both .NET Core 2.x and .NET Core 3.0 projects with the same build scripts. Although we accept that this is a breaking change (and we will separate the build steps between .NET Core 2 and 3 projects now that we know it), but it just not announced in the release notes (at least in what we could find here: https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0)

@dasMulli

Copy link
Copy Markdown
Author

cc @mairaw @KathleenDollard for docs/visibility

@KathleenDollard

Copy link
Copy Markdown

Which version did this go out in and what commands does it effect? At this point, is ti a matter for release docs or as a note in relevant docs? Ideas for text welcome.

@dasMulli

Copy link
Copy Markdown
Author

I think this went out in .NET Core 3.0 Preview 1 and affects the build, clean, pack, publish, restore, store and test commands.

Ad wording, maybe something like?:
Arguments to dotnet commands operating on project files that take paths to files or directory are now interpreted as relative to the current working directory rather than relative to the project file, which was confusing when the project being built was not inside the current working directory.

@peterhuene

Copy link
Copy Markdown

@dasMulli is correct, pretty sure this was P1. I have nothing else to add to the text because I think that sums it up well.

@mot256

mot256 commented May 28, 2019

Copy link
Copy Markdown

What is the expected behavior when a solution is built with this change? Will it append the project name to the path?

@mohlerm

mohlerm commented Aug 16, 2019

Copy link
Copy Markdown

@dasMulli @mairaw @KathleenDollard Will this still be added to the release notes? In our case, this breaks our CI/CD chain so I think it should be visible in the notes.
Cheers

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.

Dotnet publish output parameter doesn't work

8 participants