Skip to content

Commit 6045cff

Browse files
committed
Prepare never-merge Windows public-consumer failure capture
1 parent b71192c commit 6045cff

4 files changed

Lines changed: 260 additions & 191 deletions

File tree

Lines changed: 34 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,15 @@
1-
name: v3 installed package validation
1+
name: v3 Windows consumer failure values (never-merge diagnostic)
22
on:
3-
push:
4-
branches: [v3, master]
5-
pull_request:
6-
branches: [v3, master]
73
workflow_dispatch:
4+
inputs:
5+
approved_sha:
6+
description: Exact reviewed diagnostic source commit; one dispatch only (1 Windows target / 60 seconds)
7+
required: true
8+
type: string
89
permissions:
910
contents: read
1011
jobs:
11-
linux:
12-
runs-on: ubuntu-24.04
13-
timeout-minutes: 90
14-
steps:
15-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
16-
- name: Prerequisites
17-
run: sudo apt-get update && sudo apt-get install -y clang autoconf automake libtool pkg-config python3 perl libcurl4-openssl-dev binutils python3-venv
18-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
19-
with:
20-
node-version: '24.15.0'
21-
- name: Selected client environment and executable Git provenance
22-
run: |
23-
mkdir -p "$RUNNER_TEMP/package-evidence"
24-
exec > >(tee "$RUNNER_TEMP/package-evidence/clients.log") 2>&1
25-
python3 -c 'import subprocess; subprocess.run(["git", "--version"], check=True)'
26-
python3 -m venv "$RUNNER_TEMP/package-evidence/clients"
27-
"$RUNNER_TEMP/package-evidence/clients/bin/python" -m pip install -r test/integ/http2-client-requirements.txt
28-
- name: Build selected prerequisites
29-
run: python3 scripts/prepare-v3-package-ci.py --output "$RUNNER_TEMP/package-evidence/prerequisites"
30-
- name: Bootstrap
31-
run: ./bootstrap
32-
- name: Installed matrix
33-
run: |
34-
prefix=()
35-
if ! python3 -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1",443)); s.close()'; then
36-
prefix=(sudo env "PATH=$PATH" GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.directory "GIT_CONFIG_VALUE_0=$PWD")
37-
fi
38-
"${prefix[@]}" python3 scripts/check-v3-installed-consumer.py --output "$RUNNER_TEMP/package-evidence/matrix" --provider-prefix "$RUNNER_TEMP/package-evidence/prerequisites/provider" --pkg-config-dir /usr/lib/x86_64-linux-gnu/pkgconfig --pkg-config-dir /usr/share/pkgconfig --client-python "$RUNNER_TEMP/package-evidence/clients/bin/python" --node node --compiler clang++ --cc clang --jobs 2
39-
- if: always()
40-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
41-
with:
42-
name: v3-package-linux-${{ github.sha }}
43-
path: ${{ runner.temp }}/package-evidence
44-
retention-days: 14
45-
if-no-files-found: error
46-
macos:
47-
runs-on: macos-15
48-
timeout-minutes: 90
49-
steps:
50-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
51-
- name: Prerequisites
52-
run: brew install autoconf automake libtool pkg-config python curl llvm make
53-
- name: Select complete C++20 compiler and runtime
54-
run: bash scripts/ci-macos-toolchain.sh
55-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
56-
with:
57-
node-version: '24.15.0'
58-
- name: Selected client environment and executable Git provenance
59-
run: |
60-
mkdir -p "$RUNNER_TEMP/package-evidence"
61-
exec > >(tee "$RUNNER_TEMP/package-evidence/clients.log") 2>&1
62-
python3 -c 'import subprocess; subprocess.run(["git", "--version"], check=True)'
63-
python3 -m venv "$RUNNER_TEMP/package-evidence/clients"
64-
"$RUNNER_TEMP/package-evidence/clients/bin/python" -m pip install -r test/integ/http2-client-requirements.txt
65-
- name: Build selected prerequisites
66-
run: python3 scripts/prepare-v3-package-ci.py --output "$RUNNER_TEMP/package-evidence/prerequisites"
67-
- name: Bootstrap
68-
run: ./bootstrap
69-
- name: Installed matrix
70-
run: |
71-
prefix=()
72-
if ! python3 -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1",443)); s.close()'; then
73-
prefix=(sudo env "PATH=$PATH" GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.directory "GIT_CONFIG_VALUE_0=$PWD")
74-
fi
75-
"${prefix[@]}" python3 scripts/check-v3-installed-consumer.py --output "$RUNNER_TEMP/package-evidence/matrix" --provider-prefix "$RUNNER_TEMP/package-evidence/prerequisites/provider" --pkg-config-dir "$(brew --prefix)/share/pkgconfig" --client-python "$RUNNER_TEMP/package-evidence/clients/bin/python" --node node --compiler "$V3_CXX" --cc "$V3_CC" --toolchain-prefix "$V3_PACKAGE_TOOLCHAIN" --make gmake --jobs 2
76-
- name: Make privileged proof readable by artifact upload
77-
if: always()
78-
run: |
79-
if [ -d "$RUNNER_TEMP/package-evidence" ]; then
80-
sudo chown -R "$(id -u):$(id -g)" "$RUNNER_TEMP/package-evidence"
81-
fi
82-
- if: always()
83-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
84-
with:
85-
name: v3-package-macos-${{ github.sha }}
86-
path: |
87-
${{ runner.temp }}/package-evidence
88-
${{ runner.temp }}/v3-toolchain
89-
retention-days: 14
90-
if-no-files-found: error
91-
mingw64:
12+
windows:
9213
runs-on: windows-2022
9314
timeout-minutes: 90
9415
defaults:
@@ -99,6 +20,17 @@ jobs:
9920
shell: pwsh
10021
run: git config --global core.autocrlf false
10122
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
- name: Verify the caller-approved diagnostic source and first attempt
27+
shell: pwsh
28+
env:
29+
APPROVED_SHA: ${{ inputs.approved_sha }}
30+
run: |
31+
if ($env:GITHUB_SHA -ne $env:APPROVED_SHA -or $env:GITHUB_RUN_ATTEMPT -ne '1' -or $env:GITHUB_REF -ne 'refs/heads/task/FEATURE-ci-windows-consumer-values') {
32+
throw 'Only the approved diagnostic branch commit and first workflow attempt are authorized'
33+
}
10234
- uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c
10335
with:
10436
msystem: MINGW64
@@ -108,120 +40,31 @@ jobs:
10840
autotools base-devel perl git
10941
mingw-w64-x86_64-clang mingw-w64-x86_64-gcc mingw-w64-x86_64-binutils
11042
mingw-w64-x86_64-python mingw-w64-x86_64-pkgconf mingw-w64-x86_64-libtool mingw-w64-x86_64-curl mingw-w64-x86_64-libsystre
111-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
112-
with:
113-
node-version: '24.15.0'
114-
- name: Selected client environment and executable Git provenance
43+
- name: Selected MSYS2 toolchain provenance
11544
run: |
11645
mkdir -p "$RUNNER_TEMP/package-evidence"
117-
exec > >(tee "$RUNNER_TEMP/package-evidence/clients.log") 2>&1
46+
pacman -Q > "$RUNNER_TEMP/package-evidence/msys2-packages.txt"
11847
export PATH="/c/Program Files/Git/cmd:$PATH"
119-
/mingw64/bin/python - <<'GIT_PROBE'
120-
import shutil, subprocess
121-
print('selected native Git:', shutil.which('git'), flush=True)
122-
for arguments in (['--version'], ['rev-parse', '--verify', 'HEAD^{commit}']):
123-
result = subprocess.run(['git'] + arguments, capture_output=True, text=True)
124-
print('git', *arguments, 'exit=' + str(result.returncode), flush=True)
125-
print(result.stdout[-2048:], end='', flush=True)
126-
print(result.stderr[-2048:], end='', flush=True)
127-
result.check_returncode()
128-
GIT_PROBE
129-
/mingw64/bin/python -m venv "$RUNNER_TEMP/package-evidence/clients"
130-
"$(cygpath -m "$RUNNER_TEMP/package-evidence/clients/bin/python.exe")" -m pip install -r test/integ/http2-client-requirements.txt
131-
- name: Build selected prerequisites
132-
run: |
133-
export PATH="/c/Program Files/Git/cmd:$PATH"
134-
/mingw64/bin/python scripts/prepare-v3-package-ci.py --output "$RUNNER_TEMP/package-evidence/prerequisites"
48+
/mingw64/bin/python -c 'import subprocess; subprocess.run(["git", "--version"], check=True)'
13549
- name: Bootstrap
13650
run: ./bootstrap
137-
- name: Installed matrix (native Python; IOCP and WSAPoll)
51+
- name: Build TLS-off library; run original shared external consumer case once
52+
env:
53+
CI_DIAGNOSTIC_APPROVED_SHA: ${{ inputs.approved_sha }}
13854
run: |
13955
export PATH="/c/Program Files/Git/cmd:$PATH"
140-
/mingw64/bin/python scripts/check-v3-installed-consumer.py --output "$RUNNER_TEMP/package-evidence/matrix" \
141-
--provider-prefix "$(cygpath -m "$RUNNER_TEMP/package-evidence/prerequisites/provider")" --toolchain-prefix "$(cygpath -m /mingw64)" \
142-
--client-python "$(cygpath -m "$RUNNER_TEMP/package-evidence/clients/bin/python.exe")" --node node --compiler clang++ --cc clang --jobs 2
56+
/mingw64/bin/python scripts/ci_native_consumer_values.py \
57+
--output "$(cygpath -m "$RUNNER_TEMP/package-evidence/native")" \
58+
--toolchain-prefix "$(cygpath -m /mingw64)" --compiler clang++ --cc clang
14359
- if: always()
14460
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
14561
with:
146-
name: v3-package-mingw64-${{ github.sha }}
147-
path: ${{ runner.temp }}/package-evidence
148-
retention-days: 14
149-
if-no-files-found: error
150-
freebsd:
151-
runs-on: ubuntu-24.04
152-
timeout-minutes: 180
153-
steps:
154-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
155-
- name: freebsd_instance
156-
uses: vmactions/freebsd-vm@c9f815bc7aa0d34c9fdd0619b034a32d6ca7b57e
157-
with:
158-
copyback: 'false'
159-
release: '14.3'
160-
mem: 8192
161-
cpu: 2
162-
prepare: pkg install -y bash autoconf automake libtool pkgconf python3 gmake curl binutils perl5 llvm19 git node24 cmake ninja
163-
run: |
164-
set -eu
165-
export RUNNER_TEMP=/tmp/v3-package-${{ github.run_id }}-${{ github.run_attempt }}
166-
mkdir -p "$RUNNER_TEMP/package-evidence"
167-
trap 'cp -R "$RUNNER_TEMP/package-evidence" ./package-evidence' EXIT
168-
# Guest root must trust only the host checkout, including in Python's Git children.
169-
export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.directory GIT_CONFIG_VALUE_0="$PWD"
170-
git_log="$RUNNER_TEMP/package-evidence/git-provenance.log"
171-
{
172-
printf 'checkout=%s\n' "$PWD" && command -v git && git --version &&
173-
git rev-parse --verify 'HEAD^{commit}'
174-
} > "$git_log" 2>&1 || { cat "$git_log" >&2; exit 1; }
175-
cat "$git_log"
176-
if [ "$(node --version)" != v24.15.0 ]; then
177-
mkdir -p "$RUNNER_TEMP/node-source"
178-
node_logs="$RUNNER_TEMP/package-evidence/node-source"
179-
mkdir -p "$node_logs"
180-
curl --fail --location https://nodejs.org/dist/v24.15.0/node-v24.15.0.tar.gz -o "$RUNNER_TEMP/node-source/node-v24.15.0.tar.gz"
181-
test "$(sha256 -q "$RUNNER_TEMP/node-source/node-v24.15.0.tar.gz")" = 729de494dd2872e5a3a6c32a1cd156a5413d4aca2772b2d873ee86bb5531bcd9
182-
tar -xzf "$RUNNER_TEMP/node-source/node-v24.15.0.tar.gz" -C "$RUNNER_TEMP/node-source"
183-
(
184-
cd "$RUNNER_TEMP/node-source/node-v24.15.0"
185-
{
186-
node_llvm_bin="$(llvm-config19 --bindir)"
187-
export CC="$node_llvm_bin/clang" CXX="$node_llvm_bin/clang++"
188-
printf 'CC=%s\nCXX=%s\n' "$CC" "$CXX"
189-
"$CC" --version
190-
"$CXX" --version
191-
} > "$node_logs/compiler.log" 2>&1
192-
./configure --prefix="$RUNNER_TEMP/node" > "$node_logs/configure.log" 2>&1
193-
gmake -j2 > "$node_logs/build.log" 2>&1
194-
gmake install >> "$node_logs/build.log" 2>&1
195-
)
196-
export PATH="$RUNNER_TEMP/node/bin:$PATH"
197-
fi
198-
test "$(node --version)" = v24.15.0
199-
python3 -c 'import subprocess; subprocess.run(["git", "--version"], check=True)'
200-
python3 scripts/ci-freebsd-toolchain.py --output "$RUNNER_TEMP/package-evidence/toolchain"
201-
. "$RUNNER_TEMP/package-evidence/toolchain/toolchain.env"
202-
python3 -m venv "$RUNNER_TEMP/package-evidence/clients"
203-
"$RUNNER_TEMP/package-evidence/clients/bin/python" -m pip install -r test/integ/http2-client-requirements.txt
204-
python3 scripts/prepare-v3-package-ci.py --output "$RUNNER_TEMP/package-evidence/prerequisites" --make gmake
205-
./bootstrap
206-
python3 scripts/check-v3-installed-consumer.py --output "$RUNNER_TEMP/package-evidence/matrix" \
207-
--provider-prefix "$RUNNER_TEMP/package-evidence/prerequisites/provider" \
208-
--client-python "$RUNNER_TEMP/package-evidence/clients/bin/python" --node node --pkg-config-dir /usr/local/share/pkgconfig --compiler "$V3_CXX" --cc "$V3_CC" --toolchain-prefix "$V3_PACKAGE_TOOLCHAIN" --make gmake --jobs 2
209-
- name: Recover FreeBSD evidence
210-
id: freebsd-evidence
211-
if: always()
212-
run: |
213-
printf 'path=package-evidence\n' >> "$GITHUB_OUTPUT"
214-
# SCP follows existing destination links from automatic rsync copyback.
215-
recovery_root="$(mktemp -d "$RUNNER_TEMP/freebsd-evidence.XXXXXX")"
216-
if scp -O -r "freebsd:/tmp/v3-package-${{ github.run_id }}-${{ github.run_attempt }}/package-evidence" "$recovery_root/"; then
217-
printf 'path=%s/package-evidence\n' "$recovery_root" >> "$GITHUB_OUTPUT"
218-
else
219-
exit "$?"
220-
fi
221-
- if: always()
222-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
223-
with:
224-
name: v3-package-freebsd-${{ github.sha }}
225-
path: ${{ steps.freebsd-evidence.outputs.path || 'package-evidence' }}
62+
name: native-consumer-values-windows-${{ github.sha }}
63+
path: |
64+
${{ runner.temp }}/package-evidence/**/*.json
65+
${{ runner.temp }}/package-evidence/**/*.log
66+
${{ runner.temp }}/package-evidence/**/*.bin
67+
${{ runner.temp }}/package-evidence/**/*.diff
68+
${{ runner.temp }}/package-evidence/msys2-packages.txt
22669
retention-days: 14
22770
if-no-files-found: error

‎examples/host_poll.hpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#endif
3636

3737
#include <algorithm>
38+
#include <cstdio>
3839
#include <cerrno>
3940
#include <chrono>
4041
#include <climits>
@@ -102,6 +103,14 @@ inline std::vector<srv::readiness_event> wait(
102103
const auto ready = ::WSAPoll(fds.data(), static_cast<ULONG>(fds.size()), timeout(deadline));
103104
if (ready < 0) {
104105
const int error = ::WSAGetLastError();
106+
std::fprintf(stderr, "POLL_FAILURE error=%d slots=%zu sockets=%zu wake=%d\n", error, fds.size(), snapshot.sockets.size(), snapshot.wake.has_value());
107+
for (std::size_t i = 0; i < std::min(fds.size(), std::size_t{8}); ++i) {
108+
int type = 0;
109+
int length = sizeof(type);
110+
const int queried = ::getsockopt(fds[i].fd, SOL_SOCKET, SO_TYPE, reinterpret_cast<char*>(&type), &length);
111+
const int query_error = queried ? ::WSAGetLastError() : 0;
112+
std::fprintf(stderr, "POLL_SLOT i=%zu wake=%d mask=%d seen=%d query=%d query_error=%d type=%d\n", i, snapshot.wake && i == snapshot.sockets.size(), fds[i].events, fds[i].revents, queried, query_error, type);
113+
}
105114
if (error != WSAEINTR) throw std::runtime_error("WSAPoll failed (WSA error " + std::to_string(error) + ")");
106115
}
107116
#else

0 commit comments

Comments
 (0)