fix(mysql-connector-cpp): state the C++ standard library as a layer requirement - #399
Merged
Merged
Conversation
…equirement The install hook cannot see the consumer's standard library: mcpp resolves the toolchain after the dependency graph, so none exists when a dependency installs (mcpp-community/mcpp#613). The descriptor now declares requires = { "mcpp:c++-abi=libstdc++" }, so a libc++ consumer is refused at resolution naming both implementations instead of failing at link. The llvm-leg skip stays with its reason updated.
…ch platform's system compiler The macOS default leg refused the member: install() builds with Apple clang there, so the static libraries are libc++ and the default toolchain's libc++ is the matching one. The requirement moves into the per-platform tables: libstdc++ under linux, libc++ under macosx. Measured locally: a linux-scoped requirement is refused under llvm naming both implementations and satisfied by gcc; mcpp xpkg parse --all-os accepts both sections.
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.
compat.mysql-connector-cppbuilds static libraries with CMake and each platform's system compiler: g++ with libstdc++ on Linux, Apple clang with libc++ on macOS. On Linux, a consumer whose toolchain links libc++ failed at link:The index CI keeps this member off the llvm leg for that reason. The skip's comment deferred to mcpp-community/mcpp#613, on the expectation that the install hook would one day see the consumer's standard library.
What mcpp#613 established
The hook cannot see it, and not for lack of a variable. mcpp resolves the toolchain after the dependency graph, because a package in the graph may supply a target-side layer. When a dependency's install hook runs, no standard library has been decided yet.
mcpp 2026.9.12.2 emits
MCPP_CXX_STDLIBto install hooks, and it is empty there. mcpp's tests/e2e/648 measures this.The requirement is therefore stated in the descriptor, with the layer grammar mcpp already enforces.
Change
mcppsegment for the target platform:requires = { "mcpp:c++-abi=libstdc++" }underlinux, andrequires = { "mcpp:c++-abi=libc++" }undermacosx. A consumer whose toolchain resolves the other implementation is refused at resolution, naming both, instead of failing at link.libstdc++for every platform, and the macOS default leg of this PR's CI refused the member, which builds and links there. That leg is the measurement for themacosxentry.install()states why the hook cannot adapt. The probe's expected value becomes "nil or empty".validate.ymlstays, with the reason updated. The refusal follows the hook's source build (about 881 s), so the leg would spend the build to reach a known refusal.Measurements
The descriptor form of the requirement, scoped the same way (
linux = { requires = ... },macosx = { requires = ... }), was measured with mcpp 2026.9.12.2 on a local index package that has no download:Compatibility with the index floor (
min_mcpp = 2026.8.27.2):requiresis not read. That reader records the key as unknown and prints a warning (warn_unknown_xpkg_keys), then proceeds as before, so the descriptor does not raise the floor.c++-abilayer are read and enforced.The lint loop from
validate.ymlpasses locally on the file (Lua syntax, mirror URLs, package name), andmcpp xpkg parse --all-os, which refuses unknown keys, accepts both thelinuxand themacosxsections.