Repository navigation
Conversation
vszakats
marked this pull request as draft
June 9, 2025 14:07
vszakats
marked this pull request as ready for review
June 9, 2025 17:19
vszakats
force-pushed
the
gha-vs-test
branch
3 times, most recently
from
June 10, 2025 12:20
2fa3899 to
cba09da
Compare
debug 1 debug 2 debug 3 debug 4 debug 5
brotli detected, but then: ``` libbrotlidec.a(decode.c.obj) : error LNK2019: unresolved external symbol ___chkstk_ms referenced in function BrotliDecoderDecompress [C:\a\curl\curl\bld\src\curl.vcxproj] libbrotlidec.a(decode.c.obj) : error LNK2019: unresolved external symbol __stack_chk_fail referenced in function SafeDecodeLiteralBlockSwitch [C:\a\curl\curl\bld\src\curl.vcxproj] libbrotlidec.a(huffman.c.obj) : error LNK2001: unresolved external symbol __stack_chk_fail [C:\a\curl\curl\bld\src\curl.vcxproj] libbrotlidec.a(decode.c.obj) : error LNK2019: unresolved external symbol __memcpy_chk referenced in function SkipMetadataBlock [C:\a\curl\curl\bld\src\curl.vcxproj] libbrotlidec.a(decode.c.obj) : error LNK2001: unresolved external symbol __stack_chk_guard [C:\a\curl\curl\bld\src\curl.vcxproj] libbrotlidec.a(huffman.c.obj) : error LNK2001: unresolved external symbol __stack_chk_guard [C:\a\curl\curl\bld\src\curl.vcxproj] C:\a\curl\curl\bld\src\Debug\curl.exe : fatal error LNK1120: 4 unresolved externals [C:\a\curl\curl\bld\src\curl.vcxproj] ``` https://github.com/curl/curl/actions/runs/15545116957/job/43764842374?pr=17561#step:9:48
This reverts commit 376a9db. Still doesn't work because zlib's zconf.h is target-dependent and MSYS2's copy is incompatible with MSVC. zlib being the dependency of everything, means it's a blocker for combining / reusing packages between compiler. What an unnecessary issue... Public headers should never be target dependent. ``` C:\msys64\ucrt64\include\zconf.h(484,14): error C1083: Cannot open include file: 'unistd.h': No such file or directory ``` zconf.h: ``` #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #if 1 /* was set to #if 1 by ./configure */ # define Z_HAVE_STDARG_H #endif ```
This reverts commit 5aa19e8.
Member
Author
|
Requires this week's windows runner (20250602.1), which installs ngtcp2 1.13.0. good: https://github.com/curl/curl/actions/runs/15561267632/job/43814310575 In the meantime can be committed without H3, and commit the rest next week |
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jun 10, 2025
vszakats
added a commit
that referenced
this pull request
Jun 14, 2025
Requires windows-runner 20250602.1 for ngtcp2 1.13.0. Follow-up to c129d0b #17561 Ref: #17561 (comment) Closes #17577
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
Follow-up to 17a6694 curl#17537 Cherry-picked from curl#17561
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
Cherry-picked from curl#17561 Closes curl#17574
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
…bssh2 Extend MSVC jobs with the option to use MSYS2 binary package as DLL dependencies. Allow to use them alone (without vcpkg) or combined with vcpkg packages. This saves the trouble of building these packages from source and cache them manually. This solution requires two tricks: - workaround for zlib which installs a target-specific `zconf.h` that's not portable between platforms and C compilers. - manual dependency configuration in CMake to ensure linking against the MSYS2 DLLs (and not it static libs). Static libs aren't portable to MSVC due to missing symbols `__chkstk_ms`, `_stack_chk_fail`, `_memcpy_chk`, `_stack_chk_guard`, and potentially other issues. CMake in MSVC mode, `linker.exe` and `pkg-config` pick the static libs by default. To pick `.dll.a` in favour of `.a`, these tools would have to be taught about this convention. An alternative is deleting static libs and see if `.dll.a` are picked-up automatically. Using MSYS2 packages adds an install step taking 15-45 seconds per job. It allowed to: - re-enable libpsl for all MSVC jobs. - convert the Intel 64-bit job to use MSYS2 without vcpkg, enabling brotli, zstd, OpenSSL 3.5.0, libssh2 (with OpenSSL cryprography) and nghttp2. Using the same technique it's possible to re-enable more features in MSVC builds, e.g. GnuTLS (also with H3), LibreSSL, mbedTLS, nghttp3, ngtcp2, libssh, c-ares, gsasl, and replace vcpkg zlib, for faster runs. What's missing compared to vcpkg is BoringSSL and wolfSSL (the MSYS2-supplied build doesn't fit curl's requirements IIRC). These could be built and cached manually. Also: - add workaround for zlib (classic) which uses a generated `zconf.h`, rendering the MSYS2 zlib header incompatible with MSVC. - set the correct `msystem` for arm64. - allow using MSVC without vcpkg. Follow-up to cd0ec47 curl#17089 Closes curl#17561
denandz
pushed a commit
to denandz/curl
that referenced
this pull request
Jun 21, 2025
Requires windows-runner 20250602.1 for ngtcp2 1.13.0. Follow-up to c129d0b curl#17561 Ref: curl#17561 (comment) Closes curl#17577
vszakats
added a commit
that referenced
this pull request
Nov 18, 2026
…ader zlib 1.3.1.2+ built with cmake sets `HAVE_UNISTD_H` to `1` in its public header when the zlib build environment detected `unistd.h`. This breaks dependents that rely on this macro, when the zlib-build-time value differs from the actual target build environment, as in curl CI, which uses the mingw-built package in an MSVC build. The issue surfaced when the MSYS2 package switched to using cmake while bumping from 1.3.2 to 1.4, and this propagated into the Windows runner, causing: ``` curl/lib/dict.c(58): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory ``` Ref: https://github.com/curl/curl/actions/runs/44311921832/job/134828014535?pr=24037#step:11:35 Refs: madler/zlib@3d6dc3c#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20aR39-R41 msys2/MINGW-packages@5cbcc05 msys2/MINGW-packages#33269 Bug: #24036 (comment) Follow-up to c129d0b #17561 Closes #24037
vszakats
added a commit
that referenced
this pull request
Nov 19, 2026
Drop zlib from the MSVC CI job as this is fragile, potentially unsafe, and requires hacks to make it build: - zlib includes or wants to include `unistd.h` from its public headers, also on Windows. (it's available in mingw-w64, not in MSVC) - defines non-zlib namespaced, commonly-used `HAVE_UNISTD_H` in its public headers. - above only happens if zlib was built with cmake (in 1.3.1.2+). - hardcodes build-time environment properties into its public header, meaning its headers cannot be safely used in a cross-build or in a different target env. - `HAVE_UNISTD_H` became unused in 1.4, but still set. It may break dependent 1st-party code that uses this symbol to communicate `unistd.h` presence. - the `z_off_t` type is not fixed-size, and depends on non-standard type `off_t`, that depends e.g. on `unistd.h`. - due to `z_off_t` depending on the above logic, the ABI may break in an affected API e.g. `gzseek*()`, `gztell*()`, `gzoffset*()`, when some of the consume-time logic differs from the build-time one. (curl not using these functions, but there may be more.) E.g. using an MSYS2/mingw UCRT x64-built zlib.dll in an equivalent MSVC build. - zlib-ng also includes `unistd.h`, and depends on `off_t`. It does not define `HAVE_UNISTD_H` though. Follow-up to 9584627 #24037 Follow-up to c129d0b #17561 Closes #24040
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend MSVC jobs with the option to use MSYS2 binary package as DLL
dependencies. Allow to use them alone (without vcpkg) or combined with
vcpkg packages. This saves the trouble of building these packages from
source and cache them manually.
This solution requires two tricks:
zconf.hthat'snot portable between platforms and C compilers.
the MSYS2 DLLs (and not it static libs). Static libs aren't portable
to MSVC due to missing symbols
__chkstk_ms,_stack_chk_fail,_memcpy_chk,_stack_chk_guard, and potentially other issues. CMakein MSVC mode,
linker.exeandpkg-configpick the static libs bydefault. To pick
.dll.ain favour of.a, these tools would haveto be taught about this convention. An alternative is deleting static
libs and see if
.dll.aare picked-up automatically.Using MSYS2 packages adds an install step taking 15-45 seconds per job.
It allowed to:
brotli, zstd, OpenSSL 3.5.0, libssh2 (with OpenSSL cryprography) and
nghttp2.
Using the same technique it's possible to re-enable more features
in MSVC builds, e.g. GnuTLS (also with H3), LibreSSL, mbedTLS, nghttp3,
ngtcp2, libssh, c-ares, gsasl, and replace vcpkg zlib, for faster runs.
What's missing compared to vcpkg is BoringSSL and wolfSSL
(the MSYS2-supplied build doesn't fit curl's requirements IIRC). These
could be built and cached manually.
Also:
zconf.h,rendering the MSYS2 zlib header incompatible with MSVC.
msystemfor arm64.Follow-up to cd0ec47 #17089
Using the same technique it should work in theory to re-enable more
features in MSVC builds, e.g. GnuTLS (also with H3), LibreSSL, OpenSSL,
mbedTLS, nghttp2, nghttp2, ngtcp2, libssh2 (with OpenSSL), libssh, zstd,
brotli, c-ares, gsasl, and replace vcpkg zlib, for faster runs. What's missing
is boringssl and wolfssl (the MSYS2-supplied version doesn't fit curl's
requirements IIRC), and these could be built and cached manually.
update 1: In practice, some mingw-generated code refers to
__chkstk_ms,_stack_chk_fail,_memcpy_chk,_stack_chk_guard, which isthen missing at link time. E.g. with
brotli,zstd. (static libs picked up)This is fixed by forcing to link against DLLs.
update 2: Next practical issue:
zconf.his a dynamically generatedheader that's different for vcpkg and MSYS2. When MSYS2 installs
it directly or via dependent, it will be picked first, and fail to compile.
zlib is a dependency of libssh2 for example, complicating its use.
update 3: It looks like zlib is the blocker to use MSYS2 packages
with MSVC. Till zlib fixes this, the only way to work it around is to
have a zlib specifically built for MSVC and put its header path
before MSYS2's. This is difficult, if possible at all with CMake.
update 4: patching
zconf.hseems to work as a workaround.TODO:
pkgconfwas confusing the detection of vcpkg packages, resulting in a cmake error.find_*detection via-DCMAKE_INCLUDE_PATH="${mingwroot}/include" -DCMAKE_LIBRARY_PATH="${mingwroot}/lib". Detection worked, but the build picked up the static libraries, which broke at link time due to missing symbols:__chkstk_ms,_stack_chk_fail,_memcpy_chk,_stack_chk_guard. What works is manually configuring these dependencies and pointing to the implib.