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

Feature: install from local cached download archives #224

Open
ajkerzner opened this issue Mar 14, 2021 · 9 comments
Open

Feature: install from local cached download archives #224

ajkerzner opened this issue Mar 14, 2021 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@ajkerzner
Copy link

Is there a way to cache downloads with this tool and reuse previously downloaded downloads? I am curious.

@vadi2
Copy link
Contributor

vadi2 commented Mar 14, 2021

What is the context you are using it in?

@miurahr
Copy link
Owner

miurahr commented Mar 15, 2021

No, there is not a way.

There is no feature to reuse archives, and an option not to remove downloaded archive.
It is a reason why there is no way to cache, but you are welcome to improve aqtinstall and send Pull-Request as usual.

@miurahr miurahr added enhancement New feature or request question Further information is requested labels Mar 15, 2021
@miurahr
Copy link
Owner

miurahr commented Mar 15, 2021

Here is a patch to add '--keep' option to keep downloaded archive.
You can use downloaded *.7z files.

You can also use '-O' output directory option to specify target directory.
#225

There is still NO way to reuse existent files, if it exist, aqt might download it again and overwrite it.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

@lebarsfa
Copy link
Contributor

Here is how I use aqt install offline (e.g. for MinGW 32 or 64 bit installations) :

  • Before, set up qt5-default-5.15.2\online\qtsdkrepository\windows_x86\desktop\qt5_5152 folder with data from e.g. ftp://mirrors.dotsrc.org/.mirrors/qtproject/online/qtsdkrepository/windows_x86/desktop/qt5_5152 and run in qt5-default-5.15.2 folder from the computer with the Internet :
python -m pip download --only-binary :all: -r requirements.txt

with

requests==2.25.1
aqtinstall==1.1.6
texttable
packaging

in requirements.txt.

  • On the computer to be installed :
python -m pip install --only-binary :all: --no-index --find-links qt5-default-5.15.2 -r qt5-default-5.15.2\requirements.txt
  • And to be able to use the --base parameter of aqt install, which does not seem to accept directly local folders (firewall might need to be configured to temporarily allow TCP port 8000, e.g. netsh advfirewall firewall add rule name="Open Port 8000 TCP" dir=in action=allow protocol=TCP localport=8000) :
start python -m http.server --directory qt5-default-5.15.2
  • Then (need also 7zip) :
aqt install -E 7z --base http://127.0.0.1:8000/ --outputdir C:\Qt 5.15.2 windows desktop win64_mingw81 -m qtcharts qtscript

@miurahr
Copy link
Owner

miurahr commented Dec 28, 2021

@lebarsfa Thank you for the idea.
It may be good idea to support file:// URL for --base Because aqt now always uses requests http client library, it may not handle file:// URL schema.

@kelteseth
Copy link

@miurahr I would like to see this feature in aqt to speed up my CI setup. So to do this we would need a new --cache option that uses the --keep downloaded 7zip files and then only downloads the hashsums and checks if they match to the local 7zip files, right?

@miurahr miurahr added help wanted Extra attention is needed and removed no-issue-activity labels Sep 28, 2022
@miurahr miurahr reopened this Sep 28, 2022
@miurahr miurahr changed the title How to cache downloads Feature: install from local cached download archives Sep 28, 2022
@lebarsfa
Copy link
Contributor

Probably since around v2.1.0, the idea I mentioned above -- i.e. download e.g. ftp://mirrors.dotsrc.org/.mirrors/qtproject/online/qtsdkrepository/windows_x86/desktop/qt5_5152 to a local folder qt5-default-5.15.2, then start a local server e.g. using python -m http.server --directory qt5-default-5.15.2 and then use aqt with --base http://127.0.0.1:8000/ parameter on a computer without the Internet -- does not work any more as is possibly due to the check of sha256 mentioned in #521.

The easiest workaround at the moment is probably to keep using aqt v2.0.6.

Otherwise, it seems that we would have to change trusted_mirrors in settings.ini to http://127.0.0.1:8000/ and ensure we have downloaded all the sha256 files from https://download.qt.io.

I don't know if there are better ideas if you had set up a local folder using a standard mirror, updated aqt, but have now a limited Internet connection...

@miurahr
Copy link
Owner

miurahr commented May 24, 2023

Pull-Request is always welcome if you can add features such as 1) save sha256 file when --keep specified, and 2) download/read fron local storage when specified URL with file:// scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants