Commit a5fbcc0
authored
fix: build cache invalidation on --target change + 28_target_static test (#29)
* fix: 28_target_static.sh uses isolated MCPP_HOME + detects GNU gcc
Root cause: without an explicit [toolchain] in the scaffolded project
and without a global defaultToolchain, mcpp's first-run logic
auto-installs gcc@15.1.0-musl 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
* debug: add diagnostic output to 28_target_static.sh
* fix: build cache must invalidate when --target changes
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.1 parent 00b7423 commit a5fbcc0
2 files changed
Lines changed: 50 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2039 | 2039 | | |
2040 | 2040 | | |
2041 | 2041 | | |
2042 | | - | |
| 2042 | + | |
| 2043 | + | |
2043 | 2044 | | |
2044 | 2045 | | |
2045 | 2046 | | |
2046 | 2047 | | |
2047 | 2048 | | |
2048 | 2049 | | |
2049 | 2050 | | |
| 2051 | + | |
2050 | 2052 | | |
2051 | 2053 | | |
2052 | 2054 | | |
2053 | 2055 | | |
2054 | 2056 | | |
2055 | 2057 | | |
2056 | | - | |
| 2058 | + | |
| 2059 | + | |
2057 | 2060 | | |
2058 | 2061 | | |
2059 | 2062 | | |
| |||
2106 | 2109 | | |
2107 | 2110 | | |
2108 | 2111 | | |
2109 | | - | |
| 2112 | + | |
| 2113 | + | |
2110 | 2114 | | |
2111 | 2115 | | |
2112 | 2116 | | |
| |||
2125 | 2129 | | |
2126 | 2130 | | |
2127 | 2131 | | |
2128 | | - | |
| 2132 | + | |
| 2133 | + | |
2129 | 2134 | | |
2130 | 2135 | | |
2131 | 2136 | | |
2132 | 2137 | | |
2133 | 2138 | | |
2134 | 2139 | | |
2135 | 2140 | | |
2136 | | - | |
| 2141 | + | |
2137 | 2142 | | |
2138 | 2143 | | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
2139 | 2150 | | |
2140 | 2151 | | |
2141 | 2152 | | |
| |||
2214 | 2225 | | |
2215 | 2226 | | |
2216 | 2227 | | |
2217 | | - | |
| 2228 | + | |
2218 | 2229 | | |
2219 | 2230 | | |
2220 | 2231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
22 | 31 | | |
23 | 32 | | |
24 | 33 | | |
| |||
27 | 36 | | |
28 | 37 | | |
29 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
30 | 52 | | |
31 | 53 | | |
32 | 54 | | |
33 | 55 | | |
34 | 56 | | |
35 | 57 | | |
| 58 | + | |
36 | 59 | | |
37 | 60 | | |
38 | 61 | | |
| |||
58 | 81 | | |
59 | 82 | | |
60 | 83 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
65 | 94 | | |
66 | 95 | | |
0 commit comments