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

report unix-friendly packages path #10815

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

brettfo
Copy link
Contributor

@brettfo brettfo commented Oct 18, 2024

When running an update in a packages.config scenario, the path to the packages directory is determined from existing <HintPath> elements. If the path returned looks something like ..\packages that causes problems on non-Windows machines because the backslash is retained and ultimately the packages are restored to a directory named ..?packages which is incorrect.

The first fix was to simply normalize this path to the Unix standard which Windows can handle just fine.

The second fix was to expand the cases where we run nuget.exe restore before we can update the package; this happens if a package's .targets file is directly imported without a guarding Condition="Exists(path)" attribute.

This fixes some bugs seen during an internal log audit.

@brettfo brettfo added the L: dotnet:nuget NuGet packages via nuget or dotnet label Oct 18, 2024
@brettfo brettfo marked this pull request as ready for review October 18, 2024 21:05
@brettfo brettfo requested a review from a team as a code owner October 18, 2024 21:05
@brettfo brettfo force-pushed the dev/brettfo/nuget-targets-not-found branch from 9a18705 to 38bd4b5 Compare October 18, 2024 21:36
@randhircs randhircs force-pushed the dev/brettfo/nuget-targets-not-found branch from 38bd4b5 to f5f39ec Compare October 22, 2024 14:52
@randhircs randhircs merged commit 24e0ab1 into main Oct 22, 2024
68 checks passed
@randhircs randhircs deleted the dev/brettfo/nuget-targets-not-found branch October 22, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants