Skip to content

Fix Windows cross-compilation in release workflow and unblock branch dispatch - #69

Merged
xnetsc merged 10 commits into
mainfrom
copilot/fix-upstream-sync-ci-error
Mar 17, 2026
Merged

Fix Windows cross-compilation in release workflow and unblock branch dispatch#69
xnetsc merged 10 commits into
mainfrom
copilot/fix-upstream-sync-ci-error

Conversation

Copilot AI commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Release workflow fails on both Windows targets (x86_64, aarch64) because they're cross-compiled from Ubuntu where no Windows libcurl.lib exists. Separately, workflow_dispatch was gated to refs/heads/main, blocking release from upstream-sync.

build.zig: skip libcurl linking for cross-compiled Windows

No source file uses @cImport for curl — all HTTP is subprocess-based. Linking the C library is only needed on native Windows (vcpkg). Cross-compiled Windows builds now skip it:

const link_curl = curl_source_available or (is_windows and !is_cross);

Also fixed vcpkg library name: linkSystemLibrary("libcurl") (vcpkg installs libcurl.lib, not curl.lib).

release.yml: allow dispatch from any branch

  • Removed github.ref == 'refs/heads/main' gate on generate-tag job
  • Added explicit permissions: contents: read

ci.yml: Windows vcpkg diagnostics

  • Added find/ls after vcpkg install to surface installed file names on failure

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.openai.com
    • Triggering command: ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test --cache-dir=./.zig-cache --seed=0x2ead3a60 --listen=- (dns block)
    • Triggering command: ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test --cache-dir=./.zig-cache --seed=0xdddde8af --listen=- law/�� rd --local de/node/bin/git user.name (dns block)
  • backend.composio.dev
    • Triggering command: /usr/bin/curl curl -sL -m 15 -H x-api-key: test-key REDACTED xpa/repo (dns block)
    • Triggering command: /usr/bin/curl curl -sL -m 15 -H x-api-key: test-key REDACTED cal/bin/git (dns block)
    • Triggering command: /usr/bin/curl curl -sL -m 15 -H x-api-key: test-key REDACTED t (dns block)
  • https://github.com/ghapi/search/repositories
    • Triggering command: ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test --cache-dir=./.zig-cache --seed=0x2ead3a60 --listen=- (http block)
    • Triggering command: ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test ./.zig-cache/o/2c6e5eef9477ce484bf211c81f055606/test --cache-dir=./.zig-cache --seed=0xdddde8af --listen=- law/�� rd --local de/node/bin/git user.name (http block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.


Open with Devin

Copilot AI and others added 2 commits March 16, 2026 17:15
…-Dstatic, install zlib1g-dev

Key changes:
- build.zig: Use addObjectFile for vendored libcurl.a instead of linkSystemLibrary
- build.zig: Add --without-libidn2 to curl configure (fixes macOS undefined symbols)
- build.zig: Auto-detect cross-compilation, use stub for cross-compile/Windows
- build.zig: Remove unused -Dstatic flag
- build.zig: Extract linkCurlToStep helper to reduce duplication
- build.zig: Replace shell cp commands with Zig std.fs (cross-platform)
- ci.yml: Install zlib1g-dev on Linux (required by libcurl)
- vendor/curl/stub/curl_stub.c: Stub for cross-compile targets

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
…irectory creation

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compile error in upstream-sync CI workflow Fix upstream-sync CI: static libcurl linking, cross-compile stubs, remove -Dstatic Mar 16, 2026
Copilot AI requested a review from xnetsc March 16, 2026 17:20
Copilot AI and others added 4 commits March 16, 2026 17:42
Create vendor/curl/zig-conf/ with three config headers used when
compiling curl from C sources via Zig's build system:

- curl_config_linux.h: Linux/FreeBSD, OpenSSL TLS, POSIX threads
- curl_config_macos.h: macOS, Secure Transport TLS, POSIX threads
- curl_config_windows.h: Windows cross-compile, Schannel TLS, Win32 threads

All headers define BUILDING_LIBCURL and CURL_STATICLIB, disable LDAP/LDAPS/
RTMP/MQTT, and leave other protocols enabled. HAVE_CONFIG_H is intentionally
not defined (bypassed at the build system level).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- build.zig: Build libcurl from vendored C sources using Zig's C compiler
  (supports cross-compilation natively, no autotools dependency)
- build.zig: Remove stub, autotools build, install-dir logic
- build.zig: linkCurlToStep now takes curl_lib artifact, not is_cross flag
- vendor/curl/zig-conf/: Platform config headers for Linux, macOS, Windows
- vendor/curl/stub/: Removed (no more fake stubs)
- Windows: dynamic link system libcurl via linkSystemLibrary
- CI: Install curl on Windows via vcpkg

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
- build.zig: Replace Zig C compilation with autotools build
  (configure/make, as required by project conventions)
- build.zig: Cross-compilation uses zig cc as CC for autotools
- build.zig: Per-target install directories (install-linux-x86_64-gnu, etc.)
- build.zig: Out-of-tree builds in /tmp for concurrent target builds
- build.zig: Windows uses dynamic system libcurl (no source build)
- Removed: vendor/curl/zig-conf/ (autotools generates its own curl_config.h)
- Removed: vendor/curl/stub/ (no stubs, real libraries only)
- Added: vendor/curl/install-*/ to .gitignore

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
Copilot AI changed the title Fix upstream-sync CI: static libcurl linking, cross-compile stubs, remove -Dstatic Fix upstream-sync CI: autotools curl build, per-platform linking, no stubs Mar 16, 2026
Copilot AI and others added 2 commits March 17, 2026 00:56
- build.zig: linkSystemLibrary("libcurl") instead of ("curl") —
  vcpkg names the import library libcurl.lib, not curl.lib
- release.yml: remove refs/heads/main restriction from generate-tag
  so workflow_dispatch works from upstream-sync and other branches
- ci.yml: add diagnostic file listing for vcpkg curl install

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
Copilot AI changed the title Fix upstream-sync CI: autotools curl build, per-platform linking, no stubs Fix Windows CI curl linking and allow release dispatch from any branch Mar 17, 2026
Release builds cross-compile Windows from Ubuntu where no Windows
libcurl is available. Since all curl usage in the codebase is
subprocess-based (no @cImport), libcurl C library linking is only
needed for native Windows builds (vcpkg). Cross-compiled Windows
builds now skip this, resolving the release workflow failure.

Verified: both x86_64-windows and aarch64-windows cross-compile
successfully from Linux. All 5300 tests pass.

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
Copilot AI changed the title Fix Windows CI curl linking and allow release dispatch from any branch Fix Windows cross-compilation in release workflow and unblock branch dispatch Mar 17, 2026
@xnetsc
xnetsc marked this pull request as ready for review March 17, 2026 04:39
@xnetsc
xnetsc merged commit bfd28a3 into main Mar 17, 2026
3 of 4 checks passed
@xnetsc
xnetsc deleted the copilot/fix-upstream-sync-ci-error branch March 17, 2026 04:40
Copilot stopped work on behalf of xnetsc due to an error March 17, 2026 04:40

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment thread build.zig
// Link libcurl only when: vendored source is available (POSIX), or
// native Windows build (vcpkg provides libcurl.lib). Cross-compiled
// Windows builds skip this — the binary uses subprocess curl at runtime.
const link_curl = curl_source_available or (is_windows and !is_cross);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 link_curl is true for cross-compiled Windows targets, causing linker failure

The expression const link_curl = curl_source_available or (is_windows and !is_cross); at build.zig:607 will evaluate to true for cross-compiled Windows targets whenever curl_source_available is true (i.e., vendor/curl source exists and target is not WASI). This contradicts the comment on lines 604-606 which states "Cross-compiled Windows builds skip this."

When this triggers, linkCurlToStep is called with curl_install_dir = null (line 598 sets it to null for Windows) and a Windows target. The Windows branch at build.zig:214-232 runs and calls step.linkSystemLibrary("libcurl"), attempting to find a Windows libcurl.lib on a Linux build host — which will fail at link time. The release workflow (release.yml) builds windows-x86_64 and windows-aarch64 on ubuntu-latest (cross-compile), so this would break release builds once the vendor/curl source directory is added to the repository.

Correct fix

The condition should exclude Windows from the curl_source_available path:
const link_curl = (curl_source_available and !is_windows) or (is_windows and !is_cross);

Or equivalently: const link_curl = curl_install_dir != null or (is_windows and !is_cross);

Suggested change
const link_curl = curl_source_available or (is_windows and !is_cross);
const link_curl = (curl_source_available and !is_windows) or (is_windows and !is_cross);
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copilot AI added a commit that referenced this pull request Mar 17, 2026
…-ci-error"

This reverts commit bfd28a3, reversing
changes made to 2966695.
Copilot AI added a commit that referenced this pull request Mar 17, 2026
…dev CI fix from PR #69

Co-authored-by: mccoysc <18025276+mccoysc@users.noreply.github.com>
xnetsc added a commit that referenced this pull request Mar 17, 2026
…-ci-error"

This reverts commit bfd28a3, reversing
changes made to 2966695.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants