-
Notifications
You must be signed in to change notification settings - Fork 693
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
Make -NoCache skip reading packages from the global packages folder #856
Conversation
I would like to review 3132/3389/3390/3392 before executing on any of them. Mostly because we want a new unified cache across multiple feeds for package content (and keep the http cache for metadata only). This is already on our backlog, and I would love to avoid further investment in the http cache |
@yishaigalatzer, the 4 issue numbers you mentioned are not addressed by this PR. My PR addresses 1406 and 3074, both of which are schedule for 3.6. I mentioned these issues to give a high level view of what should be considered for future caching changes. |
Yup and so was my comment |
6edff02
to
50591f9
Compare
🔔 could I get some eyes on this? |
// which means the package in the global packages folder should not be used. In this particular | ||
// case, NoCache needs to imply DirectDownload. | ||
directDownload = true; | ||
packageFromGlobalPackages.Dispose(); |
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.
When it gets the latest content from server with NoCache argument, should it also update it in cache? My assumption is since user didn't specify the directDownload flag so it should write the latest content in cache.
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.
We can't overwrite packages in the global packages folder. Another process might be using it, something non-NuGet like MSBuild, so our global locking mechanism would not work.
👀 plz? |
LGTM |
50591f9
to
7a16793
Compare
Fixes NuGet/Home#1406 and NuGet/Home#3074.
This PR brings
-NoCache
closer to sanity. Other related caching issues are tracked here:-NoCache
with a package missing on all sources should cause the operation to fail.Check the
CachingTests.cs
file for assertions on current caching functionality.To summarize, the caching switches should behave as follows:
-NoCache
means "don't read from the cache". If something is in the global packages folder and you are restoring packages.config (that is, the destination folder is something other than a global packages folder), don't use it. Use the version from the source. Same goes for the HTTP cache but the behavior should be consistent between packages.config and project.json.-DirectDownload
means "don't write to the cache". If something is in the global packages folder or HTTP cache, you can use it. The main idea here is to minimize disk usage.-NoCache
and-DirectDownload
together should be "isolated mode". You neither read from nor write to the global packages folder (for packages.config) or HTTP cache (for both packages.config and project.json)./cc @emgarten @yishaigalatzer @MarkOsborneMS @zarenner @zjrunner @pspill