From 561343b6c7488c34e37b42faa107d40474426318 Mon Sep 17 00:00:00 2001 From: BREW <81044362+b-re-w@users.noreply.github.com> Date: Sun, 15 Nov 2026 03:14:11 +0900 Subject: [PATCH 1/2] Fix: Write the smoke host's measure requests at the record's real length (PR-2.1) The measure request record grew from 72 to 80 bytes when the font features went into it (#788, FR-83). The smoke host writes its requests by hand in C and kept 72, so the renderer read the second, third and fourth request of the round trip eight, sixteen and twenty-four bytes early, and the smoke test failed on every platform with "the measure round trip did not agree, or never ran" (develop CI run 43617787436: iOS simulator, GraalVM Linux and macOS, Windows). MEASURE_RECORD is 80. The records are zeroed before they are filled, so the new font features slot reads as none. scripts/tests/smoke-host-measure-record.test.sh holds the C length equal to MEASURE_RECORD_LEN; it fails on the old value. --- renderer/desktop/c/smoke_host.c | 5 ++++- scripts/tests/smoke-host-measure-record.test.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 scripts/tests/smoke-host-measure-record.test.sh diff --git a/renderer/desktop/c/smoke_host.c b/renderer/desktop/c/smoke_host.c index d49f3ce0e..f38f8056c 100644 --- a/renderer/desktop/c/smoke_host.c +++ b/renderer/desktop/c/smoke_host.c @@ -256,7 +256,10 @@ static void build_label_update(const char *label) { * density and the type scale it is drawn with, and the node is measured by the * renderer's own layout. */ -#define MEASURE_RECORD 72 +/* The length of one measure request record, MEASURE_RECORD_LEN in compose-rust/src/measure.rs. + * The records here are zeroed first, so a field added at the end (the font features at 72) + * reads as absent. scripts/tests/smoke-host-measure-record.test.sh holds the two lengths equal. */ +#define MEASURE_RECORD 80 #define MEASURE_WIDTH 1000.0f #define HTML_NODE 6 #define HTML_TEXT "Measured as CSS text" diff --git a/scripts/tests/smoke-host-measure-record.test.sh b/scripts/tests/smoke-host-measure-record.test.sh new file mode 100755 index 000000000..bd7caffcd --- /dev/null +++ b/scripts/tests/smoke-host-measure-record.test.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# The smoke host writes its measure requests by hand, in C, so nothing generated keeps its +# record length in step with the Rust one. When the record grew from 72 to 80 bytes for the +# font features and the C stayed at 72, the renderer read every request after the first at +# the wrong place, and the smoke test failed on every platform with "the measure round trip +# did not agree". This holds the two lengths equal. +set -euo pipefail +root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +rust="$(sed -nE 's/^pub const MEASURE_RECORD_LEN: usize = ([0-9]+);$/\1/p' "$root/compose-rust/src/measure.rs")" +c="$(sed -nE 's/^#define MEASURE_RECORD ([0-9]+)$/\1/p' "$root/renderer/desktop/c/smoke_host.c")" +[[ -n "$rust" ]] || { echo "FAIL MEASURE_RECORD_LEN not found in compose-rust/src/measure.rs" >&2; exit 1; } +[[ -n "$c" ]] || { echo "FAIL MEASURE_RECORD not found in renderer/desktop/c/smoke_host.c" >&2; exit 1; } +if [[ "$rust" != "$c" ]]; then + echo "FAIL the smoke host writes $c byte measure records, the Host and the renderer use $rust" >&2 + exit 1 +fi +echo "ok the smoke host's measure record is $c bytes, the same as MEASURE_RECORD_LEN" From 542f0fa4b7fc54a3c5e7ed9a9bc8c02edc532c4d Mon Sep 17 00:00:00 2001 From: BREW <81044362+b-re-w@users.noreply.github.com> Date: Sun, 15 Nov 2026 03:09:58 +0900 Subject: [PATCH 2/2] Fix: Accept a published single-platform sibling in fork-dependencies.sh Since 1.11.1-ext.4 (fork #167) the fork's desktop modules (ui-desktop, foundation-desktop and the rest) name org.thisisthepy.compose.skiko: skiko-awt at the fork version. skiko-awt is a JVM jar published as a root alone, with no per-target publications, and publish-skiko-awt.sh puts it in ~/.m2. fork-dependencies.sh still asked every root sibling for a publication per served target (skiko-awt-desktop), so require-fork-artifacts.sh desktop refused a complete repository and every renderer build script stopped before the toolchain ran. A root whose metadata has no variant pointing at a target publication ("available-at") is now published when its own files are. A multiplatform root without the target's publication is still refused. fork-dependencies.test.sh covers both; the first case failed before this change with skiko-awt named as missing. --- renderer/scripts/fork-dependencies.sh | 16 +++++++++++++ scripts/tests/fork-dependencies.test.sh | 32 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/renderer/scripts/fork-dependencies.sh b/renderer/scripts/fork-dependencies.sh index 9ff41e861..f8f88c7cd 100755 --- a/renderer/scripts/fork-dependencies.sh +++ b/renderer/scripts/fork-dependencies.sh @@ -77,11 +77,27 @@ sub served_targets { return grep { has_artifact($group, "$artifact-$_") } @targets; } +# A multiplatform root points each target at a publication of its own ("available-at"). A +# module built for one platform alone (skiko-awt of the fork, a JVM jar the desktop modules name +# since 1.11.1-ext.4) has no such publications, and its root is all there is to publish. +sub is_single_platform { + my ($group, $artifact) = @_; + my $file = files_of($group, $artifact) . ".module"; + return 1 unless -s $file; + open my $in, "<", $file or return 0; + local $/; + my $metadata = eval { JSON::PP->new->decode(<$in>) }; + close $in; + return 0 unless $metadata; + return !grep { exists $_->{"available-at"} } @{ $metadata->{variants} || [] }; +} + sub is_published { my ($group, $artifact, $served) = @_; return 0 unless has_artifact($group, $artifact); my ($base, $target) = split_target($artifact); return 1 if defined $target; + return 1 if is_single_platform($group, $artifact); for my $served_target (@$served) { return 0 unless has_artifact($group, "$artifact-$served_target"); } diff --git a/scripts/tests/fork-dependencies.test.sh b/scripts/tests/fork-dependencies.test.sh index 178635934..f794b1e1b 100755 --- a/scripts/tests/fork-dependencies.test.sh +++ b/scripts/tests/fork-dependencies.test.sh @@ -17,6 +17,8 @@ # published, names it and the command that publishes it, and accepts the complete one # a constraint (an atomic group naming every module in it) is not a missing sibling, and # neither is a dependency of a root's variant for a target that was not built +# a published module built for one platform alone (skiko-awt) is not a missing sibling, and a +# multiplatform root without the target's publication is set -euo pipefail repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" @@ -186,4 +188,34 @@ else fail "require-fork-artifacts.sh reported ui-uikit, which only the root's iOS and shared metadata variants name" fi +# A desktop publication naming a module built for one platform alone, as the fork's desktop +# modules name its skiko-awt since 1.11.1-ext.4: that module's root is all there is, and it is +# published. A multiplatform root (one whose variants point at target publications) without +# its desktop publication is still not. +# single : writes ui-desktop naming the dependency. +single() { + local m2="$1/.m2/repository/org/thisisthepy/compose" dependency="$2" multiplatform="$3" + mkdir -p "$m2/ui/ui-desktop/$fork_as" "$m2/skiko/$dependency/$fork_as" + printf '{"formatVersion":"1.1","variants":[{"name":"desktopApiElements-published","dependencies":[{"group":"org.thisisthepy.compose.skiko","module":"%s","version":{"requires":"%s"}}]}]}\n' \ + "$dependency" "$fork_as" > "$m2/ui/ui-desktop/$fork_as/ui-desktop-$fork_as.module" + if [[ "$multiplatform" == 1 ]]; then + printf '{"formatVersion":"1.1","variants":[{"name":"desktopApiElements-published","available-at":{"url":"../../%s-desktop/%s/%s-desktop-%s.module","group":"org.thisisthepy.compose.skiko","module":"%s-desktop","version":"%s"}}]}\n' \ + "$dependency" "$fork_as" "$dependency" "$fork_as" "$dependency" "$fork_as" + else + printf '{"formatVersion":"1.1","variants":[{"name":"apiElements","files":[]}]}\n' + fi > "$m2/skiko/$dependency/$fork_as/$dependency-$fork_as.module" +} +home="$work/home-single" +single "$home" skiko-awt 0 +HOME="$home" bash "$tree/renderer/scripts/fork-dependencies.sh" check "$fork_as" desktop > "$work/out" 2>&1 || + fail "fork-dependencies.sh refused a single-platform module that is published: $(head -1 "$work/out")" +home="$work/home-multi" +single "$home" skiko 1 +if HOME="$home" bash "$tree/renderer/scripts/fork-dependencies.sh" check "$fork_as" desktop > "$work/out" 2>&1; then + fail "fork-dependencies.sh accepted a multiplatform root whose desktop publication nobody published" +else + grep -q "org.thisisthepy.compose.skiko:skiko:$fork_as" "$work/out" || + fail "fork-dependencies.sh refused without naming skiko $fork_as: $(head -1 "$work/out")" +fi + if [[ "$failures" -eq 0 ]]; then echo " ok"; else exit 1; fi