ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
20.85k stars 1.39k forks source link

[Bug] --no-cache does not seem to work #5738

Open travnick opened 9 months ago

travnick commented 9 months ago

Bug Report

Current Behavior

There are cache entries after run install with --no-cache option

Expected Behavior

There are no cache entries after run install with --no-cache option

Additional context/output

D:\>scoop install --no-cache --no-update-scoop --arch 64bit conan@1.62.0
WARN  Given version (1.62.0) does not match manifest (2.0.14)
WARN  Attempting to generate manifest for 'conan' (1.62.0)
Autoupdating conan
Downloading conan-win-32.exe to compute hashes!
conan-win-32.exe (14.8 MB) [==================================================================================================================================================================] 100%
Computed hash: 24961719cb612ceea12eead109c7de3d94cd1204eccf5ae440afeba3dd1b2c5b
Downloading conan-win-64.exe to compute hashes!
conan-win-64.exe (16.0 MB) [==================================================================================================================================================================] 100%
Computed hash: 6a12baf5917bb74886549cd9cf7060588c2bda3978d038431f3b83adf8392f1a
Writing updated conan manifest
Installing 'conan' (1.62.0) [64bit]
WARN  Cache is being ignored.
conan-win-64.exe (16.0 MB) [==================================================================================================================================================================] 100%
Checking hash of conan-win-64.exe ... ok.
Extracting conan-win-64.exe ... done.
Linking ~\scoop\apps\conan\current => ~\scoop\apps\conan\1.62.0
Creating shim for 'conan'.
'conan' (1.62.0) was installed successfully!

D:\>scoop cache show

Total: 1 file, 14.8 MB
Name  Version   Length URL
----  -------   ------ ---
conan 1.62.0  15468533 https_github.com_conan-io_conan_releases_download_1.62.0_conan-win-32.exe

D:\>scoop cache rm *
Removing https_github.com_conan-io_conan_releases_download_1.62.0_conan-win-32.exe...
Deleted: 1 file, 14.8 MB

Possible Solution

System details

Windows version: 10.0.19045.3693

OS architecture: 64bit

PowerShell version: None - run with cmd

Additional software:

Scoop Configuration

{
  "last_update": "2023-11-23T12:50:12.2389997+01:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master"
}
flodavid commented 1 month ago

I think that the —no-cache expected behavior is to not read from the cache, not to avoid writting to it.

travnick commented 1 month ago

What's the point of writing to cache if it's not read? I feel like both read and write should be disabled or read/write flags introduced.

flodavid commented 1 month ago

The point of this option is to force the redownload, in case an app have been updated without its version changing for example

travnick commented 1 month ago

So good name for current behaviour is --redownload. Thing --no-cache suggest to not use cache at all. No read, no write. Not writing a cache helps with saving space and reducing unnecessary files while creating containers or other scenarios.