Skip to content

Resolve PRIK through scikit-build-core's cmake.root - #69

Merged
saidctb merged 4 commits into
mainfrom
cmake-root-discovery
Sep 13, 2026
Merged

Resolve PRIK through scikit-build-core's cmake.root#69
saidctb merged 4 commits into
mainfrom
cmake-root-discovery

Conversation

@saidctb

@saidctb saidctb commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

A scikit-build-core project had to include(UsePRIK), because cmake.module was
the only entry point PRIK published. It now also publishes cmake.root, whose
entry-point name scikit-build-core turns into a <name>_ROOT cache variable, so
the name must stay PRIK: that is what lets a project listing PRIK in
build-system.requires resolve find_package(PRIK CONFIG REQUIRED) with no
PRIK_DIR, CMAKE_PREFIX_PATH, or CMAKE_MODULE_PATH. include(UsePRIK) keeps
working through cmake.module, and PRIK_DIR, CMAKE_PREFIX_PATH, cmake-dir, and
install-dir are unchanged.

A configure-time structural query that cannot import PRIK or one of its
dependencies now names the selected Python_EXECUTABLE and how to check it,
keeping the underlying error. The hint is attached only to an import failure,
so a real generation error still reaches the user as itself.

prik doctor cmake reports what a build system would discover: the imported
package, the metadata answering for it, cmake-dir, install-dir, both entry
points, and any duplicate distribution, PYTHONPATH copy, or metadata that does
not describe the imported package.

The example defaults to find_package so its scikit-build-core route exercises
the preferred form, and the primary regression test is now the end-user path:
a fresh environment, build isolation on, PRIK reaching the build only through
build-system.requires, then installing and calling the built extension. The
existing --no-build-isolation route stays, since it builds against a checkout.

Docs, CHANGELOG, packaging tests, and diagnostics tests are part of the same
change, and the guide's prose covers all of it, so this lands as one commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMz3kPhNruZUmNkDAMT9KJ
@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
prik/installation.py 74.50% 10 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

The example and the guide asked for scikit-build-core>=0.10, but cmake.root
does not exist there: the entry-point group, its prefix_roots plumbing, and the
<name>_ROOT cache entry all arrive in 0.11. A project pinned to 0.10.x would
therefore configure without PRIK_ROOT and fail the documented
find_package(PRIK CONFIG REQUIRED) route with no PRIK-specific -D flag.

Both declarations now require scikit-build-core>=0.11, and the guide says why
that is the floor.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMz3kPhNruZUmNkDAMT9KJ
@saidctb saidctb changed the title codex: resolve PRIK through scikit-build-core's cmake.root Resolve PRIK through scikit-build-core's cmake.root Sep 13, 2026
saidctb and others added 2 commits September 13, 2026 14:01
The discovery section had grown into nine consecutive blocks, so the common
path disappeared after the route table. The routes now split by the reader:
"Configuring a project yourself" keeps PRIK_DIR against CMAKE_PREFIX_PATH and
the install-dir record, while "Packaging and pinned interpreters" keeps
scikit-build-core, the entry-point table, and asking a selected interpreter.

Diagnosis gets its own heading rather than sitting under packaging, because a
build that finds no PRIK, or the wrong one, is what sends a reader looking for
prik doctor cmake from any route. The runnable example moves up beside the
table it demonstrates. No fact changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMz3kPhNruZUmNkDAMT9KJ
The macOS lane failed the new test: scikit-build-core picked the default C
compiler, Apple Clang, beside the job's Homebrew GNU Fortran, and the generated
binding's #include <ISO_Fortran_binding.h> is only found beside the Fortran
runtime that ships it. PRIK pairs the C driver with the Fortran vendor for that
reason, which is why every other CMake test here names CMAKE_C_COMPILER.

The test now passes the same pair through CMAKE_ARGS, the variable a build
backend honours, and asserts no argument it sets names PRIK -- the claim under
test is that PRIK needs no flag, not that CMake needs none. The guide states
the constraint too, since a macOS reader with Homebrew GNU Fortran meets it
before we do.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMz3kPhNruZUmNkDAMT9KJ
@saidctb
saidctb merged commit 1f91df9 into main Sep 13, 2026
8 checks passed
@saidctb
saidctb deleted the cmake-root-discovery branch September 13, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant