From 409bb4c5ee31044dda9361ebe5e83518226e43a0 Mon Sep 17 00:00:00 2001 From: anonymoussoft Date: Fri, 27 Mar 2026 23:38:34 +0800 Subject: [PATCH 1/2] fix: enable Windows build after POSIX socket porting - Update tim2tox submodule to include IrcClientManager Winsock2 porting and ws2_32 link dependency - Remove continue-on-error from Windows CI job now that the build compiles - Improve build_tim2tox.sh with ARM64 arch support, pkg-config PATH setup, and powershell PATH for vcpkg post-build steps Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build-packages.yml | 1 - third_party/tim2tox | 2 +- tool/ci/build_tim2tox.sh | 29 ++++++++++++++++++++++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 20ee4a3..69e6cfa 100644 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -115,7 +115,6 @@ jobs: windows: name: Windows runs-on: windows-2022 - continue-on-error: true # tim2tox C++ source requires POSIX porting for Windows steps: - name: Configure Git line endings diff --git a/third_party/tim2tox b/third_party/tim2tox index 6fbc047..2019450 160000 --- a/third_party/tim2tox +++ b/third_party/tim2tox @@ -1 +1 @@ -Subproject commit 6fbc047d5b50d8d458d36e6ed3e42eced6310907 +Subproject commit 2019450219f097b6bdcb2487bddf8ac7958a182b diff --git a/tool/ci/build_tim2tox.sh b/tool/ci/build_tim2tox.sh index 170fbbc..5aa4d37 100644 --- a/tool/ci/build_tim2tox.sh +++ b/tool/ci/build_tim2tox.sh @@ -8,6 +8,7 @@ source "$SCRIPT_DIR/common.sh" TARGET="" MODE="release" +WINDOWS_ARCH="${TIM2TOX_WINDOWS_ARCH:-x64}" # x64|arm64 while [[ $# -gt 0 ]]; do case "$1" in @@ -118,16 +119,36 @@ build_desktop_target() { local source_dir_win build_dir_win source_dir_win="$(ci_windows_path "$TIM2TOX_DIR")" build_dir_win="$(ci_windows_path "$build_dir")" + local vs_arch vcpkg_triplet + # bash 3.x on macOS doesn't support ${var,,} lowercase expansion. + local windows_arch_lc + windows_arch_lc="$(printf "%s" "${WINDOWS_ARCH}" | tr '[:upper:]' '[:lower:]')" + case "${windows_arch_lc}" in + arm64) + vs_arch="arm64" + vcpkg_triplet="arm64-windows" + ;; + x64|*) + vs_arch="x64" + vcpkg_triplet="x64-windows" + ;; + esac if [[ -n "${VCPKG_ROOT:-}" ]]; then local vcpkg_root_win toolchain_file vcpkg_root_win="$(ci_windows_path "$VCPKG_ROOT")" toolchain_file="${vcpkg_root_win}/scripts/buildsystems/vcpkg.cmake" + # Ensure tools invoked by CMake/MSBuild are discoverable. + # 1) pkg-config: used by FindPkgConfig during configure. + export PATH="$VCPKG_ROOT/installed/$vcpkg_triplet/tools/pkgconf:$PATH" + # 2) powershell.exe: used by vcpkg's applocal.ps1 post-build step. + # Git Bash (MSYS) typically exposes it under /c/WINDOWS/... + export PATH="/c/WINDOWS/System32/WindowsPowerShell/v1.0:$PATH" VCPKG_ROOT="$vcpkg_root_win" cmake -S "$source_dir_win" -B "$build_dir_win" \ - -G "Visual Studio 17 2022" -A x64 \ + -G "Visual Studio 17 2022" -A "$vs_arch" \ -DCMAKE_TOOLCHAIN_FILE="$toolchain_file" \ "${configure_args[@]}" else - cmake -S "$source_dir_win" -B "$build_dir_win" -G "Visual Studio 17 2022" -A x64 "${configure_args[@]}" + cmake -S "$source_dir_win" -B "$build_dir_win" -G "Visual Studio 17 2022" -A "$vs_arch" "${configure_args[@]}" fi ;; *) @@ -144,8 +165,8 @@ build_desktop_target() { ci_log "Captured native library: $built_lib" if [[ "$target" == "windows" && -n "${VCPKG_ROOT:-}" ]]; then - ci_copy_matching_file "$VCPKG_ROOT/installed/x64-windows" "libsodium.dll" "$OUTPUT_DIR" >/dev/null || \ - ci_warn "libsodium.dll not found under $VCPKG_ROOT/installed/x64-windows" + ci_copy_matching_file "$VCPKG_ROOT/installed/$vcpkg_triplet" "libsodium.dll" "$OUTPUT_DIR" >/dev/null || \ + ci_warn "libsodium.dll not found under $VCPKG_ROOT/installed/$vcpkg_triplet" fi if [[ "$target" == "linux" ]]; then From 52f59785ecfa9a9f32617e08f46e88b48bf6f233 Mon Sep 17 00:00:00 2001 From: anonymoussoft Date: Wed, 1 Apr 2026 12:15:48 +0800 Subject: [PATCH 2/2] fix: enable Windows build with full MSVC compatibility - Update tim2tox submodule with Windows/MSVC porting for all source files: IrcClientManager Winsock2, uuid/unistd.h guards, std::filesystem for S_ISREG, sqlite3 guards, Windows macro undef, chrono include - Remove continue-on-error from Windows CI job - Improve build_tim2tox.sh with ARM64 arch support and vcpkg PATH setup Co-Authored-By: Claude Opus 4.6 --- third_party/tim2tox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/tim2tox b/third_party/tim2tox index 2019450..c2953ea 160000 --- a/third_party/tim2tox +++ b/third_party/tim2tox @@ -1 +1 @@ -Subproject commit 2019450219f097b6bdcb2487bddf8ac7958a182b +Subproject commit c2953ea95111da876e169b96a44932890985ab1e