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

Have scripts/cmake/vcpkg_acquire_msys.cmake use the cache when available. #7617

Closed
ASxa86 opened this issue Aug 9, 2019 · 6 comments
Closed
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Comments

@ASxa86
Copy link

ASxa86 commented Aug 9, 2019


Is your feature request related to a problem? Please describe.
I am attempting to run vcpkg in an "offline" mode. By this, I mean I have all of the packages I need downloaded in my downloads folder. Then, on a machine with no internet connection, I run vcpkg install library. For the most part, this works well. There are a couple of libraries that depend on msys2 (ffmpeg, icu) and make use of the call vcpkg_acquire_msys(). The problem is this call will attempt to download msys2 packages from the internet even though I already have the msys2 packages downloaded and saved to a cache directory in $DOWNLOADS/tools/msys2/msys64/var/cache/pacman/pkg. This is preventing me from completing my builds with vcpkg.

Proposed solution
I propose that within vcpkg_acquire_msys.cmake:~106, before the call to vcpkg_execute_required_process() (this invokes the package query on the internet), there is a check made to the msys2 pacman cache to determine if the packages already exist. If they do, then there is nothing to do here.

Describe alternatives you've considered
My current work around is to comment out the call to vcpkg_execute_required_process() as I already have the msys2 packages installed but this becomes a maintenance issue whenever I need to update my offline version of vcpkg.

@ASxa86 ASxa86 added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Aug 9, 2019
@ASxa86
Copy link
Author

ASxa86 commented Jun 4, 2020

It appears this is still an issue. Will there be any support for an offline version of vcpkg? I'm trying to update an air-gap network with the latest vcpkg but it doesn't seem like there is any support for building packages from cached libraries and tools. I'm still having to manually go in and modify vcpkg to skip downloading.

@emptyVoid
Copy link
Contributor

@ASxa86, can you, please, try the following -- replace -Sy flag with -S and check if the internet connection would still be an issue:

COMMAND ${PATH_TO_ROOT}/usr/bin/bash.exe --noprofile --norc -c "pacman -Sy --noconfirm --needed ${_am_PACKAGES}"

@ASxa86
Copy link
Author

ASxa86 commented Jun 9, 2020

@emptyVoid I gave it a shot on a machine with no access to internet and it failed immediately with the following error:
>vcpkg install ffmpeg:x64-windows

Command failed: D:/dev/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc -c "pacman -S --noconfirm --needed diffutils make"
...
Error code: The process cannot access the file because it is being used by another process
See logs for more informat:
...

Checking the msys-pacman-x64-windows-err.log:

error:failed retrieving file 'mingw32.db' from repo.msys2.org : Resolving timed out after 10000 milliseconds
...

@emptyVoid
Copy link
Contributor

Well that's a bit weird... I've just tried the same on my PC with Ethernet cable unplugged -- and the install succeeded.

@ASxa86
Copy link
Author

ASxa86 commented Jun 9, 2020

Yeah, I even confirmed I have all of the packages and the mingw32.db file on the machine. I wonder if my machine has some security restrictions applied that is preventing this from working.

@NancyLi1013
Copy link
Contributor

Hi @ASxa86 and @emptyVoid

Thanks for posting this issue and joining in the discussion of this issue.

Since it's similar to #11837. Let's track this issue and move our attention there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Projects
None yet
Development

No branches or pull requests

3 participants