From 75404f365691ab3c5a2e01c28666e7980421098c Mon Sep 17 00:00:00 2001 From: Emery Conrad Date: Mon, 31 Aug 2026 13:08:16 -0500 Subject: [PATCH 1/3] style: format the files the pinned linters flag The Lint workflow checks the whole tree, but ctc-master never ran it on push. Drift built up unseen in 4 files across 3 unrelated commits. Format them so the gate starts clean for every future PR. Co-developed-with-the-help-of: Claude Code (Fable 5, human in the loop) --- bazel/sitecustomize.py | 7 +++++-- src/interop/interop_wrapper.cxx | 9 +++++---- test/test_selflocation.py | 11 ++++++++--- test/test_templates.py | 4 +++- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/bazel/sitecustomize.py b/bazel/sitecustomize.py index 30a9df6..dc621a3 100644 --- a/bazel/sitecustomize.py +++ b/bazel/sitecustomize.py @@ -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 @@ -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) diff --git a/src/interop/interop_wrapper.cxx b/src/interop/interop_wrapper.cxx index 9a895fe..2a4f1da 100644 --- a/src/interop/interop_wrapper.cxx +++ b/src/interop/interop_wrapper.cxx @@ -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; } } diff --git a/test/test_selflocation.py b/test/test_selflocation.py index 7e932a8..14031ad 100644 --- a/test/test_selflocation.py +++ b/test/test_selflocation.py @@ -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 diff --git a/test/test_templates.py b/test/test_templates.py index 21d94b1..a5a813d 100644 --- a/test/test_templates.py +++ b/test/test_templates.py @@ -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" + assert ( + gbl.ntarg.TakesTmpl["NtPlain"].__cpp_name__ == "ntarg::TakesTmpl" + ) assert ( gbl.ntarg.TakesTmpl["ntarg::Alias"].__cpp_name__ == "ntarg::TakesTmpl" From 2dd299e03b6ba89a8f50875e379c4d4f95de7f61 Mon Sep 17 00:00:00 2001 From: Emery Conrad Date: Mon, 31 Aug 2026 13:10:31 -0500 Subject: [PATCH 2/3] bazel: keep the CppInterOp pin in step with CMake CMakeLists.txt moved CPPINTEROP_GIT_TAG to 9802d619 but MODULE.bazel still fetched 8d624c62. Update the Bazel archive_override to match, per the file's own comment to keep both pins in step. Co-developed-with-the-help-of: Claude Code (Fable 5, human in the loop) --- MODULE.bazel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index e222a18..5c5a054 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -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 From 62bc4fc81486c285125b49eb1e609099cbd9266a Mon Sep 17 00:00:00 2001 From: Emery Conrad Date: Mon, 31 Aug 2026 13:11:30 -0500 Subject: [PATCH 3/3] ci: run on ctc-master pushes; track llvm22 and cling as non-gating Neither workflow ran on ctc-master pushes, so lint and test drift on that branch stayed invisible until the next PR inherited it. Add ctc-master to both push triggers. Split the llvm22 and cling cells into a separate build-test-tracking job. They track upstream LLVM ahead of our pin and can go red on their own; a red cell there now reads as tracking noise, not a blocker. A job that calls a reusable workflow cannot take continue-on-error, so a job split is the only valid way to keep them out of the gating job. The llvm21 cells and Lint stay gating. Co-developed-with-the-help-of: Claude Code (Fable 5, human in the loop) --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++---------- .github/workflows/lint.yml | 3 +++ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83676ee..94960f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ac99203..91be514 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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'