Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 32 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: CI

on:
push:
branches: [master, main]
# ctc-master needs its own CI run so lint and test drift surface here, not on the next PR.
branches: [master, main, ctc-master]
pull_request:

permissions:
Expand All @@ -15,22 +16,18 @@ concurrency:

jobs:
build-test:
name: ${{ matrix.os }}/llvm${{ matrix.llvm }}/py${{ matrix.py }}/c++${{ matrix.cxx }}${{ matrix.vg && '/vg' || '' }}${{ matrix.flavor == 'cling' && '/cling' || '' }}
name: ${{ matrix.os }}/llvm${{ matrix.llvm }}/py${{ matrix.py }}/c++${{ matrix.cxx }}${{ matrix.vg && '/vg' || '' }}
strategy:
fail-fast: false
# Mirrors CppInterOp's cppyy PR cells: clang-repl on the same OS/arch/LLVM
# /valgrind combos at Python 3.14, plus a cling cell and a C++23 cell
# (test_cpp23features runs only there). Breadth (3.12/3.13, C++17, LLVM
# 20, arm) lives in nightly.
# /valgrind combos at Python 3.14, plus a C++23 cell (test_cpp23features
# runs only there). Breadth (3.12/3.13, C++17, LLVM 20, arm) lives in
# nightly. The llvm22 and cling cells live in build-test-tracking below.
matrix:
include:
- { os: ubuntu-24.04, llvm: '21', flavor: system, py: '3.14', cxx: '20', vg: true }
- { os: ubuntu-24.04, llvm: '22', flavor: '', py: '3.14', cxx: '20' }
- { os: ubuntu-24.04, llvm: '22', flavor: '', py: '3.14', cxx: '23' }
- { os: macos-26, llvm: '21', flavor: system, py: '3.14', cxx: '20' }
- { os: macos-26-intel, llvm: '21', flavor: system, py: '3.14', cxx: '20' }
# cling backend, against the cached llvm-root (cling-llvm22) recipe cell.
- { os: ubuntu-24.04, llvm: '22', flavor: cling, flavor_version: cling-llvm22, py: '3.14', cxx: '20' }
uses: compiler-research/ci-workflows/.github/workflows/cppjit.yml@main
with:
# CppInterOp is pinned in CppJIT's cmake to a commit compatible
Expand All @@ -40,15 +37,39 @@ jobs:
os: ${{ matrix.os }}
llvm-version: ${{ matrix.llvm }}
llvm-flavor: ${{ matrix.flavor }}
llvm-flavor-version: ${{ matrix.flavor_version || '' }}
python-version: ${{ matrix.py }}
cxx-standard: ${{ matrix.cxx }}
valgrind: ${{ matrix.vg || false }}
run-xfail-crashing-tests: true

# llvm22 and cling track upstream LLVM ahead of our pin, so they can go red
# on their own. A reusable-workflow job cannot take continue-on-error, so
# this job stays split from build-test: a red cell here reads as tracking
# noise, not a blocker on the PR's own change.
build-test-tracking:
name: ${{ matrix.os }}/llvm${{ matrix.llvm }}/py${{ matrix.py }}/c++${{ matrix.cxx }}${{ matrix.flavor == 'cling' && '/cling' || '' }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-24.04, llvm: '22', flavor: '', py: '3.14', cxx: '20' }
- { os: ubuntu-24.04, llvm: '22', flavor: '', py: '3.14', cxx: '23' }
- { os: ubuntu-24.04, llvm: '22', flavor: cling, flavor_version: cling-llvm22, py: '3.14', cxx: '20' }
uses: compiler-research/ci-workflows/.github/workflows/cppjit.yml@main
with:
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 }}
llvm-flavor-version: ${{ matrix.flavor_version || '' }}
python-version: ${{ matrix.py }}
cxx-standard: ${{ matrix.cxx }}
run-xfail-crashing-tests: true

report:
if: ${{ always() && github.event_name == 'pull_request' }}
needs: build-test
needs: [build-test, build-test-tracking]
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Lint

on:
workflow_dispatch:
# ctc-master needs its own CI run so lint drift surfaces here, not on the next PR.
push:
branches: [ctc-master]
pull_request:
paths:
- '**.h'
Expand Down
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ bazel_dep(name = "cppinterop", version = "0.1.0")
# To build a fork or a newer commit, swap urls/integrity/strip_prefix together.
archive_override(
module_name = "cppinterop",
integrity = "sha256-a6QQMkWbrfn3fKRlcJV5SJL+Vj9blMXbAe0qp9NoduY=",
integrity = "sha256-Oo15vfnyOyZMFWZ/lzm20v/UVc5lWm5HSMcELmOXUrs=",
patch_strip = 1,
patches = ["//:bazel-support/cppinterop-cppjit-bazel-module.patch"],
strip_prefix = "CppInterOp-8d624c621a4b95e36ff73ac708c85a768287478f",
urls = ["https://github.com/compiler-research/CppInterOp/archive/8d624c621a4b95e36ff73ac708c85a768287478f.tar.gz"],
strip_prefix = "CppInterOp-9802d61921ad5688ae42e4e628d754fc1192244d",
urls = ["https://github.com/compiler-research/CppInterOp/archive/9802d61921ad5688ae42e4e628d754fc1192244d.tar.gz"],
)

# Dev loop: build a sibling CppInterOp checkout instead of the pinned archive
Expand Down
7 changes: 5 additions & 2 deletions bazel/sitecustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import sysconfig

_real = os.path.join(
sys.base_prefix, "include", "python" + sysconfig.get_python_version(),
sys.base_prefix,
"include",
"python" + sysconfig.get_python_version(),
)
if os.path.isdir(_real):
sysconfig.get_config_vars() # force the cache to populate
Expand All @@ -31,11 +33,12 @@
# Rewrite cwd-relative "../" runfiles segments to absolute $RUNFILES_DIR paths.
_runfiles = os.environ.get("RUNFILES_DIR")
if _runfiles:

def _anchor(value):
parts = []
for seg in value.split(os.pathsep):
if seg.startswith("../"):
seg = os.path.join(_runfiles, seg[len("../"):])
seg = os.path.join(_runfiles, seg[len("../") :])
parts.append(seg)
return os.pathsep.join(parts)

Expand Down
9 changes: 5 additions & 4 deletions src/interop/interop_wrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,15 @@ bool interop::AppendTypesSlow(const std::string& name,
// constant); pass its qualified name so Sema gets an expression, not the
// entity's type.
if (named && (Cpp::IsVariable(named) || Cpp::IsEnumConstant(named))) {
types.emplace_back(Cpp::GetTypeFromScope(named).data,
strdup(Cpp::GetQualifiedCompleteName(named).c_str()));
types.emplace_back(
Cpp::GetTypeFromScope(named).data,
strdup(Cpp::GetQualifiedCompleteName(named).c_str()));
return false;
}
// Template name (template-template arg): no type; carried by name.
if (named && Cpp::IsTemplate(named)) {
types.emplace_back(nullptr,
strdup(Cpp::GetQualifiedCompleteName(named).c_str()));
types.emplace_back(
nullptr, strdup(Cpp::GetQualifiedCompleteName(named).c_str()));
return false;
}
}
Expand Down
11 changes: 8 additions & 3 deletions test/test_selflocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ def test01_jit_from_foreign_cwd(self):
locate CppInterOp, the cpyrt API headers and clang's builtin headers
from libcppjit.so's own location alone."""

for var in ('CPPJIT_API_PATH', 'CPLUS_INCLUDE_PATH', 'LD_LIBRARY_PATH',
'RUNFILES_DIR', 'RUNFILES_MANIFEST_FILE'):
for var in (
"CPPJIT_API_PATH",
"CPLUS_INCLUDE_PATH",
"LD_LIBRARY_PATH",
"RUNFILES_DIR",
"RUNFILES_MANIFEST_FILE",
):
os.environ.pop(var, None)
os.chdir('/')
os.chdir("/")

import cppjit

Expand Down
4 changes: 3 additions & 1 deletion test/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ def test02a_named_template_args(self):
gbl = cppjit.gbl

# a template name, unqualified and qualified, plus an alias template
assert gbl.ntarg.TakesTmpl["NtPlain"].__cpp_name__ == "ntarg::TakesTmpl<NtPlain>"
assert (
gbl.ntarg.TakesTmpl["NtPlain"].__cpp_name__ == "ntarg::TakesTmpl<NtPlain>"
)
assert (
gbl.ntarg.TakesTmpl["ntarg::Alias"].__cpp_name__
== "ntarg::TakesTmpl<ntarg::Alias>"
Expand Down
Loading