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

Lowercase package names in package cache (resolves #2676) #2812

Closed
wants to merge 0 commits into from
Closed

Lowercase package names in package cache (resolves #2676) #2812

wants to merge 0 commits into from

Conversation

julkwiec
Copy link

@julkwiec julkwiec commented Oct 2, 2017

NuGet client used by dotnet CLI lowercases package names when saving them to packages folder and to the cache, while Paket doesn't touch the casing. On case-sensitive filesystems (i.e. on Mono under Linux) this causes dotnet restore to download the referenced packages again.

Repro steps (Windows + Docker)

  1. Checkout https://github.com/julkwiec/paket-dotnet-docker-test
  2. Open powershell, run run.ps1
  3. In the container, run dotnet restore --source /empty - it will fail since the package source directory is empty and AutoMapper is not yet present in the cache.
  4. Run mono paket.exe restore
  5. Run dotnet restore --source /empty again - dotnet still doesn't find the package in cache
  6. Lowercase the names of AutoMapper files and directories:
  • cd ~/.nuget/packages
  • mv AutoMapper automapper
  • cd automapper/6.1.1/
  • mv AutoMapper.6.1.1.nupkg automapper.6.1.1.nupkg
  • mv AutoMapper.6.1.1.nupkg.sha512 automapper.6.1.1.nupkg.sha512
  • mv AutoMapper.nuspec automapper.nuspec
  1. Run cd /test
  2. Run dotnet restore --source /empty. No failure this time - package was found in cache.

@julkwiec julkwiec changed the title [WIP] #2676 Lowercase package names in package cache [WIP] Resolve #2676: Lowercase package names in package cache Oct 2, 2017
@julkwiec julkwiec changed the title [WIP] Resolve #2676: Lowercase package names in package cache [WIP] Lowercase package names in package cache (resolves #2676) Oct 2, 2017
@julkwiec
Copy link
Author

julkwiec commented Oct 3, 2017

NuGet/Home#2522

@julkwiec julkwiec changed the title [WIP] Lowercase package names in package cache (resolves #2676) Lowercase package names in package cache (resolves #2676) Oct 5, 2017
@julkwiec
Copy link
Author

julkwiec commented Oct 5, 2017

Tested on Windows and Linux; looks like it works!

@forki
Copy link
Member

forki commented Oct 6, 2017

the old nuget client didn't do it!? And I never saw that in the cache!?

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

What "old" NuGet client do you mean?

@forki
Copy link
Member

forki commented Oct 6, 2017 via email

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

I tested it using dotnet's built-in NuGet client, but afaik the standalone NuGet.exe lowercases package names as well. I'll check that in a moment.

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

Standalone nuget.exe 4.3.0 lowercases package names as well.
edit: same on NuGet 3.5.0

@forki
Copy link
Member

forki commented Oct 6, 2017

weird. this just feels so wrong

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

it does, but afaik there's no other way to maintain cache compatibility 😢

@julkwiec julkwiec closed this Oct 6, 2017
@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

Sorry, I screwed up the PR, I shouldn't have worked directly on master. New PR: #2826

@matthid
Copy link
Member

matthid commented Oct 6, 2017

weird. this just feels so wrong

@forki can you elaborate? Do you mean the concrete change or in general?

@forki
Copy link
Member

forki commented Oct 6, 2017

in general.

@matthid
Copy link
Member

matthid commented Oct 6, 2017

Then I still don't get it. It is not our cache and we should do what nuget is doing? what is the problem?

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

I think it would be better to go along with NuGet's cache rules instead of using the same cache folder with different rules.

@forki
Copy link
Member

forki commented Oct 6, 2017

yes I'm 100% your opinion to do it in same way as nguet. I just wonder why they changed it...

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

probably because they have to support Linux, which has case-sensitive filesystem.

On second thought... why did they decide to use lowercase instead of original casing everywhere?

@matthid
Copy link
Member

matthid commented Oct 6, 2017

@forki Are you sure that it was not me with the storage:none changes by accident?

@forki
Copy link
Member

forki commented Oct 6, 2017

no I'm sure I saw "original casing" everywhere. that's why I was making so much efforts to get that right

@julkwiec
Copy link
Author

julkwiec commented Oct 6, 2017

relevant comment in NuGet repo: NuGet/Home#5637 (comment)

@forki
Copy link
Member

forki commented Oct 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants