Commit c484d92
fix(mysql-connector-cpp): the hook cannot know the consumer's stdlib — measured, then stated (#392)
* fix(mysql-connector-cpp): match the consumer's standard library, or say why not
CMake picks the system compiler here, so the static libs come out against
libstdc++ whatever the consumer uses. On the llvm leg, which links libc++,
the member fails at link with the libstdc++ half of its own dependency
undefined:
ld.lld: error: undefined symbol: std::_Rb_tree_increment(...)
ld.lld: error: undefined symbol:
std::__cxx11::basic_string<...>::_M_create(...)
`llamacpp` refuses a libc++ toolchain by name with `mcpp::cxx_stdlib()`,
and I said twice that the same lever was out of reach here because that is
a build-program API and this is an inline descriptor. That was half right.
The API is out of reach; the VARIABLE it reads is not necessarily —
MCPP_CXX_STDLIB is exported when mcpp runs a build program
(src/build/build_program.cppm), and whether it also reaches an xlings
install hook is documented nowhere.
So this asks instead of assuming, and records the answer either way:
* visible and `libc++` — build with `-stdlib=libc++`, on the compile and
both link flag sets. Compiling against libc++ headers while linking
libstdc++ produces the same undefined symbols one layer later, so the
flag has to reach all three.
* absent — nothing changes. The build is what it was, and the hook log
carries `MCPP_CXX_STDLIB=nil`, which is the missing half of the
diagnosis the next time that leg fails.
The failure has been read wrong once already in this area: `install()
result=nil` was taken for a cause when it was a successful install with no
return statement. A hook that reports what it saw is cheaper than a third
round of inference.
* fix(mysql-connector-cpp): the hook cannot know the consumer's stdlib — measured, then stated
The previous commit on this branch asked a question: does MCPP_CXX_STDLIB
reach an xlings install hook? It shipped a probe that logged the answer
either way and applied `-stdlib=libc++` if the answer was yes.
The answer is no, and this commit replaces the conditional with what was
learned. Three independent levels agree:
1. MEASURED. `MCPP_CXX_STDLIB=nil` on `workspace (linux llvm 0/4)`, and
the link failed exactly as before.
2. THE ONLY SETTER is `src/build/build_program.cppm` — mcpp exports it
when it runs a BUILD PROGRAM. An install hook is not that.
3. NOTHING ELSE CROSSES either: `make_xlings_env` builds an
`xlings::Env` of `{binary, home, projectDir}`, and `install_packages`
is invoked with `XLINGS_HOME` and PATH. No toolchain, no compiler,
no standard library.
So neither of the two routes I had assumed were available actually is.
`llamacpp` refuses a libc++ toolchain with `mcpp::cxx_stdlib()`, but that
lives in its build program in its own repo; an inline descriptor has no
such place. And `[target.'cfg(...)']` self-gating has a platform axis and
no standard-library axis — a cfg selector is not a platform.
The probe stays. One log line, it is the evidence for point 1, and the
day mcpp passes the variable through it reports that and the fix becomes
three lines directly below it.
What the descriptor can do is stop being silent: it now states that these
are static libraries built with the system compiler, that `std::__cxx11::`
therefore crosses the boundary, and that a libc++ consumer cannot use them
— where a user reads it, rather than where the linker says it.
`validate.yml` keeps the member off the llvm leg, with the same reasoning
written at the point that does the skipping. That is in CI and not in a
descriptor for a reason worth saying out loud: the leg is the only layer
that knows which standard library is in play. SKIPPED, NOT MARKED GREEN —
the incompatibility is real for users on a libc++ toolchain; this stops CI
re-measuring a known answer, it does not claim the combination works.
The empty-shard message downstream said "No workspace member affected by
this change", which would now be false in the case this change creates:
`linux llvm 0/4` holds mysql-connector-cpp and nothing else, so skipping it
empties the shard. It now covers both cases and points at the line that
says which.
Co-authored-by: sunrisepeak <x.d2learn.org@gmail.com>
---------
Co-authored-by: sunrisepeak <x.d2learn.org@gmail.com>1 parent a7e9711 commit c484d92
2 files changed
Lines changed: 92 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
1191 | 1233 | | |
1192 | 1234 | | |
1193 | 1235 | | |
| |||
1256 | 1298 | | |
1257 | 1299 | | |
1258 | 1300 | | |
1259 | | - | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
1260 | 1304 | | |
1261 | 1305 | | |
1262 | 1306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
267 | 314 | | |
268 | 315 | | |
269 | 316 | | |
| |||
0 commit comments