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

Option to keep a downloads cache #2134

Open
brechtm opened this issue Oct 16, 2020 · 4 comments
Open

Option to keep a downloads cache #2134

brechtm opened this issue Oct 16, 2020 · 4 comments

Comments

@brechtm
Copy link

brechtm commented Oct 16, 2020

In setting up Chocolatey on a GitHub Actions workflow, I configured caching to help speed up installation of my dependencies MuPDF and ImageMagick.tool. To this effect, I'm caching %TEMP%\chocolatey. However, only the ImageMagick download is being cached. It appears the MuPDF package is deleted from the cache folder as soon as it's installed.

I understand this is due to a difference in how these two package are organized. However, I would like to propose to add an install/configuration option to not delete downloaded packages from the cache dir, so that they can be cached by a CI system.

In any case, thank you for a very useful tool!

@ferventcoder
Copy link
Member

I want to say this has been discussed in other issues around here (maybe #1390?) before. I'm assuming you mean the downloads that the packages may perform (or do you mean the Chocolatey packages themselves)?

In effect - the cache is not guaranteed and should not be trusted.

I will say, even with that note, if you want to see something stick around a bit longer, ensure you set cacheLocation to somewhere besides Temp.

@brechtm
Copy link
Author

brechtm commented Oct 20, 2020

I'm assuming you mean the downloads that the packages may perform (or do you mean the Chocolatey packages themselves)?

I think only the Chocolatey packages themselves disappear from the download folder immediately. As far as I can tell, ImageMagick.tool is some kind of metapackage that downloads the actual package (which remains in the download folder). MuPDF is fully contained in the Chocolatey package.

I will say, even with that note, if you want to see something stick around a bit longer, ensure you set cacheLocation to somewhere besides Temp.

I tried setting cacheLocation, but the MuPDF package is still deleted right after installation. Actually, I'm not sure it's the downloaded Chocolatey package archive that is (briefly) in the cacheLocation. From memory, there was a NuGet<something> directory with another directory named like a hash or UUID with MuPDF stuff inside.

Sorry, I can try again and report back with details, if needed. I already shut down Windows when I added this remark :-)

@brechtm
Copy link
Author

brechtm commented Oct 21, 2020

Actually, I'm not sure it's the downloaded Chocolatey package archive that is (briefly) in the cacheLocation.

The directory under cacheLocation that is created during installation of a pacackage is NuGetScratch and indeed it doesn't contain the downloaded nupkg.

After some more investigation, I discovered that Chocolatey downloads the nupkgs to %LOCALAPPDATA%\NuGet\Cache. However, the MuPDF nupkg is also removed as soon as the package is installed, even though I see there are other nupkgs in there that obviously didn't get deleted after installation.

Is there any way to tell Chocolatey to keep the downloaded nupkgs in that directory after installation?

@brechtm
Copy link
Author

brechtm commented Oct 21, 2020

Duplicate: #2015
Related: #479

alanxz added a commit to alanxz/rabbitmq-c that referenced this issue Apr 2, 2021
For whatever reason, choco doesn't cache the OpenSSL package.
chocolatey/choco#2134 might resolve this.

Signed-off-by: GitHub <[email protected]>
alanxz added a commit to alanxz/rabbitmq-c that referenced this issue Apr 2, 2021
For whatever reason, choco doesn't cache the OpenSSL package.
chocolatey/choco#2134 might resolve this.

Signed-off-by: GitHub <[email protected]>
alanxz added a commit to alanxz/rabbitmq-c that referenced this issue Apr 2, 2021
For whatever reason, choco doesn't cache the OpenSSL package.
chocolatey/choco#2134 might resolve this.

Signed-off-by: GitHub <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants