fix(pm): de-inline resolver functions to satisfy musl-gcc 15.1 link#12
Merged
Sunrisepeak merged 2 commits intomainfrom May 8, 2026
Merged
fix(pm): de-inline resolver functions to satisfy musl-gcc 15.1 link#12Sunrisepeak merged 2 commits intomainfrom
Sunrisepeak merged 2 commits intomainfrom
Conversation
The push-tag trigger that fired for v0.0.2 failed with Cannot fetch both ef6dffd... and refs/tags/v0.0.2 to refs/tags/v0.0.2 — a known interaction in actions/checkout@v4 where `fetch-tags: true` combined with a tag ref tries to fetch the same ref twice. Switching to `fetch-depth: 0` gives the resolve-tag step the full history it needs without the duplicate-fetch conflict. (The release.yml flow itself is unchanged; this only fixes the runner side.)
The release.yml musl-static build of v0.0.2 failed at the link step:
obj/cli.m.o: in function `std::_Vector_base<mcpp::version_req::Version>::~_Vector_base()':
undefined reference to `std::_Vector_base<...>::_Vector_impl::~_Vector_impl()'
`pm/resolver.cppm` declared `resolve_semver` `inline`, so every importer
(currently `cli.cppm`) wound up locally instantiating the destructor of
`std::_Vector_base<vr::Version>`. With musl-gcc 15.1's libstdc++ that
specific instantiation is missing the corresponding `_Vector_impl`
destructor symbol, and the linker rejects.
Move the function bodies out of the `export` block in `pm/resolver.cppm`
(declarations only there, definitions in a non-export `mcpp::pm` block
later in the same module unit). Single definition point, single
instantiation site — the cross-module duplicate goes away and musl-gcc
links cleanly.
Reproduced and verified locally with `mcpp build --target x86_64-linux-musl`
on the same musl-gcc 15.1 toolchain CI uses.
`mcpp build` (glibc) + `mcpp test` (9/9 unit) still pass.
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.
Summary
The release.yml musl-static build of v0.0.2 failed at the link step:
PR-R4 declared
resolve_semverand friendsinlineinpm/resolver.cppm. Every importer (currentlycli.cppm) ends uplocally instantiating the destructor of
std::_Vector_base<vr::Version>.With musl-gcc 15.1's libstdc++ that specific instantiation is missing
the matching
_Vector_impldestructor symbol, and the linker rejects.Moving the function bodies out of the
exportblock — declarationsonly there, definitions in a later non-export
mcpp::pmblock withinthe same module unit — gives a single definition point, single
instantiation site. The cross-module duplicate disappears and musl-gcc
links cleanly.
ci.yml never caught this because it uses gcc@16.1.0 (glibc); the issue
is specific to musl-gcc 15.1's libstdc++.
Verification
mcpp build— glibc, 9/9 unit tests passmcpp build --target x86_64-linux-musl— musl-gcc 15.1, links cleantag=v0.0.2after this lands