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

[boost-cmake] Build error on x64-windows (download error on GH CI) #41199

Open
kobalicek opened this issue Sep 26, 2024 · 11 comments · May be fixed by microsoft/vcpkg-tool#1501
Open

[boost-cmake] Build error on x64-windows (download error on GH CI) #41199

kobalicek opened this issue Sep 26, 2024 · 11 comments · May be fixed by microsoft/vcpkg-tool#1501
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@kobalicek
Copy link
Contributor

kobalicek commented Sep 26, 2024

I'm having issues with installation of boost on a github provided runners (windows):

The most important line:

error: Missing boostorg-boost-boost-1.85.0.tar.gz and downloads are blocked by x-block-origin.

Full log:

Building boost-cmake:x64-windows@1.85.0#2...
-- Downloading https://github.com/boostorg/boost/archive/boost-1.85.0.tar.gz -> boostorg-boost-boost-1.85.0.tar.gz...
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Disabling metrics because vcpkg.disable-metrics exists
[DEBUG] Trying to load bundleconfig from D:\a\aimee\aimee\vcpkg\vcpkg-bundle.json
[DEBUG] Failed to open: D:\a\aimee\aimee\vcpkg\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
warning: Download failed -- retrying after 1000ms
warning: Download failed -- retrying after 2000ms
warning: Download failed -- retrying after 4000ms
error: Missing boostorg-boost-boost-1.85.0.tar.gz and downloads are blocked by x-block-origin.
error: https://github.com/boostorg/boost/archive/boost-1.85.0.tar.gz: WinHttpSendRequest failed with exit code 10106
error: https://github.com/boostorg/boost/archive/boost-1.85.0.tar.gz: WinHttpSendRequest failed with exit code 10106
error: https://github.com/boostorg/boost/archive/boost-1.85.0.tar.gz: WinHttpSendRequest failed with exit code 10106
error: https://github.com/boostorg/boost/archive/boost-1.85.0.tar.gz: WinHttpSendRequest failed with exit code 10106
[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(1030): 
[DEBUG] Time in subprocesses: 0us
[DEBUG] Time in parsing JSON: 8us
[DEBUG] Time in JSON reader: 0us
[DEBUG] Time in filesystem: 125us
[DEBUG] Time in loading ports: 0us
[DEBUG] Exiting after 7 s (7020463us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:32 (message):
      
      Failed to download file with error: 1
      If you are using a proxy, please check your proxy setting. Possible causes are:
      
      1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
         to `https://address:port`. This is not correct, because `https://` prefix
         claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
         , etc..) is an HTTP proxy. Try setting `http://address:port` to both
         HTTP_PROXY and HTTPS_PROXY instead.
      
      2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings
         set by your proxy software. See https://github.com/microsoft/vcpkg-tool/pull/77
         The value set by your proxy might be wrong, or have same `https://` prefix issue.
      
      3. Your proxy's remote server is out of service.
      
      If you've tried directly download the link, and believe this is not a temporary
      download server failure, please submit an issue at https://github.com/Microsoft/vcpkg/issues
      to report this upstream download server failure.
      

Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:270 (z_vcpkg_download_distfile_show_proxy_and_fail)
  scripts/cmake/vcpkg_from_github.cmake:106 (vcpkg_download_distfile)
  ports/boost-cmake/portfile.cmake:5 (vcpkg_from_github)
  scripts/ports.cmake:[192](https://github.com/miniohq/aimee/actions/runs/11056429097/job/30717951923#step:6:193) (include)
@theolivenbaum
Copy link

Duplicate of #41154, see the previous issue for the discussion

@kobalicek
Copy link
Contributor Author

@theolivenbaum Maybe it's duplicate, but I don't see any solution there.

I have highlighted the error that orchestrated the failure:

error: Missing boostorg-boost-boost-1.85.0.tar.gz and downloads are blocked by x-block-origin.

I have no idea what is blocking it, but I don't control github provided runners and all other tools work well (apt, git, etc...).

@theolivenbaum
Copy link

There's no solution yet - I'm just flagging because we started the discussion there, the issue needs to be reopened

@kobalicek
Copy link
Contributor Author

@theolivenbaum I see, yeah I agree!

@tmp64
Copy link

tmp64 commented Sep 27, 2024

I've found the cause and a workaround.

Workaround

In bash (or add to .profile and .bash_profile)

export SystemDrive="$SYSTEMDRIVE"
export SystemRoot="$SYSTEMROOT"
export windir="$WINDIR"

Cause

https://github.com/microsoft/vcpkg-tool/blob/81b4999bbb29966f8a180121504dbb1b7b335403/src/vcpkg/base/system.process.cpp#L660-L670

This code will remove all envvars that are not specified in the list above. But it uses case-sensitive compare. When running from bash in MSYS2, bash will convert all envvars into upper-case.

If SystemRoot is not set, WinHttpSendRequest will fail with error 10106.

@autoantwort
Copy link
Contributor

I have created a PR

@JonLiu1993 JonLiu1993 added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Sep 27, 2024
@bansan85
Copy link
Contributor

I would be happy to test it but it happened only on my CI. So vcpkg-tool must be updated in vcpkg-tool-metadata.txt. I will send you feedback at this time.

@HunterZ
Copy link

HunterZ commented Sep 27, 2024

Same issue is happening with zlib.

Edit: I should mention this is with vcpkg commit 76d1537 in vscode running under MSYS2 MinGW64.

My environment worked previously, but I did a git clean in my vcpkg directory and re-ran the bootstrap script to diagnose another issue.

[cmake] Installing 1/14 zlib:x64-mingw-dynamic@1.3.1...
[cmake] Building zlib:x64-mingw-dynamic@1.3.1...
[cmake] C:\msys64\opt\vcpkg\triplets\community\x64-mingw-dynamic.cmake: info: loaded community triplet from here. Community triplets are not built in the curated registry and are thus less likely to succeed.
[cmake] -- Downloading https://github.com/madler/zlib/archive/v1.3.1.tar.gz -> madler-zlib-v1.3.1.tar.gz...
[cmake] [DEBUG] To include the environment variables in debug output, pass --debug-env
[cmake] [DEBUG] Trying to load bundleconfig from C:\msys64\opt\vcpkg\vcpkg-bundle.json
[cmake] [DEBUG] Failed to open: C:\msys64\opt\vcpkg\vcpkg-bundle.json
[cmake] [DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[cmake] [DEBUG] Metrics enabled.
[cmake] [DEBUG] Feature flag 'binarycaching' unset
[cmake] [DEBUG] Feature flag 'compilertracking' unset
[cmake] [DEBUG] Feature flag 'registries' unset
[cmake] [DEBUG] Feature flag 'versions' unset
[cmake] [DEBUG] Feature flag 'dependencygraph' unset
[cmake] warning: Download failed -- retrying after 1000ms
[cmake] warning: Download failed -- retrying after 2000ms
[cmake] warning: Download failed -- retrying after 4000ms
[cmake] error: Missing madler-zlib-v1.3.1.tar.gz and downloads are blocked by x-block-origin.
[cmake] error: https://github.com/madler/zlib/archive/v1.3.1.tar.gz: WinHttpSendRequest failed with exit code 10106
[cmake] error: https://github.com/madler/zlib/archive/v1.3.1.tar.gz: WinHttpSendRequest failed with exit code 10106
[cmake] error: https://github.com/madler/zlib/archive/v1.3.1.tar.gz: WinHttpSendRequest failed with exit code 10106
[cmake] error: https://github.com/madler/zlib/archive/v1.3.1.tar.gz: WinHttpSendRequest failed with exit code 10106
[cmake] [DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(1030): 
[cmake] [DEBUG] Time in subprocesses: 0us
[cmake] [DEBUG] Time in parsing JSON: 7us
[cmake] [DEBUG] Time in JSON reader: 0us
[cmake] [DEBUG] Time in filesystem: 1102us
[cmake] [DEBUG] Time in loading ports: 0us
[cmake] [DEBUG] Exiting after 7 s (7027229us)
[cmake] 
[cmake] CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:32 (message):
[cmake]       
[cmake]       Failed to download file with error: 1
[cmake]       If you are using a proxy, please check your proxy setting. Possible causes are:
[cmake]       
[cmake]       1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable
[cmake]          to `https://address:port`. This is not correct, because `https://` prefix
[cmake]          claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr
[cmake]          , etc..) is an HTTP proxy. Try setting `http://address:port` to both
[cmake]          HTTP_PROXY and HTTPS_PROXY instead.
[cmake]       
[cmake]       2. If you are using Windows, vcpkg will automatically use your Windows IE Proxy Settings
[cmake]          set by your proxy software. See https://github.com/microsoft/vcpkg-tool/pull/77
[cmake]          The value set by your proxy might be wrong, or have same `https://` prefix issue.
[cmake]       
[cmake]       3. Your proxy's remote server is out of service.
[cmake]       
[cmake]       If you've tried directly download the link, and believe this is not a temporary
[cmake]       download server failure, please submit an issue at https://github.com/Microsoft/vcpkg/issues
[cmake]       to report this upstream download server failure.
[cmake]       
[cmake] 
[cmake] Call Stack (most recent call first):
[cmake]   scripts/cmake/vcpkg_download_distfile.cmake:270 (z_vcpkg_download_distfile_show_proxy_and_fail)
[cmake]   scripts/cmake/vcpkg_from_github.cmake:106 (vcpkg_download_distfile)
[cmake]   ports/zlib/portfile.cmake:2 (vcpkg_from_github)
[cmake]   scripts/ports.cmake:192 (include)
[cmake] 
[cmake] 
[cmake] error: building zlib:x64-mingw-dynamic failed with: BUILD_FAILED
[cmake] See https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
[cmake] Elapsed time to handle zlib:x64-mingw-dynamic: 7.1 s

@dg0yt
Copy link
Contributor

dg0yt commented Sep 27, 2024

Same issue is happening with zlib.

It is a bug in the vcpkg tool, affecting many ports.
And even included in the last release now 🤦

@BillyONeal
Copy link
Member

If SystemRoot is not set, WinHttpSendRequest will fail with error 10106.

🤯🤯🤯🤯🤯

greglucas added a commit to greglucas/pyproj that referenced this issue Sep 29, 2024
adang1345/delvewheel#54

Additionally, vcpkg has a download error when running with a bash shell
so we need to add some extra exports as a workaround.
microsoft/vcpkg#41199 (comment)
snowman2 pushed a commit to pyproj4/pyproj that referenced this issue Sep 29, 2024
adang1345/delvewheel#54

Additionally, vcpkg has a download error when running with a bash shell
so we need to add some extra exports as a workaround.
microsoft/vcpkg#41199 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants