Skip to content

Commit edc60be

Browse files
authored
Merge branch 'main' into fix/mysql-connector-cpp-stdlib
2 parents 6676e90 + a7e9711 commit edc60be

2 files changed

Lines changed: 149 additions & 10 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 75 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,43 @@ jobs:
496496
id: plan
497497
shell: bash
498498
run: |
499+
# A FULL RUN IS NO LONGER SOMETHING A PR CAN TRIGGER BY ACCIDENT.
500+
#
501+
# Every reason to distrust the diff used to escalate to the whole
502+
# workspace. On a PR that is the wrong trade twice over: it buries
503+
# the change under ~22 shards of unrelated work, and it puts the
504+
# PR's own legs behind an hour of queue, so the thing being reviewed
505+
# is the last thing to report. Touching this file was enough to
506+
# trigger it -- which meant a one-line CI edit could not be reviewed
507+
# against a fast signal, measured repeatedly on #390, #391 and #392.
508+
#
509+
# So `full` now answers only where "check everything" is the actual
510+
# request: the weekly cron and a manual `workflow_dispatch`. On a PR
511+
# or a push, the same reasons instead WIDEN NOTHING and say so --
512+
# `widen` records them, the summary prints them, and a human who
513+
# wants the sweep runs the workflow by hand.
514+
#
515+
# What is deliberately NOT weakened: descriptor and member changes
516+
# still select their members exactly as before. The only thing that
517+
# changed is what happens when the diff cannot be classified.
499518
full() {
500519
echo "MEMBERS=__ALL__" >> "$GITHUB_ENV"
501520
echo "pkgs=__ALL__" >> "$GITHUB_OUTPUT"
502521
echo "full run: $1"
503522
exit 0
504523
}
505524
525+
UNTRUSTED=""
526+
widen() {
527+
case "${{ github.event_name }}" in
528+
schedule|workflow_dispatch) full "$1" ;;
529+
esac
530+
UNTRUSTED="${UNTRUSTED}${UNTRUSTED:+; }$1"
531+
echo "note: '$1' would once have forced a full workspace run;" \
532+
"selecting only what the diff names. Run this workflow" \
533+
"manually (workflow_dispatch) for the full sweep."
534+
}
535+
506536
# A push to main has a diff too — it was just never asked for.
507537
#
508538
# This used to be `event != pull_request -> full`, so every merge
@@ -528,33 +558,49 @@ jobs:
528558
base="${{ github.event.before }}"
529559
# All-zero on branch creation; absent object after a
530560
# force-push that dropped it. Either way there is nothing to
531-
# diff against, and guessing is worse than re-testing.
561+
# diff against.
562+
#
563+
# `widen` no longer exits on a push, so this has to leave a
564+
# USABLE range behind. `HEAD` alone (the root-to-HEAD diff)
565+
# would name every file in the repo and select every member --
566+
# a full run by another name, which is what this change exists
567+
# to stop. An empty range selects nothing, and `widen` has
568+
# already said why; the summary carries it to a human, who can
569+
# dispatch the sweep. Rare either way: merges here are squashes,
570+
# so `event.before` is present on every normal push.
571+
usable=1
532572
case "$base" in
533573
""|0000000000000000000000000000000000000000)
534-
full "push with no predecessor" ;;
574+
widen "push with no predecessor"; usable=0 ;;
535575
esac
536-
git cat-file -e "$base^{commit}" 2>/dev/null \
537-
|| full "push predecessor $base not in history"
538-
range="$base..HEAD" ;;
576+
if [ "$usable" = 1 ]; then
577+
git cat-file -e "$base^{commit}" 2>/dev/null \
578+
|| { widen "push predecessor $base not in history"; usable=0; }
579+
fi
580+
if [ "$usable" = 1 ]; then range="$base..HEAD"; else range=""; fi ;;
539581
*)
540582
full "event=${{ github.event_name }}" ;;
541583
esac
542-
changed=$(git diff --name-only $range)
543-
printf 'changed files vs %s:\n%s\n' "$base" "$changed"
584+
if [ -n "$range" ]; then
585+
changed=$(git diff --name-only $range)
586+
else
587+
changed=""
588+
fi
589+
printf 'changed files vs %s:\n%s\n' "${base:-<none>}" "$changed"
544590
sel=""; pkgsel=""
545591
add() { case " $sel " in *" $1 "*) ;; *) sel="$sel $1" ;; esac; }
546592
while IFS= read -r f; do
547593
[ -n "$f" ] || continue
548594
case "$f" in
549-
.github/workflows/validate.yml|tests/*.sh) full "$f" ;;
595+
.github/workflows/validate.yml|tests/*.sh) widen "$f" ;;
550596
mcpp.toml)
551597
# Workspace manifest. Every new-package PR appends to the
552598
# members list, so that alone must NOT force a full run:
553599
# select the added members; anything else in this file
554600
# (indices, settings) affects everyone → full.
555601
if ! diff -q <(git show "$base:mcpp.toml" | grep -v 'tests/examples/') \
556602
<(grep -v 'tests/examples/' mcpp.toml) >/dev/null; then
557-
full "mcpp.toml non-member change"
603+
widen "mcpp.toml non-member change"
558604
fi
559605
for p in $(comm -13 <(git show "$base:mcpp.toml" | grep -o 'tests/examples/[A-Za-z0-9._-]*' | sort -u) \
560606
<(grep -o 'tests/examples/[A-Za-z0-9._-]*' mcpp.toml | sort -u)); do
@@ -595,7 +641,7 @@ jobs:
595641
# here. Guard it in `lint` if that ever bites.
596642
tests/member-timings.tsv) : ;;
597643
*.md|docs/*|.agents/*|.github/*|tools/*) : ;;
598-
*) full "unclassified change: $f" ;;
644+
*) widen "unclassified change: $f" ;;
599645
esac
600646
done <<EOF
601647
$changed
@@ -606,6 +652,25 @@ jobs:
606652
pkgsel=${pkgsel# }
607653
echo "pkgs=$pkgsel" >> "$GITHUB_OUTPUT"
608654
echo "changed descriptors: ${pkgsel:-<none>}"
655+
656+
# Carried to the run summary, not just the log. A widened reason is
657+
# the one thing here a reviewer has to see WITHOUT opening a job:
658+
# it says this run deliberately tested less than the old behaviour
659+
# would have, and what to do about it.
660+
if [ -n "$UNTRUSTED" ]; then
661+
{
662+
echo "### Selective run (full sweep not triggered)"
663+
echo
664+
echo "These would once have forced a full workspace run:"
665+
echo
666+
echo "- $UNTRUSTED"
667+
echo
668+
echo "Selected members: \`${sel:-<none>}\`"
669+
echo
670+
echo "Run this workflow manually (**Run workflow** /"
671+
echo "\`workflow_dispatch\`) for the full sweep."
672+
} >> "$GITHUB_STEP_SUMMARY"
673+
fi
609674
# Sharding is for the FULL run only, and the shard count per platform is
610675
# that platform's RUNNER CONCURRENCY — not a round number.
611676
#

‎pkgs/o/openkal-emscripten.lua‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
-- openkal-emscripten --- the first implementation written ABOVE a C library.
2+
--
3+
-- Every other implementation in this ecosystem is written on a kernel's own
4+
-- interface: a register discipline, a trap instruction, a table of numbers.
5+
-- Emscripten has no kernel to issue a call to; it has a C library over a
6+
-- JavaScript host, and clause 2 of the specification permits exactly this
7+
-- arrangement in as many words: "an implementation may be built upon a C
8+
-- library, beneath one, or without one."
9+
--
10+
-- Listed for every platform because a platform table describes availability
11+
-- rather than applicability. A project selects this implementation with a
12+
-- conditional dependency on cfg(os = "emscripten"); one that selects it
13+
-- elsewhere fails at compile time, which is the correct place for that
14+
-- failure.
15+
--
16+
-- IT PROVIDES TWELVE OF THE FIFTEEN INTERFACES, and the absence is the report.
17+
-- `openkal.process`, `openkal.exec` and `openkal.space` are not there: no
18+
-- fork, no exec, no writable-then-executable memory, no second address space.
19+
-- A program that uses one of those seventeen names fails at LINK naming the
20+
-- symbol, which is clause 6.2's second time -- the mechanism rather than a
21+
-- defect. Measured:
22+
--
23+
-- wasm-ld: error: obj/main.o: undefined symbol: kal_process_spawn
24+
--
25+
-- `openkal.task` is behind the `threads` feature, because `-pthread` selects a
26+
-- different C library build, memory model and loader contract on this
27+
-- platform. Without the feature its translation unit is empty and the eight
28+
-- symbols do not exist, which is the same treatment the three absent
29+
-- interfaces get.
30+
--
31+
-- Conformance, measured with emsdk 6.0.9 under node: 86 held, 0 did not hold,
32+
-- 13 not observed.
33+
package = {
34+
spec = "1",
35+
namespace = "mcpplibs",
36+
name = "openkal-emscripten",
37+
description = "An implementation of openkal for Emscripten, written above a C library rather than beneath one",
38+
licenses = {"Apache-2.0"},
39+
repo = "https://github.com/mcpplibs/openkal-emscripten",
40+
type = "package",
41+
42+
xpm = {
43+
linux = {
44+
["0.1.0"] = {
45+
url = {
46+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.1.0.tar.gz",
47+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.1.0/openkal-emscripten-0.1.0.tar.gz",
48+
},
49+
sha256 = "9c5ca4ae4c3bb22b127e2fbf6ca5bd4ecbdd80eac4a28018e3deb0c7ebd07b6d",
50+
},
51+
},
52+
macosx = {
53+
["0.1.0"] = {
54+
url = {
55+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.1.0.tar.gz",
56+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.1.0/openkal-emscripten-0.1.0.tar.gz",
57+
},
58+
sha256 = "9c5ca4ae4c3bb22b127e2fbf6ca5bd4ecbdd80eac4a28018e3deb0c7ebd07b6d",
59+
},
60+
},
61+
windows = {
62+
["0.1.0"] = {
63+
url = {
64+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.1.0.tar.gz",
65+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.1.0/openkal-emscripten-0.1.0.tar.gz",
66+
},
67+
sha256 = "9c5ca4ae4c3bb22b127e2fbf6ca5bd4ecbdd80eac4a28018e3deb0c7ebd07b6d",
68+
},
69+
},
70+
},
71+
72+
-- The package's own manifest, inside the tarball's wrap directory.
73+
mcpp = "*/mcpp.toml",
74+
}

0 commit comments

Comments
 (0)