fizzpy 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.github/workflows/wheels.yml +75 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/CMakeLists.txt +15 -7
- {fizzpy-0.3.0 → fizzpy-0.4.0}/PKG-INFO +2 -2
- {fizzpy-0.3.0 → fizzpy-0.4.0}/README.md +1 -1
- {fizzpy-0.3.0 → fizzpy-0.4.0}/pyproject.toml +28 -7
- fizzpy-0.4.0/scripts/build_fizz_deps_native.py +179 -0
- fizzpy-0.4.0/scripts/repair_wheel_windows.py +47 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/uv.lock +1 -1
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.github/manylinux-deps.Dockerfile +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.github/workflows/check.yml +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.github/workflows/publish.yml +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.gitignore +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.vscode/c_cpp_properties.json +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/.vscode/settings.json +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/BUILDING.md +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/Justfile +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/LICENSE +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/_core.cpp +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/docs/pq-handshake.png +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/examples/pq_marker.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/fizzpy/__init__.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/fizzpy/_common.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/fizzpy/_core.pyi +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/fizzpy/_http.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/fizzpy/_transport.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/fizzpy/aio.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/pytest.ini +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/scripts/build_fizz.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/scripts/build_fizz_deps.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/_clienthello.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/conftest.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_basic.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_extensions.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_http.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_integration.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_keepalive.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_redirects.py +0 -0
- {fizzpy-0.3.0 → fizzpy-0.4.0}/tests/test_verify.py +0 -0
|
@@ -12,6 +12,12 @@ concurrency:
|
|
|
12
12
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
13
|
cancel-in-progress: true
|
|
14
14
|
|
|
15
|
+
env:
|
|
16
|
+
# macOS/Windows build fizz from source at this tag; keep it matching the tag the
|
|
17
|
+
# Linux deps image pins (scripts/build_fizz_deps.py) so every platform ships the
|
|
18
|
+
# same fizz. The Linux jobs read their pin from the image, not this var.
|
|
19
|
+
FIZZ_TAG: v2026.06.08.00
|
|
20
|
+
|
|
15
21
|
jobs:
|
|
16
22
|
# The folly+fizz+liboqs tree is baked into a GHCR image tagged by the hash of
|
|
17
23
|
# its build inputs. This job rebuilds it only when that hash has no image yet
|
|
@@ -116,3 +122,72 @@ jobs:
|
|
|
116
122
|
name: wheels-${{ matrix.python }}
|
|
117
123
|
path: wheelhouse/*.whl
|
|
118
124
|
if-no-files-found: error
|
|
125
|
+
|
|
126
|
+
build_wheels_native:
|
|
127
|
+
# macOS and Windows have no prebuilt deps image, so each runner builds the
|
|
128
|
+
# folly+fizz+liboqs tree from source (cached). Skipped on PRs — PR feedback
|
|
129
|
+
# stays on the fast Linux path; these run on master, tags, and dispatch.
|
|
130
|
+
name: Wheel ${{ matrix.os }}
|
|
131
|
+
if: github.event_name != 'pull_request'
|
|
132
|
+
runs-on: ${{ matrix.os }}
|
|
133
|
+
timeout-minutes: 120
|
|
134
|
+
strategy:
|
|
135
|
+
fail-fast: false
|
|
136
|
+
matrix:
|
|
137
|
+
# macos-15-intel = x86_64, macos-14 = arm64 (native per runner). windows-2022
|
|
138
|
+
# ships VS 2022 (vc143); windows-latest moved to VS 2026, whose toolset Boost
|
|
139
|
+
# 1.83's bootstrap doesn't recognize. Interpreters (cp310-cp314) come from
|
|
140
|
+
# [tool.cibuildwheel] build in pyproject.toml.
|
|
141
|
+
os: [macos-15-intel, macos-14, windows-2022]
|
|
142
|
+
steps:
|
|
143
|
+
- uses: actions/checkout@v6
|
|
144
|
+
|
|
145
|
+
# before-all runs on the host on macOS/Windows (no container), so these are
|
|
146
|
+
# inherited by the deps build and the _core configure without CIBW_ENVIRONMENT.
|
|
147
|
+
- name: Resolve deps paths (unix)
|
|
148
|
+
if: runner.os != 'Windows'
|
|
149
|
+
shell: bash
|
|
150
|
+
run: |
|
|
151
|
+
{
|
|
152
|
+
echo "GETDEPS_SCRATCH=$HOME/fizz-deps"
|
|
153
|
+
echo "FIZZPY_BUILD_INFO=$HOME/fizzpy-build"
|
|
154
|
+
echo "FIZZ_SRC=$HOME/fizz-src"
|
|
155
|
+
# Match the runner's macOS major: getdeps pulls Homebrew libs (openssl,
|
|
156
|
+
# sodium, …) built for this OS, so the wheel can't claim an older target
|
|
157
|
+
# than they carry. Also satisfies folly's C++17 (>= 10.13) requirement.
|
|
158
|
+
echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d. -f1).0"
|
|
159
|
+
} >> "$GITHUB_ENV"
|
|
160
|
+
|
|
161
|
+
- name: Resolve deps paths and locate MSVC (windows)
|
|
162
|
+
if: runner.os == 'Windows'
|
|
163
|
+
shell: bash
|
|
164
|
+
run: |
|
|
165
|
+
vswhere="/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
|
|
166
|
+
install=$("$vswhere" -latest -property installationPath)
|
|
167
|
+
{
|
|
168
|
+
echo "GETDEPS_SCRATCH=C:/fizz-deps"
|
|
169
|
+
echo "FIZZPY_BUILD_INFO=C:/fizzpy-build"
|
|
170
|
+
echo "FIZZ_SRC=C:/fizz-src"
|
|
171
|
+
# getdeps only globs for VS 2022; point it at whatever VS is installed.
|
|
172
|
+
echo "VCVARS_PATH=$install\\VC\\Auxiliary\\Build\\vcvarsall.bat"
|
|
173
|
+
} >> "$GITHUB_ENV"
|
|
174
|
+
|
|
175
|
+
# The getdeps tree is the ~40-min cost; key it on the build script + tag so a
|
|
176
|
+
# warm cache turns before-all into a near no-op.
|
|
177
|
+
- name: Cache deps tree
|
|
178
|
+
uses: actions/cache@v4
|
|
179
|
+
with:
|
|
180
|
+
path: |
|
|
181
|
+
${{ env.GETDEPS_SCRATCH }}
|
|
182
|
+
${{ env.FIZZPY_BUILD_INFO }}
|
|
183
|
+
${{ env.FIZZ_SRC }}
|
|
184
|
+
key: deps-${{ matrix.os }}-${{ env.FIZZ_TAG }}-${{ env.MACOSX_DEPLOYMENT_TARGET }}-${{ hashFiles('scripts/build_fizz_deps_native.py') }}
|
|
185
|
+
|
|
186
|
+
- name: Build wheels
|
|
187
|
+
uses: pypa/cibuildwheel@v4.1.0
|
|
188
|
+
|
|
189
|
+
- uses: actions/upload-artifact@v7
|
|
190
|
+
with:
|
|
191
|
+
name: wheels-${{ matrix.os }}
|
|
192
|
+
path: wheelhouse/*.whl
|
|
193
|
+
if-no-files-found: error
|
|
@@ -7,15 +7,15 @@ project(
|
|
|
7
7
|
VERSION ${SKBUILD_PROJECT_VERSION}
|
|
8
8
|
LANGUAGES CXX)
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
# fizz + liboqs source build
|
|
12
|
-
|
|
13
|
-
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
10
|
+
# Wheels target Linux, macOS, and Windows. Other platforms stop here before the
|
|
11
|
+
# (~40 min) folly + fizz + liboqs source build an sdist install would attempt.
|
|
12
|
+
if(NOT CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$")
|
|
14
13
|
message(
|
|
15
14
|
FATAL_ERROR
|
|
16
|
-
"fizzpy publishes prebuilt Linux
|
|
17
|
-
"is not
|
|
18
|
-
"BUILDING.md
|
|
15
|
+
"fizzpy publishes prebuilt wheels for Linux, macOS, and Windows; "
|
|
16
|
+
"${CMAKE_SYSTEM_NAME} is not supported. Building from source needs the Fizz "
|
|
17
|
+
"toolchain — see BUILDING.md "
|
|
18
|
+
"(https://github.com/Xevion/fizz-py/blob/master/BUILDING.md).")
|
|
19
19
|
endif()
|
|
20
20
|
|
|
21
21
|
# Fizz's CMake config pulls in its bundled FindSodium.cmake. Homebrew installs
|
|
@@ -85,4 +85,12 @@ if(TARGET Folly::folly_io_async_scoped_event_base_thread)
|
|
|
85
85
|
target_link_libraries(_core PRIVATE Folly::folly_io_async_scoped_event_base_thread)
|
|
86
86
|
endif()
|
|
87
87
|
|
|
88
|
+
# Static deps need Windows system libs their getdeps configs don't propagate as
|
|
89
|
+
# interface links: bcrypt (RNG: libevent, liboqs), crypt32 (OpenSSL cert store),
|
|
90
|
+
# ws2_32 (sockets), iphlpapi (folly GetAdaptersAddresses), advapi32 (OpenSSL/
|
|
91
|
+
# libevent registry + RNG fallback). Link them on the consumer.
|
|
92
|
+
if(WIN32)
|
|
93
|
+
target_link_libraries(_core PRIVATE bcrypt crypt32 ws2_32 iphlpapi advapi32)
|
|
94
|
+
endif()
|
|
95
|
+
|
|
88
96
|
install(TARGETS _core LIBRARY DESTINATION fizzpy)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fizzpy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: A low-level TLS 1.3 client toolkit for Python, built on Facebook's Fizz
|
|
5
5
|
Author-Email: Xevion <xevion@xevion.dev>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -38,7 +38,7 @@ back to classical X25519 against those that don't.
|
|
|
38
38
|
> TLS 1.3 only, HTTP/1.1 only. This is a focused toolkit / learning project,
|
|
39
39
|
> not a drop-in `requests` replacement. See [Status](#status).
|
|
40
40
|
|
|
41
|
-

|
|
41
|
+

|
|
42
42
|
|
|
43
43
|
*A fizzpy request captured in Wireshark: the TLS 1.3 ClientHello offers the
|
|
44
44
|
post-quantum `X25519MLKEM768` group (`0x11ec`), and a custom marker extension
|
|
@@ -11,7 +11,7 @@ back to classical X25519 against those that don't.
|
|
|
11
11
|
> TLS 1.3 only, HTTP/1.1 only. This is a focused toolkit / learning project,
|
|
12
12
|
> not a drop-in `requests` replacement. See [Status](#status).
|
|
13
13
|
|
|
14
|
-

|
|
14
|
+

|
|
15
15
|
|
|
16
16
|
*A fizzpy request captured in Wireshark: the TLS 1.3 ClientHello offers the
|
|
17
17
|
post-quantum `X25519MLKEM768` group (`0x11ec`), and a custom marker extension
|
|
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fizzpy"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
description = "A low-level TLS 1.3 client toolkit for Python, built on Facebook's Fizz"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -108,6 +108,9 @@ wheel.packages = ["fizzpy"]
|
|
|
108
108
|
build = "cp310-* cp311-* cp312-* cp313-* cp314-*"
|
|
109
109
|
skip = "*-musllinux*"
|
|
110
110
|
build-frontend = { name = "pip", args = ["--no-build-isolation"] }
|
|
111
|
+
# --no-build-isolation skips auto-installing the build backend, so install it here.
|
|
112
|
+
# Identical on every platform, so it lives at the top level.
|
|
113
|
+
before-build = "pip install scikit-build-core pybind11 pybind11-stubgen"
|
|
111
114
|
|
|
112
115
|
[tool.cibuildwheel.linux]
|
|
113
116
|
archs = ["x86_64"]
|
|
@@ -115,13 +118,31 @@ archs = ["x86_64"]
|
|
|
115
118
|
# before-all — each build just compiles _core against the baked prefix CMake
|
|
116
119
|
# reads from $FIZZPY_BUILD_INFO. CI sets the image ref (content-addressed, owner
|
|
117
120
|
# resolved at runtime) via CIBW_MANYLINUX_X86_64_IMAGE in wheels.yml.
|
|
118
|
-
|
|
119
|
-
#
|
|
120
|
-
# dependency
|
|
121
|
-
#
|
|
122
|
-
# runs in the
|
|
123
|
-
# table
|
|
121
|
+
# The getdeps tree builds glog/gflags (and on Windows openssl/libsodium) as shared
|
|
122
|
+
# libs in install dirs outside the loader's default search path, so _core has a
|
|
123
|
+
# runtime dependency the default repair command can't resolve. Each platform below
|
|
124
|
+
# points its repair tool at those dirs. auditwheel searches only LD_LIBRARY_PATH;
|
|
125
|
+
# the glob+pipe is fine here (repair runs in the real shell, unlike the
|
|
126
|
+
# `environment` table's restricted evaluator).
|
|
124
127
|
repair-wheel-command = "LD_LIBRARY_PATH=\"$(echo /opt/fizz-deps/installed/*/lib /opt/fizz-deps/installed/*/lib64 | tr ' ' ':'):$LD_LIBRARY_PATH\" auditwheel repair -w {dest_dir} {wheel}"
|
|
125
128
|
|
|
126
129
|
[tool.cibuildwheel.linux.environment]
|
|
127
130
|
FIZZPY_BUILD_INFO = "/opt/fizzpy-build"
|
|
131
|
+
|
|
132
|
+
# macOS/Windows have no prebuilt deps image, so before-all builds the folly+fizz+
|
|
133
|
+
# liboqs tree on the runner. wheels.yml supplies FIZZ_SRC/GETDEPS_SCRATCH/
|
|
134
|
+
# FIZZPY_BUILD_INFO per-runner and caches the scratch dir.
|
|
135
|
+
[tool.cibuildwheel.macos]
|
|
136
|
+
before-all = "python3 scripts/build_fizz_deps_native.py"
|
|
137
|
+
# delocate reads only DYLD_*. Set it inline: macOS SIP strips DYLD_* from the
|
|
138
|
+
# system shell's env, but not vars that shell sets for its own children.
|
|
139
|
+
repair-wheel-command = "DYLD_LIBRARY_PATH=\"$(echo $GETDEPS_SCRATCH/installed/*/lib | tr ' ' ':')\" delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
|
|
140
|
+
|
|
141
|
+
[tool.cibuildwheel.windows]
|
|
142
|
+
# 64-bit only: the getdeps tree is built x86_64, so the default win32 (32-bit)
|
|
143
|
+
# build can't link it. delvewheel vendors the runtime DLLs into the wheel.
|
|
144
|
+
archs = ["AMD64"]
|
|
145
|
+
before-all = "python scripts/build_fizz_deps_native.py"
|
|
146
|
+
# delvewheel searches only PATH; --add-path feeds it the getdeps dirs. Their names
|
|
147
|
+
# are content-addressed (hashed), so a shim globs them rather than a fixed path.
|
|
148
|
+
repair-wheel-command = "python scripts/repair_wheel_windows.py {dest_dir} {wheel}"
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""cibuildwheel `before-all` for macOS and Windows.
|
|
3
|
+
|
|
4
|
+
The Linux path bakes the folly + fizz + liboqs tree into a manylinux image; there
|
|
5
|
+
is no such image for macOS/Windows, so the deps are built on the runner here. The
|
|
6
|
+
getdeps scratch dir is restored from actions/cache between runs (keyed by this
|
|
7
|
+
file's hash), so a warm cache makes getdeps a near-instant no-op rather than a
|
|
8
|
+
~40-minute rebuild.
|
|
9
|
+
|
|
10
|
+
Outputs (read by CMakeLists.txt at configure time, same as the Linux path):
|
|
11
|
+
$FIZZPY_BUILD_INFO/prefix.txt semicolon-joined CMAKE_PREFIX_PATH
|
|
12
|
+
$FIZZPY_BUILD_INFO/module_dir.txt dir holding fizz's bundled find-modules
|
|
13
|
+
|
|
14
|
+
Env (set by the workflow so the cache and CMake agree on locations):
|
|
15
|
+
FIZZ_TAG, FIZZ_SRC, GETDEPS_SCRATCH, FIZZPY_BUILD_INFO
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import json
|
|
21
|
+
import os
|
|
22
|
+
import platform
|
|
23
|
+
import shutil
|
|
24
|
+
import subprocess
|
|
25
|
+
import sys
|
|
26
|
+
from pathlib import Path
|
|
27
|
+
|
|
28
|
+
# Pin fizz to a release whose getdeps manifests pin a matching folly. liboqs is
|
|
29
|
+
# pinned by fizz's own manifest, so post-quantum support travels with the tag.
|
|
30
|
+
FIZZ_TAG = os.environ.get("FIZZ_TAG", "v2026.06.08.00")
|
|
31
|
+
FIZZ_SRC = Path(os.environ["FIZZ_SRC"])
|
|
32
|
+
SCRATCH = os.environ["GETDEPS_SCRATCH"]
|
|
33
|
+
OUT = Path(os.environ["FIZZPY_BUILD_INFO"])
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def cmake_defines() -> str:
|
|
37
|
+
# Static-PIC so _core links the tree in wholesale into one self-contained
|
|
38
|
+
# module, matching the Linux build. PIC is a no-op on Windows but harmless.
|
|
39
|
+
defines = {"CMAKE_POSITION_INDEPENDENT_CODE": "ON"}
|
|
40
|
+
if platform.system() == "Darwin":
|
|
41
|
+
# folly's C++17 (aligned operator new, std::uncaught_exceptions) needs
|
|
42
|
+
# >= 10.13; without this getdeps defaults to 10.9 and folly fails to
|
|
43
|
+
# compile. Match the wheel's MACOSX_DEPLOYMENT_TARGET so ABI agrees.
|
|
44
|
+
defines["CMAKE_OSX_DEPLOYMENT_TARGET"] = os.environ.get(
|
|
45
|
+
"MACOSX_DEPLOYMENT_TARGET", "11.0"
|
|
46
|
+
)
|
|
47
|
+
return json.dumps(defines)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def run(cmd: list[str], **kwargs: object) -> None:
|
|
51
|
+
print("+", " ".join(map(str, cmd)), flush=True)
|
|
52
|
+
subprocess.run(cmd, check=True, **kwargs) # type: ignore[arg-type]
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def patch_folly_sse2() -> None:
|
|
56
|
+
"""Re-enable SSE2 on folly's scalar crypto-math TU (macOS x86_64 only).
|
|
57
|
+
|
|
58
|
+
folly builds MathOperation_Simple.cpp with -mno-sse2, but the macOS 15 SDK's
|
|
59
|
+
<math.h> declares _Float16 unconditionally and Apple Clang can't codegen it
|
|
60
|
+
without SSE2 ("_Float16 is not supported on this target"). Every x86_64 CPU has
|
|
61
|
+
SSE2, so flipping the flag is safe; only the _simple target carries -mno-sse2.
|
|
62
|
+
A getdeps CMAKE_CXX_FLAGS=-msse2 can't fix it: folly's per-target flag is
|
|
63
|
+
appended after global flags and Clang takes the last -m, so we edit the source.
|
|
64
|
+
"""
|
|
65
|
+
if platform.system() != "Darwin" or platform.machine() != "x86_64":
|
|
66
|
+
return
|
|
67
|
+
pattern = "*folly*/folly/crypto/detail/CMakeLists.txt"
|
|
68
|
+
found = list(Path(SCRATCH, "repos").glob(pattern))
|
|
69
|
+
if not found:
|
|
70
|
+
print("warning: folly crypto/detail CMakeLists not found; skipping SSE2 patch")
|
|
71
|
+
return
|
|
72
|
+
for cml in found:
|
|
73
|
+
text = cml.read_text()
|
|
74
|
+
patched = text.replace("-mno-sse2", "-msse2")
|
|
75
|
+
if patched != text:
|
|
76
|
+
cml.write_text(patched)
|
|
77
|
+
print(f"patched {cml}: -mno-sse2 -> -msse2 (macOS 15 SDK _Float16)")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def main() -> None:
|
|
81
|
+
getdeps = str(FIZZ_SRC / "build" / "fbcode_builder" / "getdeps.py")
|
|
82
|
+
common = [
|
|
83
|
+
"--extra-cmake-defines",
|
|
84
|
+
cmake_defines(),
|
|
85
|
+
f"--src-dir={FIZZ_SRC}",
|
|
86
|
+
"--allow-system-packages",
|
|
87
|
+
]
|
|
88
|
+
# getdeps only autodetects Visual Studio 2022; newer VS on the runner needs an
|
|
89
|
+
# explicit pointer to vcvarsall.bat (located via vswhere in the workflow).
|
|
90
|
+
vcvars = os.environ.get("VCVARS_PATH")
|
|
91
|
+
if vcvars:
|
|
92
|
+
common += ["--vcvars-path", vcvars]
|
|
93
|
+
|
|
94
|
+
# A cache restore brings back the clone; only fetch when it's genuinely absent.
|
|
95
|
+
if not (FIZZ_SRC / ".git").exists():
|
|
96
|
+
if FIZZ_SRC.exists():
|
|
97
|
+
shutil.rmtree(FIZZ_SRC)
|
|
98
|
+
run(
|
|
99
|
+
[
|
|
100
|
+
"git",
|
|
101
|
+
"clone",
|
|
102
|
+
"--depth",
|
|
103
|
+
"1",
|
|
104
|
+
"--branch",
|
|
105
|
+
FIZZ_TAG,
|
|
106
|
+
"https://github.com/facebookincubator/fizz",
|
|
107
|
+
str(FIZZ_SRC),
|
|
108
|
+
]
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# Fetch all sources first so folly can be patched before it compiles.
|
|
112
|
+
# --recursive is required: a bare `fetch fizz` clones only fizz, not its
|
|
113
|
+
# dependencies. build below skips re-fetching repos already at the pinned
|
|
114
|
+
# rev, so the patched working tree survives.
|
|
115
|
+
run(
|
|
116
|
+
[
|
|
117
|
+
sys.executable,
|
|
118
|
+
getdeps,
|
|
119
|
+
"--scratch-path",
|
|
120
|
+
SCRATCH,
|
|
121
|
+
"fetch",
|
|
122
|
+
"--recursive",
|
|
123
|
+
"fizz",
|
|
124
|
+
*common,
|
|
125
|
+
]
|
|
126
|
+
)
|
|
127
|
+
patch_folly_sse2()
|
|
128
|
+
|
|
129
|
+
# getdeps skips deps already present in the (cached) scratch, so this is cheap
|
|
130
|
+
# on a warm cache and does the full build on a cold one.
|
|
131
|
+
run(
|
|
132
|
+
[
|
|
133
|
+
sys.executable,
|
|
134
|
+
getdeps,
|
|
135
|
+
"--scratch-path",
|
|
136
|
+
SCRATCH,
|
|
137
|
+
"build",
|
|
138
|
+
"fizz",
|
|
139
|
+
*common,
|
|
140
|
+
"--no-tests",
|
|
141
|
+
]
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
OUT.mkdir(parents=True, exist_ok=True)
|
|
145
|
+
# show-inst-dir must use the SAME flags as build — the manifest hash depends
|
|
146
|
+
# on them — or it points at a different (unbuilt) scratch dir.
|
|
147
|
+
inst = subprocess.run(
|
|
148
|
+
[
|
|
149
|
+
sys.executable,
|
|
150
|
+
getdeps,
|
|
151
|
+
"--scratch-path",
|
|
152
|
+
SCRATCH,
|
|
153
|
+
"show-inst-dir",
|
|
154
|
+
"--recursive",
|
|
155
|
+
"fizz",
|
|
156
|
+
*common,
|
|
157
|
+
],
|
|
158
|
+
check=True,
|
|
159
|
+
text=True,
|
|
160
|
+
capture_output=True,
|
|
161
|
+
).stdout
|
|
162
|
+
# Forward slashes only: CMake treats backslashes as escapes when it splices
|
|
163
|
+
# these paths into generated TryCompile CMakeLists, so a Windows path like
|
|
164
|
+
# C:\fizz-src\...\CMake fails with "Invalid character escape '\f'".
|
|
165
|
+
prefix = ";".join(
|
|
166
|
+
line.replace("\\", "/") for line in inst.splitlines() if line.strip()
|
|
167
|
+
)
|
|
168
|
+
(OUT / "prefix.txt").write_text(prefix + "\n")
|
|
169
|
+
|
|
170
|
+
# fizz/folly use bundled find-modules (FindSodium, FindZstd, …) that live in
|
|
171
|
+
# the fizz source tree rather than installed config packages.
|
|
172
|
+
module_dir = str(FIZZ_SRC / "build" / "fbcode_builder" / "CMake")
|
|
173
|
+
(OUT / "module_dir.txt").write_text(module_dir.replace("\\", "/") + "\n")
|
|
174
|
+
|
|
175
|
+
print(f"fizz dependency tree ready; prefix written to {OUT / 'prefix.txt'}")
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
if __name__ == "__main__":
|
|
179
|
+
main()
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""delvewheel front-end for cibuildwheel's Windows `repair-wheel-command`.
|
|
3
|
+
|
|
4
|
+
getdeps installs each dep under $GETDEPS_SCRATCH/installed/<name>/ with DLLs in
|
|
5
|
+
bin/ and import libs in lib/, under content-addressed (hashed) names. We glob those
|
|
6
|
+
dirs and hand them to `delvewheel repair --add-path` so it can find and vendor the
|
|
7
|
+
shared deps (glog/gflags/openssl/...) into the wheel.
|
|
8
|
+
|
|
9
|
+
Invoked as: python scripts/repair_wheel_windows.py {dest_dir} {wheel}
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main() -> None:
|
|
21
|
+
dest_dir, wheel = sys.argv[1], sys.argv[2]
|
|
22
|
+
scratch = Path(os.environ["GETDEPS_SCRATCH"])
|
|
23
|
+
|
|
24
|
+
installed = scratch / "installed"
|
|
25
|
+
dll_dirs = [
|
|
26
|
+
d for name in ("bin", "lib") for d in installed.glob(f"*/{name}") if d.is_dir()
|
|
27
|
+
]
|
|
28
|
+
add_path = os.pathsep.join(str(d) for d in dll_dirs)
|
|
29
|
+
|
|
30
|
+
cmd = [
|
|
31
|
+
sys.executable,
|
|
32
|
+
"-m",
|
|
33
|
+
"delvewheel",
|
|
34
|
+
"repair",
|
|
35
|
+
"--add-path",
|
|
36
|
+
add_path,
|
|
37
|
+
"-w",
|
|
38
|
+
dest_dir,
|
|
39
|
+
"-v",
|
|
40
|
+
wheel,
|
|
41
|
+
]
|
|
42
|
+
print("+", " ".join(cmd), flush=True)
|
|
43
|
+
subprocess.run(cmd, check=True)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
if __name__ == "__main__":
|
|
47
|
+
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|