You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,34 +11,22 @@ Python wrapper for labeled and unlabeled asynchronous private set intersection
11
11
12
12
## Installation
13
13
14
-
### From PyPI (pre-built wheel)
14
+
### From PyPI (builds from source)
15
15
16
16
```bash
17
17
pip install apsi
18
18
```
19
19
20
-
Pre-built wheels are available for:
21
-
-**Linux**: x86_64 (manylinux_2_28)
22
-
-**macOS**: x86_64 (Intel) and arm64 (Apple Silicon)
23
-
-**Windows**: x86_64
24
-
25
-
These wheels are built with conservative CPU flags (`-march=x86-64 -mtune=generic`) for maximum compatibility across different CPU generations. This means they may not use AVX2/AVX-512 optimizations even if your CPU supports them.
26
-
27
-
### From source (optimized for your CPU)
28
-
29
-
To build with native CPU optimizations (AVX2, AVX-512, etc.):
30
-
31
-
```bash
32
-
pip install apsi --no-binary apsi
33
-
```
34
-
35
-
This compiles APSI and all dependencies from source, automatically selecting the best optimizations for your CPU. Build time is approximately 5-15 minutes.
20
+
This downloads the source distribution and builds APSI + all dependencies locally.
21
+
The build automatically selects the best CPU optimizations for your machine.
36
22
37
23
**Requirements:**
38
24
- C++ compiler (GCC >= 9, Clang >= 10, or MSVC >= 2019)
39
25
- CMake >= 3.13.4
40
26
- Python >= 3.11
41
-
- Internet access (dependencies are fetched during build)
27
+
- Internet access (vcpkg downloads dependencies during build)
28
+
29
+
**Build time:** Approximately 5-15 minutes depending on your machine.
42
30
43
31
## Example
44
32
@@ -95,13 +83,6 @@ pip install -e .
95
83
pytest tests/
96
84
```
97
85
98
-
### Building a Wheel Locally
99
-
100
-
```bash
101
-
pip install build cibuildwheel
102
-
cibuildwheel --platform linux --output-dir wheelhouse
-[Strategy 5: Conda-forge Distribution](./strategy-5-conda-forge.md) — Not started
9
9
10
+
## Current State
11
+
12
+
### Implemented: Source Distribution (sdist)
13
+
14
+
The sdist workflow is active and:
15
+
- Builds a source tarball on every push/PR
16
+
- Tests installation from the tarball on Python 3.14 (Ubuntu + macOS)
17
+
- Publishes to PyPI on tags only after successful install tests
18
+
19
+
Users install with:
20
+
```bash
21
+
pip install apsi --no-binary apsi
22
+
```
23
+
24
+
This triggers a full local build with native CPU optimizations. Build time is ~5-15 minutes.
25
+
26
+
### Deferred: Pre-built Wheels
27
+
28
+
Wheel building was attempted but blocked by several issues. The work is documented below for future reference.
29
+
30
+
#### Issues encountered
31
+
32
+
1.**flatc segfault in manylinux containers**: The flatbuffers compiler (`flatc`) from vcpkg segfaults when running in manylinux Docker containers, particularly on ARM64 hosts running x86_64 emulation. This happens during APSI's CMake configuration when it tries to generate C++ headers from `.fbs` schema files.
33
+
34
+
2.**SEAL version mismatch**: vcpkg provides SEAL 4.3.0, but APSI's CMakeLists.txt requires `find_package(SEAL 4.1)`. Workaround: patch the version check at build time.
35
+
36
+
3.**pybind11 CMake compatibility**: pybind11 v2.9.2 is incompatible with CMake 3.31+. Fixed by upgrading to v2.13.6.
37
+
38
+
4.**vcpkg bootstrap permissions**: Zip extraction doesn't preserve execute permissions on Unix. Fixed with `os.chmod()`.
39
+
40
+
5.**macOS `/opt/vcpkg` permissions**: CI runners can't write to `/opt/`. Fixed by using `/tmp/vcpkg`.
41
+
42
+
6.**Windows vcpkg pre-installed**: Windows runners already have vcpkg at `C:\vcpkg`. Fixed by checking for existence before cloning.
43
+
44
+
#### Potential solutions for future wheel builds
45
+
46
+
1.**Pre-generate flatbuffers headers**: Commit the `*_generated.h` files to the APSI submodule or generate them in a separate build step before the manylinux container runs. This eliminates the need for `flatc` during the wheel build.
47
+
48
+
2.**Use a custom manylinux image**: Pre-build vcpkg + all dependencies + flatbuffers headers into a custom Docker image, avoiding the bootstrap and flatc issues entirely.
49
+
50
+
3.**Build wheels on native runners**: Avoid cross-architecture emulation by using native x86_64 runners for Linux wheels.
51
+
52
+
4.**Consider scikit-build-core**: A modern alternative to setuptools + CMake that handles many of these edge cases better.
53
+
54
+
#### Files to restore for wheel building
55
+
56
+
The following files contain wheel-building configuration that can be reactivated:
57
+
58
+
-`pyproject.toml`: Contains `[tool.cibuildwheel]` sections (currently kept but not used)
59
+
-`setup.py`: Contains self-bootstrapping vcpkg logic (works for sdist installs)
60
+
-`.github/workflows/build-wheels.yml`: Currently sdist-only, can be extended back to wheels
0 commit comments