Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca82231
Improve error reporting for method calls without a C++ object (#41)
aaronj0 Aug 25, 2026
3235039
Penalize void* arguments in overload priority as intended (#40)
aaronj0 Aug 25, 2026
46cde55
Unify installed layout under cppjit, drop backend (#43)
aaronj0 Aug 26, 2026
821257b
Add single header for interop API/types used by cpyrt (#42)
aaronj0 Aug 26, 2026
133da28
[test] Fix failures with parallel pytest runs (#49)
keremsahn Aug 30, 2026
6d89803
[build] Lean install: ship single stripped libclangCppInterOp (#50)
aaronj0 Aug 31, 2026
ab31d05
[interop] Silence unused-parameter warnings. NFC (#53)
aaronj0 Aug 31, 2026
b48635e
[cpyrt] Clear stale Python errors before C API calls (#52)
aaronj0 Aug 31, 2026
94c2728
Support building wheels for manylinux and OSX (#22)
aaronj0 Aug 31, 2026
6ac8260
[cpyrt] Reuse InitializerListConverter element converters (#54)
aaronj0 Aug 31, 2026
8e1f140
[test] Improve pytest infrastructure, markers and xdist support (#51)
aaronj0 Sep 1, 2026
d1f5c8e
[ci] Harden the wheels workflow and cibuildwheel config (#59)
aaronj0 Sep 1, 2026
ba1e2eb
[interop] Filter deleted functions from Python-visible overload sets …
aaronj0 Sep 2, 2026
e26dd54
[cpyrt] Expose method const-qualification in func_overloads_types (#64)
conrade-ctc Sep 2, 2026
2a67cfb
[test] Update passing xfail conditions on nightlies (#69)
aaronj0 Sep 2, 2026
019c4e1
[ci] Build wheels for linux aarch64 and Intel mac (#68)
aaronj0 Sep 2, 2026
58bd266
[ci] Add label-based configurations, nightlies trigger (#72)
aaronj0 Sep 2, 2026
b39a064
[cpyrt] Restore support for non-const void*& arguments (#71)
aaronj0 Sep 3, 2026
9a0217a
[cpyrt] Do not decref a constructor result on Windows (#70)
aaronj0 Sep 3, 2026
ac99a24
[cpyrt] Only let reshape set dimensions of unknown size (#65)
guitargeek Sep 3, 2026
bdf63ae
[cpyrt] Raise TypeError when a template argument names no C++ type (#67)
aaronj0 Sep 3, 2026
d9a8c10
[cpyrt] Detect enum arguments by type in overload priority
aaronj0 Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/wheel_contents_check.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Fail when a wheel holds a file outside the install-layout allowlist.

Usage: python wheel_contents_check.py <wheel> [<wheel> ...]"""

import fnmatch
import sys
import zipfile

# fnmatch's * crosses path separators, so one pattern covers a subtree.
ALLOWED = [
"cppjit/*.py",
"cppjit/libcppjit.so",
"cppjit/interop/lib/libclangCppInterOp*",
"cppjit/interop/lib/clang/*",
"cppjit/interop/include/*",
"cppjit-*.dist-info/*",
]


def check(path):
# directory entries (trailing slash) carry no content
members = [m for m in zipfile.ZipFile(path).namelist() if not m.endswith("/")]
bad = [m for m in members if not any(fnmatch.fnmatch(m, p) for p in ALLOWED)]
for member in bad:
print(f"{path}: unexpected member {member}")
return not bad


if __name__ == "__main__":
if len(sys.argv) < 2:
sys.exit(__doc__)
sys.exit(0 if all([check(path) for path in sys.argv[1:]]) else 1)
20 changes: 20 additions & 0 deletions .github/wheel_smoke.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Wheel smoke test, run from a clean venv by cibuildwheel's test step:
libcppjit.so must locate libclangCppInterOp relative to its own path (the
build tree is gone by test time), and the template instantiation plus the
header check prove the shipped include tree."""

import os

import cppjit

cppjit.cppdef("int wheel_smoke(int x) { return x + 1; }")
assert cppjit.gbl.wheel_smoke(41) == 42

v = cppjit.gbl.std.vector["int"]()
v.push_back(7)
assert v[0] == 7

api = os.path.join(
os.path.dirname(cppjit.__file__), "interop", "include", "cpyrt", "API.h"
)
assert os.path.exists(api), api
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ name: CI

on:
push:
branches: [master, main]
branches: [main]
pull_request:
paths-ignore:
- 'README.md'

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# PR-only: don't cancel an in-flight push validation on master.
# PR-only: don't cancel an in-flight push validation on main.
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Nightly

# Exhaustive run on a schedule: the full matrix with the xfail sweeps and
# valgrind on every Linux cell, against the pinned CppInterOp (reusable
# default). On any failure a tracking issue is opened/updated. To track
# upstream drift, add a cell with `cppinterop-ref: main`; it builds CppJIT
# against CppInterOp's tip and goes red when that API drifts ahead of the
# synced forks -- the signal that the next fork re-sync is due.
# The full test matrix on a schedule; pr-nightly.yml also runs it on
# PRs labeled test-nightly.

on:
schedule:
- cron: '30 2 * * *'
workflow_dispatch:
workflow_call:

permissions:
contents: read
Expand Down Expand Up @@ -45,7 +42,11 @@ jobs:
- { os: ubuntu-24.04, llvm: '22', flavor: cling, flavor_version: cling-llvm22, py: '3.13', cxx: '20' }
uses: compiler-research/ci-workflows/.github/workflows/cppjit.yml@main
with:
# For upstream-drift detection, set cppinterop-ref: main here.
# To track CppInterOp drift, add a cell with cppinterop-ref: main;
# red on it means the fork re-sync is due.
# The reusable's cppjit-ref defaults to main; pin the triggering commit.
cppjit-repo: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
cppjit-ref: ${{ github.event.pull_request.head.sha || github.sha }}
os: ${{ matrix.os }}
llvm-version: ${{ matrix.llvm }}
llvm-flavor: ${{ matrix.flavor }}
Expand All @@ -57,7 +58,7 @@ jobs:

drift-issue:
needs: build-test
if: ${{ always() && needs.build-test.result == 'failure' }}
if: ${{ always() && needs.build-test.result == 'failure' && github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -72,7 +73,7 @@ jobs:
marker,
'## Nightly build/test failed',
'',
`The scheduled nightly run failed (CppJIT \`master\`, pinned CppInterOp).`,
`The scheduled nightly run failed (CppJIT \`main\`, pinned CppInterOp).`,
`Investigate the failing cell; a persistent failure may mean a fork re-sync is due.`,
'',
`Run: ${run}`,
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/pr-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR Nightly

# Run the nightly matrix on a PR when the test-nightly label is applied.
# Label events only: re-apply the label for a fresh run.

on:
pull_request:
types: [labeled]

permissions:
contents: read

concurrency:
group: pr-nightly-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
nightly:
if: ${{ github.event.label.name == 'test-nightly' }}
uses: ./.github/workflows/nightly.yml
185 changes: 185 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: Wheels

# Build the wheels (cibuildwheel; config in pyproject.toml) and the sdist
# as artifacts. setup-recipe stages the llvm-wheel toolchain at /opt/llvm;
# linux mounts it into the build container, the same manylinux_2_28 image
# the toolchain was built on.

on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/wheels.yml'
- '.github/wheel_smoke.py'
- '.github/wheel_contents_check.py'
- 'pyproject.toml'
- 'CMakeLists.txt'
- 'cmake/**'
- 'src/interop/**'
- 'python/cppjit/_cpython_cppjit.py'
push:
tags: ['v*']
schedule:
- cron: '30 4 * * 1'

permissions:
contents: read

concurrency:
group: wheels-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
wheels:
name: wheels ${{ matrix.label }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, label: manylinux-x86_64, arch: x86_64 }
- { os: ubuntu-24.04-arm, label: manylinux-aarch64, arch: aarch64 }
- { os: macos-26, label: macosx-arm64, arch: arm64 }
- { os: macos-26-intel, label: macosx-x86_64, arch: x86_64 }
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

# ref pins the recipe content the cache key is computed from.
- uses: compiler-research/ci-workflows/actions/setup-recipe@main
id: llvm
with:
recipe: llvm-wheel
version: '21.1.8'
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
ref: 02f380b2e46746cd1c948c085894b8594a867fba

- name: Stage the toolchain at /opt/llvm
env:
RECIPE_PATH: ${{ steps.llvm.outputs.path }}
run: sudo mv "$RECIPE_PATH" /opt/llvm

- uses: pypa/cibuildwheel@v4.2.0

- name: Assert the build left the checkout clean
run: git diff --exit-code

- name: Check the wheels against the content allowlist
run: python3 .github/wheel_contents_check.py wheelhouse/*.whl

- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.label }}
path: wheelhouse/*.whl
if-no-files-found: error

sdist:
name: sdist
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- run: pipx run build --sdist

- name: Check the sdist metadata
run: pipx run twine check dist/*.tar.gz

- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist/*.tar.gz
if-no-files-found: error

# Run the full suite on a plain runner, outside the manylinux
# container the wheel was built in.
test-wheel:
name: test wheel (full suite)
needs: wheels
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-python@v7
with:
python-version: '3.12'

- uses: actions/download-artifact@v8
with:
name: wheels-manylinux-x86_64
path: wheelhouse

- name: Install the test suite's native deps
# test_eigen/test_boost need them; the CI cells install the same pair.
run: sudo apt-get -q update && sudo apt-get -y install libeigen3-dev libboost-dev

- name: Install the wheel and the test requirements
run: python -m pip install wheelhouse/cppjit-*cp312*.whl -r requirements.txt

- name: Smoke the wheel outside pytest
run: python -X faulthandler .github/wheel_smoke.py

- name: Run the test suite against the installed wheel
env:
CPPINTEROP_EXTRA_INTERPRETER_ARGS: -std=c++20
run: |
cd test
make -j$(nproc) PYTHON=python
python -m pytest -ra

# Build from the sdist and run the full suite against the install.
test-sdist:
name: test sdist (build + full suite)
needs: sdist
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-python@v7
with:
python-version: '3.12'

- uses: compiler-research/ci-workflows/actions/setup-recipe@main
id: llvm
with:
recipe: llvm-wheel
version: '21.1.8'
os: ubuntu-24.04
arch: x86_64
ref: 02f380b2e46746cd1c948c085894b8594a867fba

- uses: actions/download-artifact@v8
with:
name: sdist
path: dist

- name: Install the test suite's native deps
run: sudo apt-get -q update && sudo apt-get -y install libeigen3-dev libboost-dev

- name: Build and install from the sdist with the test requirements
env:
RECIPE_PATH: ${{ steps.llvm.outputs.path }}
run: >
python -m pip install dist/cppjit-*.tar.gz -v
--config-settings=cmake.define.LLVM_DIR="$RECIPE_PATH/lib/cmake/llvm"
--config-settings=cmake.define.Clang_DIR="$RECIPE_PATH/lib/cmake/clang"
-r requirements.txt

- name: Smoke the install outside pytest
run: python -X faulthandler .github/wheel_smoke.py

- name: Run the test suite against the sdist install
env:
CPPINTEROP_EXTRA_INTERPRETER_ARGS: -std=c++20
run: |
cd test
make -j$(nproc) PYTHON=python
python -m pytest -ra
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ __pycache__/

# Built test dictionaries and extension modules
*.so
*.so.*.tmp
*Dict.lock

# Packaging
build/
Expand Down
Loading
Loading