Skip to content

Commit 1923746

Browse files
committed
chore: vcpkg
1 parent a4a6916 commit 1923746

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed

.github/workflows/_config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
OS_MATRIX='[
6464
"windows-latest"
6565
]'
66-
# To add more OS: "macos-latest", "windows-latest"
6766
6867
# Python versions to test
6968
# Comment out any version you want to skip during development
@@ -73,7 +72,7 @@ jobs:
7372
# To add more versions: "3.9", "3.10", "3.12"
7473
7574
# Primary OS and Python for single-runner jobs
76-
PRIMARY_OS="macos-latest"
75+
PRIMARY_OS="ubuntu-latest"
7776
PRIMARY_PYTHON="3.11"
7877
7978
# Enable/Disable Jobs

.github/workflows/_test.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,38 @@ jobs:
4949

5050
- name: Install system dependencies (Windows)
5151
if: runner.os == 'Windows'
52-
run: |
53-
choco install cmake -y
54-
choco install openssl -y
52+
run: choco install cmake ninja -y
5553

5654
- name: Setup MSVC (Windows)
5755
if: runner.os == 'Windows'
5856
uses: microsoft/setup-msbuild@v2
5957

60-
- name: Setup MSYS2 and install nghttp2 (Windows)
58+
- name: Setup vcpkg (Windows)
59+
if: runner.os == 'Windows'
60+
run: |
61+
git clone https://github.com/microsoft/vcpkg.git C:/vcpkg
62+
cd C:/vcpkg
63+
./bootstrap-vcpkg.bat
64+
echo "VCPKG_ROOT=C:/vcpkg" >> $GITHUB_ENV
65+
echo "C:/vcpkg" >> $GITHUB_PATH
66+
shell: bash
67+
68+
- name: Cache vcpkg packages (Windows)
6169
if: runner.os == 'Windows'
62-
uses: msys2/setup-msys2@v2
70+
uses: actions/cache@v4
6371
with:
64-
update: true
65-
install: >-
66-
mingw-w64-x86_64-nghttp2
67-
mingw-w64-x86_64-gcc
68-
mingw-w64-x86_64-cmake
69-
mingw-w64-x86_64-ninja
72+
path: |
73+
C:/vcpkg/installed
74+
C:/vcpkg/packages
75+
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}-v1
76+
restore-keys: |
77+
vcpkg-${{ runner.os }}-
78+
79+
- name: Install nghttp2 via vcpkg (Windows)
80+
if: runner.os == 'Windows'
81+
run: |
82+
vcpkg install nghttp2:x64-windows --clean-after-build
83+
shell: bash
7084

7185
- name: Cache vendor dependencies
7286
id: cache-vendor

scripts/setup_vendors.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,19 @@ echo "==> Setting up nghttp2..."
137137
if [ "$OS" = "Darwin" ] && command -v brew &> /dev/null && brew list libnghttp2 &> /dev/null; then
138138
echo "✓ Using Homebrew's libnghttp2"
139139
echo " Location: $(brew --prefix libnghttp2)"
140+
# On Windows with vcpkg, use vcpkg's nghttp2
141+
elif [ "$OS" = "Windows" ] && [ -n "$VCPKG_ROOT" ] && [ -d "$VCPKG_ROOT/installed/x64-windows" ]; then
142+
echo "✓ Using vcpkg's nghttp2"
143+
echo " Location: $VCPKG_ROOT/installed/x64-windows"
140144
# On Windows with MSYS2, use the MSYS2 package
141145
elif [ "$OS" = "Windows" ] && [ -d "/mingw64/include/nghttp2" ]; then
142146
echo "✓ Using MSYS2's nghttp2"
143147
echo " Location: /mingw64"
144-
# On Windows without MSYS2, skip
148+
# On Windows without vcpkg or MSYS2, skip
145149
elif [ "$OS" = "Windows" ]; then
146-
echo "⊘ nghttp2 on Windows requires MSYS2 or vcpkg"
147-
echo " Run: pacman -S mingw-w64-x86_64-nghttp2 (MSYS2)"
150+
echo "⊘ nghttp2 on Windows requires vcpkg or MSYS2"
151+
echo " vcpkg: vcpkg install nghttp2:x64-windows"
152+
echo " MSYS2: pacman -S mingw-w64-x86_64-nghttp2"
148153
else
149154
# Build from source on Linux or if Homebrew version not available
150155
if [ ! -d "nghttp2" ]; then
@@ -198,10 +203,12 @@ if [ "$OS" = "Linux" ]; then
198203
fi
199204
if [ "$OS" = "Darwin" ] && command -v brew &> /dev/null && brew list libnghttp2 &> /dev/null; then
200205
echo " ✓ nghttp2: $(brew --prefix libnghttp2) (Homebrew)"
206+
elif [ "$OS" = "Windows" ] && [ -n "$VCPKG_ROOT" ] && [ -d "$VCPKG_ROOT/installed/x64-windows" ]; then
207+
echo " ✓ nghttp2: $VCPKG_ROOT/installed/x64-windows (vcpkg)"
201208
elif [ "$OS" = "Windows" ] && [ -d "/mingw64/include/nghttp2" ]; then
202209
echo " ✓ nghttp2: /mingw64 (MSYS2)"
203210
elif [ "$OS" = "Windows" ]; then
204-
echo " ⊘ nghttp2: Install via MSYS2 (mingw-w64-x86_64-nghttp2)"
211+
echo " ⊘ nghttp2: Install via vcpkg or MSYS2"
205212
else
206213
echo " ✓ nghttp2: $VENDOR_DIR/nghttp2/install"
207214
fi

0 commit comments

Comments
 (0)