Skip to content

zeromq build failure because of port file with invalid hash (inconsistent) #23461

@thomas-t1

Description

@thomas-t1

Host Environment
-- Windows/Linux

The error seems to be related to content downloaded by vcpkg, where two slightly different versions of a .diff file are randomly downloaded, one of which the hash does not match the expected hash. I've included the two variants. The difference is only the number of digits in the index part of the .diff file.

It seems two versions of the file exist in some cache system used by vcpkg.

The url of the file referenced in the zeromq port is; https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4311.diff

It can even be observed in a browser when refreshing, that two different versions of the file are downloaded, it can take some time to see the two versions;

File with correct hash;

diff --git a/src/windows.hpp b/src/windows.hpp
index 24cce83d11..c6d625188d 100644
--- a/src/windows.hpp
+++ b/src/windows.hpp
@@ -90,7 +90,6 @@ static inline int poll (struct pollfd *pfd, unsigned long nfds, int timeout)
 #ifndef AI_NUMERICSERV
 #define AI_NUMERICSERV 0x0400
 #endif
-#endif
 
 //  In MSVC prior to v14, snprintf is not available
 //  The closest implementation is the _snprintf_s function
@@ -108,3 +107,5 @@ struct sockaddr_un
     char sun_path[108];        /* pathname */
 };
 #endif
+
+#endif

File with incorrect hash

diff --git a/src/windows.hpp b/src/windows.hpp
index 24cce83d1..c6d625188 100644
--- a/src/windows.hpp
+++ b/src/windows.hpp
@@ -90,7 +90,6 @@ static inline int poll (struct pollfd *pfd, unsigned long nfds, int timeout)
 #ifndef AI_NUMERICSERV
 #define AI_NUMERICSERV 0x0400
 #endif
-#endif
 
 //  In MSVC prior to v14, snprintf is not available
 //  The closest implementation is the _snprintf_s function
@@ -108,3 +107,5 @@ struct sockaddr_un
     char sun_path[108];        /* pathname */
 };
 #endif
+
+#endif

To Reproduce
Steps to reproduce the behavior:
./vcpkg install zeromq[draft,websockets-sha1]

Failure logs

Building package zeromq[core,draft,websockets-sha1]:arm-rpi...
-- [OVERLAY] Loading triplet configuration from: /home/vsts/work/1/s/SignalFlow/overlay-triplets/arm-rpi.cmake
-- Downloading https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4310.diff -> zeromq-libzmq-4310.diff...
-- Downloading https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4311.diff -> zeromq-libzmq-4311.diff...
[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] 139999292045120: popen(curl --fail -L https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4311.diff --create-dirs --output /usr/local/share/vcpkg/downloads/zeromq-libzmq-4311.diff.8014.part 2>&1)
[DEBUG] 139999292045120: cmd_execute_and_stream_data() returned 0 after   199461 us
Error: Failed to download from mirror set:
File does not have the expected hash:
             url : [ https://patch-diff.githubusercontent.com/raw/zeromq/libzmq/pull/4311.diff ]
       File path : [ /usr/local/share/vcpkg/downloads/zeromq-libzmq-4311.diff.8014.part ]
   Expected hash : [ 2b04e0ce4743d27070ea832c45e2d8fa0091c755757937cfa2a2bb43283ee38dc9f27343989e1ad8c45fda8a3cfaa012250b0c581e2f0407938cbb61b2a21e63 ]
     Actual hash : [ 08c3f000eb1582c94473d83c05b64f8934a14d18446faa10a396b8425eba108363cbb3382b7c95ffea8589ed5312244cd3cf76c3e49db20071dfae7c5d9e94ed ]

Additional context
Add any other context about the problem here, such as what you have already tried to resolve the issue.

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions