|
32 | 32 | env: |
33 | 33 | MCPP_SOURCE_REF: ${{ github.event.inputs.mcpp_ref || vars.MCPP_SOURCE_REF }} |
34 | 34 | MCPP_VERSION: 2026.8.26.2 |
35 | | - XLINGS_VERSION: v2026.8.17.2 |
| 35 | + XLINGS_VERSION: v2026.8.27.1 |
36 | 36 | XLINGS_NON_INTERACTIVE: '1' |
37 | 37 |
|
38 | 38 | jobs: |
@@ -190,104 +190,6 @@ jobs: |
190 | 190 | grep kal_random syms.txt; exit 1; } |
191 | 191 | echo " ok kal_random_fill is weak, kal_time_sleep is strong" |
192 | 192 |
|
193 | | - # ⭐⭐ ASKING WHETHER A STREAM IS A TERMINAL GETS THE RIGHT ANSWER. |
194 | | - # |
195 | | - # musl's `isatty' asks with TIOCGWINSZ; this port answered only TCGETS, |
196 | | - # so every `isatty' returned 0 — for a real terminal as readily as for a |
197 | | - # pipe. Nothing failed: `std::print' simply never took its terminal path, |
198 | | - # and a program deciding on colour or on line buffering decided wrongly |
199 | | - # and in silence. |
200 | | - # |
201 | | - # ⭐ THE CRITERION IS A RELATION, NOT A VALUE. `isatty` under a pipe and |
202 | | - # under a pseudo-terminal must DIFFER, and must differ the same way the |
203 | | - # system's own C library does. A test asserting "0 in a pipe" alone would |
204 | | - # have passed throughout the defect. |
205 | | - - name: Asking whether a stream is a terminal is answered, not refused |
206 | | - if: runner.os == 'Linux' && matrix.target == '' |
207 | | - run: | |
208 | | - d="$(mktemp -d)"; mkdir -p "$d/src" |
209 | | - cat > "$d/mcpp.toml" <<TOML |
210 | | - [package] |
211 | | - name = "isattyprobe" |
212 | | - version = "0.1.0" |
213 | | -
|
214 | | - [dependencies] |
215 | | - openkal-musl = { path = "$PWD" } |
216 | | -
|
217 | | - [targets.isattyprobe] |
218 | | - kind = "bin" |
219 | | - main = "src/main.c" |
220 | | -
|
221 | | - [build] |
222 | | - cxx_runtime = "host-coupled" |
223 | | - TOML |
224 | | - sed -i 's/^ //' "$d/mcpp.toml" |
225 | | - printf '#include <unistd.h>\n#include <stdio.h>\nint main(void){ printf("%%d\\n", isatty(1)); return 0; }\n' > "$d/src/main.c" |
226 | | - ( cd "$d" && "$MCPP" build --toolchain '${{ matrix.toolchain }}' ) |
227 | | - bin="$(find "$d/target" -name isattyprobe -type f | head -1)" |
228 | | - test -n "$bin" || { echo "::error::the probe did not build"; exit 1; } |
229 | | -
|
230 | | - # The control: the system's own C library, through the same harness. |
231 | | - # Without it a `script` that fails to allocate a pty would make the |
232 | | - # port look broken. |
233 | | - printf '#include <unistd.h>\n#include <stdio.h>\nint main(void){ printf("%%d\\n", isatty(1)); return 0; }\n' > "$d/ctrl.c" |
234 | | - cc "$d/ctrl.c" -o "$d/ctrl" |
235 | | - ctrl_pipe="$("$d/ctrl" | cat | tr -d '\r')" |
236 | | - ctrl_tty="$(script -qec "$d/ctrl" /dev/null | tr -d '\r' | head -1)" |
237 | | - [ "$ctrl_pipe" = 0 ] && [ "$ctrl_tty" = 1 ] \ |
238 | | - || { echo "::error::the harness cannot tell a pty from a pipe (control gave $ctrl_pipe/$ctrl_tty) — this check would prove nothing" |
239 | | - exit 1; } |
240 | | -
|
241 | | - port_pipe="$("$bin" | cat | tr -d '\r')" |
242 | | - port_tty="$(script -qec "$bin" /dev/null | tr -d '\r' | head -1)" |
243 | | - echo " control: pipe=$ctrl_pipe tty=$ctrl_tty port: pipe=$port_pipe tty=$port_tty" |
244 | | - [ "$port_pipe" = "$ctrl_pipe" ] && [ "$port_tty" = "$ctrl_tty" ] \ |
245 | | - || { echo "::error::isatty over this port disagrees with the system's own C library"; exit 1; } |
246 | | - echo " ok isatty answers the same as the system's own C library" |
247 | | -
|
248 | | - # ⭐⭐ THE INTERNAL OVERLAY STOPS AT THIS PACKAGE'S BOUNDARY. |
249 | | - # |
250 | | - # musl reaches its own declarations through `src/include`, whose headers |
251 | | - # define `hidden`, `weak` and `weak_alias` — names that mean something |
252 | | - # only to musl's own sources. This package publishes the path it is built |
253 | | - # from, so every consumer used to see them too, and which consumer broke |
254 | | - # on which name was found one at a time (openkal-musl#13). |
255 | | - # |
256 | | - # `[build] private_include_dirs` (mcpp 2026.8.27.1) says which entries of |
257 | | - # `include_dirs` stop here. This asserts the DIRECTORY is absent from a |
258 | | - # consumer's command line — not that one macro no longer collides, which |
259 | | - # would go green again the moment the package patched that macro while |
260 | | - # the leak stayed. |
261 | | - - name: What this package is built from is not what it publishes |
262 | | - working-directory: examples/cross-hello |
263 | | - run: | |
264 | | - extra='' |
265 | | - [ -n '${{ matrix.target }}' ] && extra='--target ${{ matrix.target }}' |
266 | | - "$MCPP" build --toolchain '${{ matrix.toolchain }}' $extra |
267 | | - test -s compile_commands.json \ |
268 | | - || { echo "::error::no compile_commands.json — nothing to check"; exit 1; } |
269 | | -
|
270 | | - # ⚠️ A DENOMINATOR. With no consumer row the greps below are |
271 | | - # vacuously true, which is the false green this check must not have. |
272 | | - rows="$(grep -c '"file"' compile_commands.json || true)" |
273 | | - [ "${rows:-0}" -ge 1 ] \ |
274 | | - || { echo "::error::compile_commands.json has no rows"; exit 1; } |
275 | | -
|
276 | | - bad=0 |
277 | | - for d in musl/src/include musl/src/internal musl-generated/internal; do |
278 | | - if grep -q -- "$d" compile_commands.json; then |
279 | | - echo "::error::the internal overlay '$d' reached a consumer" |
280 | | - bad=1 |
281 | | - fi |
282 | | - done |
283 | | - # The control: a PUBLIC directory must still be there, or this check |
284 | | - # would pass for a build that published nothing at all. |
285 | | - grep -q -- 'port/include' compile_commands.json \ |
286 | | - || { echo "::error::no public include directory reached the consumer — the check above proves nothing" |
287 | | - exit 1; } |
288 | | - [ "$bad" = 0 ] || exit 1 |
289 | | - echo " ok the internal overlay stops here; the public headers do not" |
290 | | -
|
291 | 193 | # A program above this package names one package. It does not name |
292 | 194 | # openkal, it does not name an implementation, and it says nothing about |
293 | 195 | # the platform. |
|
0 commit comments