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

[pcre] build failure #21201

Closed
LowLevelMahn opened this issue Nov 5, 2021 · 11 comments · Fixed by #21225
Closed

[pcre] build failure #21201

LowLevelMahn opened this issue Nov 5, 2021 · 11 comments · Fixed by #21225
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@LowLevelMahn
Copy link

LowLevelMahn commented Nov 5, 2021

Host Environment
Win10 x64/VS2019 (latest version as of 5.11.2021)
vcpkg git

To Reproduce
Steps to reproduce the behavior:

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
.\vcpkg update
.\vcpkg integrate install
.\vcpkg install --triplet x64-windows pcre

vcpkg tries to use the old pcre download-server: https://ftp.pcre.org/pub/pcre/pcre-8.45.zip

i first thought it was language pack related, but it even don't work with english language pack installed

Failure logs

D:\temp\dosbox_dev\vcpkg>.\vcpkg install --triplet x64-windows pcre
Computing installation plan...
The following packages will be built and installed:
    pcre[core]:x64-windows -> 8.45
Detecting compiler hash for triplet x64-windows...
Restored 0 packages from C:\Users\Dennis\AppData\Local\vcpkg\archives in 100.5 us. Use --debug to see more details.
Starting package 1/1: pcre:x64-windows
Building package pcre[core]:x64-windows...
CMake Warning at scripts/cmake/vcpkg_download_distfile.cmake:169 (message):
  SILENT_EXIT has been deprecated as an argument to vcpkg_download_distfile
  -- remove the argument to resolve this warning
Call Stack (most recent call first):
  ports/pcre/portfile.cmake:12 (vcpkg_download_distfile)
  scripts/ports.cmake:142 (include)


-- Downloading https://ftp.pcre.org/pub/pcre/pcre-8.45.zip -> pcre-8.45.zip...
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' = off
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Downloading https://ftp.pcre.org/pub/pcre/pcre-8.45.zip
[DEBUG] Download failed -- retrying after 1000 ms.
[DEBUG] Download failed -- retrying after 2000 ms.
[DEBUG] Download failed -- retrying after 4000 ms.
[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(656)
Error: Failed to download from mirror set:
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002
https://ftp.pcre.org/pub/pcre/pcre-8.45.zip: WinHttpSendRequest() failed: 12002

[DEBUG] Exiting after %s (%d us)


CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:83 (message):

      Failed to download file with error: 1
      If you use 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. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)
         will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.
         Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,
         Change `http=address:port;https=address:port` to `address`, and fill the port number.

      3. You proxy's remote server is out of service.

      In future vcpkg releases, if you are using Windows, you no longer need to set
      HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy
      Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)
      and (https://github.com/microsoft/vcpkg-tool/pull/77)

      Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues

Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:291 (z_vcpkg_download_distfile_show_proxy_and_fail)
  ports/pcre/portfile.cmake:12 (vcpkg_download_distfile)
  scripts/ports.cmake:142 (include)


Error: Building package pcre:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `git pull` and `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  package: pcre[core]:x64-windows -> 8.45
  vcpkg version: 2021-11-02-af04ebf6274fd6f7a941bff4662b3955c64f6f42
  vcpkg-tool version: 8acb35e27 2021-11-05 (58 minutes ago)

Additionally, attach any relevant sections from the log files above.

D:\temp\dosbox_dev\vcpkg>

so the server is not reachable as state on pcre.org

Note that the former ftp.pcre.org FTP site is no longer available. You will need to update any scripts that download PCRE source code to download via HTTPS, Git, or Subversion from the new home on GitHub instead.

@NancyLi1013 NancyLi1013 self-assigned this Nov 5, 2021
@NancyLi1013 NancyLi1013 added the category:port-bug The issue is with a library, which is something the port should already support label Nov 5, 2021
@NancyLi1013
Copy link
Contributor

Hi @LowLevelMahn

Thanks for posting this issue.

Seems pcre server is broken now. https://ftp.pcre.org

@NancyLi1013
Copy link
Contributor

We might consider using https://sourceforge.net/projects/pcre/ to down source codes for pcre.

@LowLevelMahn
Copy link
Author

LowLevelMahn commented Nov 5, 2021

this patch seems to work

diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake
index f96e2a5bf..10fe42636 100644
--- a/ports/pcre/portfile.cmake
+++ b/ports/pcre/portfile.cmake
@@ -10,7 +10,7 @@ set(PATCHES
         export-cmake-targets.patch)
 
 vcpkg_download_distfile(ARCHIVE
-    URLS "https://ftp.pcre.org/pub/pcre/pcre-${PCRE_VERSION}.zip"
+    URLS "https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.zip"
     FILENAME "pcre-${PCRE_VERSION}.zip"
     SHA512 ${EXPECTED_SHA}
     SILENT_EXIT

@jerinphilip
Copy link

This is also an issue with the pcre2 port, which relies on the FTP server.

@dg0yt
Copy link
Contributor

dg0yt commented Nov 5, 2021

This is also an issue with the pcre2 port, which relies on the FTP server.

@jerinphilip For pcre2, there is #21193, merged 1 hour ago.

@QuantumFelidae
Copy link
Contributor

QuantumFelidae commented Nov 6, 2021

Using #21193, I am experiencing the following error with pcre2 hash mismatch:

Starting package 1/4: pcre2:x64-windows
Building package pcre2[core]:x64-windows...
-- Downloading https://github.com/PhilipHazel/pcre2/archive/pcre2-10.37.tar.gz -> PhilipHazel-pcre2-pcre2-10.37.tar.gz...
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' = off
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Downloading https://github.com/PhilipHazel/pcre2/archive/pcre2-10.37.tar.gz
Error: Failed to download from mirror set:
File does not have the expected hash:
             url : [ https://github.com/PhilipHazel/pcre2/archive/pcre2-10.37.tar.gz ]
       File path : [ C:\dev\vcpkg\vcpkg\downloads\PhilipHazel-pcre2-pcre2-10.37.tar.gz.2328.part ]
   Expected hash : [ f91760a8e0747f52211612fb0e134d685e224d16bd884eb574718d077a586b1fd7b6435d4e3b75c879b12e02b252467ecc28cdc4bc2903c783dacab089f99c99 ]
     Actual hash : [ f15357d8f5400739f26a32fe03a0759607fd7a282a1a8a2bb169b971a8a00330eff3ba465842c4668ad968e3fd1fff4dc7f0631d0af8416947070ff7cd056e6f ]


[DEBUG] D:\a\_work\1\s\src\vcpkg\base\downloads.cpp(626)
[DEBUG] Exiting after 2.952 s us (2946634 us)

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:84 (message):

      Failed to download file with error: 1
      If you use 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. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)
         will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.
         Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,
         Change `http=address:port;https=address:port` to `address`, and fill the port number.

      3. You proxy's remote server is out of service.

      In future vcpkg releases, if you are using Windows, you no longer need to set
      HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy
      Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)
      and (https://github.com/microsoft/vcpkg-tool/pull/77)

      Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues

Call Stack (most recent call first):
  scripts/cmake/vcpkg_download_distfile.cmake:292 (z_vcpkg_download_distfile_show_proxy_and_fail)
  scripts/cmake/vcpkg_from_github.cmake:173 (vcpkg_download_distfile)
  ports/pcre2/portfile.cmake:3 (vcpkg_from_github)
  scripts/ports.cmake:142 (include)


Error: Building package pcre2:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: pcre2:x64-windows
  Vcpkg version: 2021-09-10-2059ef11aa6067e6f59b0d939c5d17e3c5c47d3e

@facontidavide
Copy link

facontidavide commented Nov 6, 2021

Being affected by this (pcre2 is needed to build Qt5)

c72578 added a commit to c72578/vcpkg that referenced this issue Nov 6, 2021
The former ftp.pcre.org FTP site is no longer available [1].
- Use sourceforge only for download
- Fixes microsoft#21201
- Remove deprecated functions from portfile
  vcpkg_install_cmake -> vcpkg_cmake_install
  vcpkg_configure_cmake -> vcpkg_cmake_configure (remove PREFER_NINJA)
  vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup
- Add double quotes to files

[1] https://www.pcre.org/
@ssh4net
Copy link

ssh4net commented Nov 7, 2021

Is this possible to do something with such critical ports to not remove all other built and working ports?
as result of pcre2 build failure this ports also removed :(

  • openimageio[core,ffmpeg,freetype,gif,libraw,opencolorio,opencv,openjpeg,tools,webp]:x64-windows
  • qt5-base[core]:x64-windows

@irissam
Copy link

irissam commented Nov 7, 2021

I was able to work around this issue by downloading the pcre-{VERSION}.zip file directly and placing it in the {VCPKG_ROOT}/downloads folder. When vcpkg sees the file already exists, it won't attempt to download it from the broken link (assuming the expected SHA2 matches).

@Eddie-cz
Copy link

Eddie-cz commented Nov 7, 2021

Had to download .tar.gz distribution manually and change hash in port file, so vcpkg accepts it. Come on...

@Schroedingers-Cat
Copy link

An alternative workaround is to reset the vcpkg submodule (if that's possible in your workflow) to commit 97b9c60

Schroedingers-Cat added a commit to Schroedingers-Cat/clap-host that referenced this issue Nov 8, 2021
dan-shaw pushed a commit that referenced this issue Nov 9, 2021
The former ftp.pcre.org FTP site is no longer available [1].
- Use sourceforge only for download
- Fixes #21201
- Remove deprecated functions from portfile
  vcpkg_install_cmake -> vcpkg_cmake_install
  vcpkg_configure_cmake -> vcpkg_cmake_configure (remove PREFER_NINJA)
  vcpkg_fixup_cmake_targets -> vcpkg_cmake_config_fixup
- Add double quotes to files

[1] https://www.pcre.org/
sluicebox added a commit to sluicebox/scummvm that referenced this issue Nov 11, 2021
sluicebox added a commit to sluicebox/scummvm that referenced this issue Nov 11, 2021
sluicebox added a commit to sluicebox/scummvm that referenced this issue Nov 11, 2021
sev- pushed a commit to scummvm/scummvm that referenced this issue Nov 11, 2021
sluicebox added a commit to scummvm/scummvm that referenced this issue Nov 11, 2021
Frazew added a commit to Frazew/rrdtool-1.x that referenced this issue Nov 24, 2021
PCRE changed the download server, see microsoft/vcpkg#21201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants