fix: 28_target_static E2E test — use isolated home + detect GNU gcc#29
Merged
Conversation
Root cause: without an explicit [toolchain] in the scaffolded project and without a global defaultToolchain, mcpp's first-run logic auto-installs [email protected] as the default. The second build (intended to exercise the default GNU path) then also produced a musl binary under target/x86_64-linux-musl/, which the find command pruned → "default GNU binary missing". Fix: - Use an isolated MCPP_HOME via _inherit_toolchain.sh (symlinks the global xpkgs/config so installed toolchains are visible) - Auto-detect the highest installed GNU gcc version and pin it in the project [toolchain].linux - Skip the GNU regression check when no GNU gcc is available rather than failing
The P0 fast-path build cache (target/.build_cache) only checked source file and mcpp.toml timestamps. When `mcpp build --target x86_64-linux-musl` was followed by a plain `mcpp build`, the fast-path reused the musl build.ninja — producing no GNU binary. Fix: store the user's --target value as a third line in .build_cache. try_fast_build() now compares the cached target against the current request and falls back to a full rebuild on mismatch. Also fix the test: detect installed GNU gcc dynamically and pin it in [toolchain].linux so the default build uses GNU, not musl auto-install.
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
28_target_static.shCI failure ("default GNU binary missing") that has been failing on every CI runRoot Cause
Without an explicit
[toolchain]in the scaffolded project and without a globaldefaultToolchain, mcpp's first-run logic auto-installs[email protected]as the default. The second build (intended to exercise the default GNU path) then also produced a musl binary undertarget/x86_64-linux-musl/, which thefind -pruneexcluded → "default GNU binary missing".Fix
MCPP_HOMEvia_inherit_toolchain.sh(symlinks the global xpkgs/config so installed toolchains are visible)[toolchain].linuxTest plan