Record Basilisk build toolchain and ABI metadata#1474
Merged
Conversation
schaubh
added a commit
that referenced
this pull request
Jul 10, 2026
Add a generated build-info path that records the compiler, target, runtime, Python ABI, SWIG runtime, Eigen settings, and selected C/C++ layout canaries for an installed Basilisk package. The metadata is exposed through Basilisk.getBuildInfo() and Basilisk.printBuildInfo() so users and future BSK-SDK compatibility checks can inspect the binary that was actually built. Add architecture/utilities/bskAbiDescriptor.h as the public ABI descriptor contract shared by Basilisk and SDK-side probes. The header owns the descriptor version, plugin ABI version, canary types, and C/C++ extraction helpers so the two sides do not need to maintain parallel ABI-detection logic. Generate the runtime ABI payload with a small compiled C/C++ probe. The probe uses the same public descriptor header and shared bskPluginAbiSettings interface as native Basilisk targets, so it observes the same C++ standard, Python limited API definition, Eigen include/link settings, and compiler behavior. Wire metadata generation into the CMake build and refresh it for loadable module targets. Keep the generation dependency off internal static/shared libraries to avoid multi-config generated-source dependency issues, while still applying the shared ABI settings interface to native targets. Pass relevant Conan and Python build settings into CMake, including the selected Basilisk version, Conan version, C++ standard/library/runtime settings, build type, and invoking Python executable. Add tests covering the public descriptor contract, compiled ABI payload shape, C layout canaries, platform-specific C++ ABI fields, defensive copy behavior, and human-readable build-info formatting.
schaubh
added a commit
that referenced
this pull request
Jul 10, 2026
schaubh
added a commit
that referenced
this pull request
Jul 10, 2026
ddce204 to
38b4dbe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddce2047af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
schaubh
added a commit
that referenced
this pull request
Jul 10, 2026
schaubh
added a commit
that referenced
this pull request
Jul 10, 2026
38b4dbe to
0e02212
Compare
Add a generated build-info path that records the compiler, target, runtime, Python ABI, SWIG runtime, Eigen settings, and selected C/C++ layout canaries for an installed Basilisk package. The metadata is exposed through Basilisk.getBuildInfo() and Basilisk.printBuildInfo() so users and future BSK-SDK compatibility checks can inspect the binary that was actually built. Add architecture/utilities/bskAbiDescriptor.h as the public ABI descriptor contract shared by Basilisk and SDK-side probes. The header owns the descriptor version, plugin ABI version, canary types, and C/C++ extraction helpers so the two sides do not need to maintain parallel ABI-detection logic. Generate the runtime ABI payload with a small compiled C/C++ probe. The probe uses the same public descriptor header and shared bskPluginAbiSettings interface as native Basilisk targets, so it observes the same C++ standard, Python limited API definition, Eigen include/link settings, and compiler behavior. Wire metadata generation into the CMake build and refresh it for loadable module targets. Keep the generation dependency off internal static/shared libraries to avoid multi-config generated-source dependency issues, while still applying the shared ABI settings interface to native targets. Pass relevant Conan and Python build settings into CMake, including the selected Basilisk version, Conan version, C++ standard/library/runtime settings, build type, and invoking Python executable. Add tests covering the public descriptor contract, compiled ABI payload shape, C layout canaries, platform-specific C++ ABI fields, defensive copy behavior, and human-readable build-info formatting.
0e02212 to
284b777
Compare
Link bskBuildInfoProbe against the Python module target selected by the main Basilisk build. This uses Python3::SABIModule when the limited API is enabled and Python3::Module otherwise. The dependency supplies the correct Python import library on Windows, preventing MSVC from failing to locate python3.lib when Python.h requests the Stable ABI library. On Linux and macOS, CMake retains the appropriate platform-specific module-linking behavior. Verified by rebuilding bskGenerateBuildInfo and running src/tests/test_buildInfo.py with all 8 tests passing.
Update test_print_build_info to account for the human-readable standard library label used by the formatter. The compiled ABI metadata stores the canonical Windows family as "msvc", while printBuildInfo displays it as "MSVC STL". Continue checking the canonical labels directly on libc++ and libstdc++ platforms. Verified with all 8 build information tests and pre-commit checks passing.
Restore Conan dependencies before building and save them immediately after a successful build so later test failures do not discard the cache. Use stable, platform-specific cache keys that are unaffected by ordinary CMake changes, retain compatibility with existing caches, and report sccache hit and miss statistics for Linux, macOS, and Windows builds.
Generate Conan cache keys from the detected toolchain, Conan version, runner architecture, and build options while retaining legacy cache fallbacks. Refresh Conan profiles after restoration, make cache failures nonfatal, and report the 25 slowest pytest cases in CI.
Share Conan dependencies across Python and build variants, restrict cache writes to one producer per platform, and warm reusable base-branch caches after merges to reduce cache churn and eviction.
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
Add a generated build-info path that records the compiler, target, runtime, Python ABI, SWIG runtime, Eigen settings, and selected C/C++ layout canaries for an installed Basilisk package. The metadata is exposed through Basilisk.getBuildInfo() and Basilisk.printBuildInfo() so users and future BSK-SDK compatibility checks can inspect the binary that was actually built. Add architecture/utilities/bskAbiDescriptor.h as the public ABI descriptor contract shared by Basilisk and SDK-side probes. The header owns the descriptor version, plugin ABI version, canary types, and C/C++ extraction helpers so the two sides do not need to maintain parallel ABI-detection logic. Generate the runtime ABI payload with a small compiled C/C++ probe. The probe uses the same public descriptor header and shared bskPluginAbiSettings interface as native Basilisk targets, so it observes the same C++ standard, Python limited API definition, Eigen include/link settings, and compiler behavior. Wire metadata generation into the CMake build and refresh it for loadable module targets. Keep the generation dependency off internal static/shared libraries to avoid multi-config generated-source dependency issues, while still applying the shared ABI settings interface to native targets. Pass relevant Conan and Python build settings into CMake, including the selected Basilisk version, Conan version, C++ standard/library/runtime settings, build type, and invoking Python executable. Add tests covering the public descriptor contract, compiled ABI payload shape, C layout canaries, platform-specific C++ ABI fields, defensive copy behavior, and human-readable build-info formatting.
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
Link bskBuildInfoProbe against the Python module target selected by the main Basilisk build. This uses Python3::SABIModule when the limited API is enabled and Python3::Module otherwise. The dependency supplies the correct Python import library on Windows, preventing MSVC from failing to locate python3.lib when Python.h requests the Stable ABI library. On Linux and macOS, CMake retains the appropriate platform-specific module-linking behavior. Verified by rebuilding bskGenerateBuildInfo and running src/tests/test_buildInfo.py with all 8 tests passing.
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
Update test_print_build_info to account for the human-readable standard library label used by the formatter. The compiled ABI metadata stores the canonical Windows family as "msvc", while printBuildInfo displays it as "MSVC STL". Continue checking the canonical labels directly on libc++ and libstdc++ platforms. Verified with all 8 build information tests and pre-commit checks passing.
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
Restore Conan dependencies before building and save them immediately after a successful build so later test failures do not discard the cache. Use stable, platform-specific cache keys that are unaffected by ordinary CMake changes, retain compatibility with existing caches, and report sccache hit and miss statistics for Linux, macOS, and Windows builds.
schaubh
added a commit
that referenced
this pull request
Jul 12, 2026
Generate Conan cache keys from the detected toolchain, Conan version, runner architecture, and build options while retaining legacy cache fallbacks. Refresh Conan profiles after restoration, make cache failures nonfatal, and report the 25 slowest pytest cases in CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds build toolchain and compiled ABI metadata reporting to the installed Basilisk Python package. Basilisk now exposes
getBuildInfo()andprintBuildInfo()at package import level so users, developers, and future BSK-SDK compatibility checks can inspect the compiler, target platform, Python ABI, SWIG runtime, Eigen settings, runtime linkage, C++ standard library, and selected C/C++ layout canaries used to build the package.The ABI contract is centralized in
architecture/utilities/bskAbiDescriptor.h, which owns the descriptor version, plugin ABI version, canary types, and C/C++ extraction helpers. CMake builds a small compiled probe from this shared contract so the recorded ABI data reflects the actual compiler and target settings rather than only configure-time guesses.Commits are organized as:
Verification
Validated locally with the Basilisk virtual environment:
pytest -q src/tests/test_buildInfo.pyclang-format --dry-run --Werroron the new C/C++ filespython -m compileallon generated build-info Python filesgit diff --checkCONAN_ARGS="--opNav False --mujoco False --clean"Basilisk.getBuildInfo()andBasilisk.printBuildInfo()Added
src/tests/test_buildInfo.pyto cover metadata shape, public ABI descriptor constants, C layout canaries, platform-specific ABI fields, defensive copy behavior, and formatted build-info output.Documentation
Updated the build documentation to describe
printBuildInfo(),getBuildInfo(), the meaning of theartifact,abi, anddiagnosticssections, and how this metadata should and should not be used for future SDK/plugin compatibility decisions.Added a release-note snippet for the new build toolchain metadata feature.
Reviewers should check the install-build documentation for clarity around:
Future work
Use this metadata on the BSK-SDK side to compare plugin build settings against the loaded Basilisk package and emit clear compatibility diagnostics.
If Basilisk starts shipping true multi-slice macOS
universal2binaries, extend the ABI metadata schema to record per-architecture ABI descriptors rather than a single executed architecture.