Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/static-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,13 @@ jobs:
timeout-minutes: 12
# The checklist test-graalvm-renderer.yml runs on the GraalVM X11 window, with the same
# application: the consumer fixture the input check above built. The table is in the
# job summary; a row that fails is a warning, not a stop.
# job summary; a row that fails is a warning, except the
# resize rows, which are a gate: no frame at a size other than the window's, no size
# without a frame.
run: |
sudo apt-get install -y xclip
xvfb-run -a -s '-screen 0 1280x1024x24' ./scripts/parity/linux.sh native "$RUNNER_TEMP/parity" -- \
PARITY_GATE="resize_stale_ratio resize_stretched" \
xvfb-run -a -s '-screen 0 1280x1024x24' ./scripts/parity/linux.sh native "$RUNNER_TEMP/parity" -- \
"$PWD/target/linux-input-check-static/debug/consumer" --parity

- name: Keep the Linux parity run's logs
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-graalvm-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,13 @@ jobs:
timeout-minutes: 12
# The checklist static-renderer.yml runs on the Kotlin/Native window, with the same
# application: the consumer fixture the input check above built against this
# renderer. The table is in the job summary; a row that fails is a warning, not a stop.
# renderer. The table is in the job summary; a row that fails is a warning, except the
# resize rows, which are a gate: no frame at a size other than the window's, no size
# without a frame.
run: |
sudo apt-get install -y xclip
xvfb-run -a -s '-screen 0 1280x1024x24' ./scripts/parity/linux.sh graalvm "$RUNNER_TEMP/parity" -- \
PARITY_GATE="resize_stale_ratio resize_stretched" \
xvfb-run -a -s '-screen 0 1280x1024x24' ./scripts/parity/linux.sh graalvm "$RUNNER_TEMP/parity" -- \
"$PWD/target/linux-input-check-shared/debug/consumer" --parity

- name: Keep the Linux parity run's logs
Expand Down
2 changes: 1 addition & 1 deletion renderer/scripts/build-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ REVISION="127311dc737d8badb68953291d248db8a7071cca"
# so they can move without moving the Compose build above. This one is the fork's merge of the
# coordinates (#119): the window modules compile against the fork's Compose coordinates, which
# the Compose pin introduced, and it carries the window changes merged before it.
WINDOW_REVISION="b0b946b2324b7928ac2ebe6c5fd53bcdf111f1a5"
WINDOW_REVISION="57b4a0e102d837ba3271699297b69278fcefedef"
# What the pinned commit publishes as: its gradle.properties gives every library line a version
# of the form <upstream version>-ext.<N>. The renderer modules ask for these by name, and
# scripts/tests/fork-versions.test.sh checks that they do; this script checks the pinned
Expand Down
27 changes: 22 additions & 5 deletions renderer/scripts/publish-window.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
# The window code is the Compose fork's, at the commit build-compose.sh pins. The renderer
# depends on it as org.thisisthepy.compose.window:<module>:0.1.0, so the modules are built
# from that commit and published under ~/.m2 before the renderer is, the same way the patched
# Compose is. The Kotlin/JVM modules are published on every machine, so a Linux or Windows
# checkout resolves the coordinates the renderer's desktop module asks for. native/macos is
# published on a Mac and native/linux on Linux, because each is built from that system's
# headers.
# Compose is. common is published on every machine. The GraalVM window modules and the scene
# they name are published wherever the fork's desktop Compose is in the local repository, which
# is every build of the renderer's desktop module, so a Linux or Windows checkout resolves the
# coordinates that module asks for. native/macos is published on a Mac and native/linux on
# Linux, because each is built from that system's headers.
set -euo pipefail

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -18,7 +19,14 @@ repo="$(cd "$script_dir/../.." && pwd)"
fork_dir="$("$repo/scripts/fetch-fork-window.sh")"
window="$fork_dir/extended/window"

modules=(common graalvm/graalvm-macos graalvm/graalvm-linux)
modules=(common)
# The GraalVM window modules name scene (compile-only, for the window surfaces runComposeWindow
# uses), and scene compiles against the fork's Compose for the desktop, which only a build that
# published it has (build-compose.sh, or the compose-fork-desktop artifact in CI). A
# Kotlin/Native build needs none of the three, and would fail resolving scene's Compose.
if [[ -d "$HOME/.m2/repository/org/thisisthepy/compose/ui/ui-desktop" ]]; then
modules+=(scene graalvm/graalvm-macos graalvm/graalvm-linux)
fi
# native/macos compiles against the fork's Compose for macosArm64, which only a build that ran
# build-compose.sh --target macosArm64 has; a desktop-only build has no use for it.
case "$(uname -s)" in
Expand All @@ -44,6 +52,15 @@ cd "$window"
if [[ "$(uname -s)" == "Linux" && "$(uname -m)" != "x86_64" ]]; then
sed -i 's/^ platforms: \[.*\]$/ platforms: [ jvm ]/' "$window/common/module.yaml"
fi
# The GraalVM modules need scene's JVM half alone, and nothing this renderer builds uses its
# other platform (macosArm64, which would also need the fork's Compose for macosArm64), so
# only the JVM half is built.
if [[ " ${modules[*]} " == *" scene "* ]]; then
# A suffix for -i and the copy removed after, because BSD sed on macOS takes the next
# argument to -i as one.
sed -i.orig 's/^ platforms: \[.*\]$/ platforms: [ jvm ]/' "$window/scene/module.yaml"
rm -f "$window/scene/module.yaml.orig"
fi
# The PATH kotlin.bat runs with on Windows: System32 first, and none of Git's own directories
# but Git\cmd (git itself). Started from Git Bash, kotlin.bat would otherwise unpack its toolchain
# with Git's GNU tar, which takes C:\... for a remote host, and the toolchain's launcher (busybox)
Expand Down
17 changes: 17 additions & 0 deletions scripts/parity/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ print_table() {
echo
} >> "$GITHUB_STEP_SUMMARY"
fi
# PARITY_GATE names rows that fail the run whatever PARITY_STRICT says: a resize that
# presented a frame at a size other than the window's, or left a size without a frame of
# its own, breaks the resize rule (every frame drawn at the current size), so on the paths
# that meet it the two resize rows are a gate rather than a warning.
local gated=""
for name in ${PARITY_GATE:-}; do
local result
result="$(awk -F'\t' -v n="$name" '$1 == n { print $2 }' "$table")"
case "$name" in
resize_stretched) [[ "$result" == "0" ]] || gated="$gated $name=${result:-missing}" ;;
*) [[ -n "$result" && "$result" != FAIL* ]] || gated="$gated $name=${result:-missing}" ;;
esac
done
if [[ -n "$gated" ]]; then
echo "::error::parity $label fails its gate:$gated"
exit 1
fi
if grep -q $'\tFAIL' "$table"; then
echo "::warning::parity $label has failing rows"
[[ "${PARITY_STRICT:-}" == "1" ]] && exit 1
Expand Down
2 changes: 2 additions & 0 deletions scripts/parity/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export DXC_SYNTH_EXIT_AT="${DXC_SYNTH_EXIT_AT:-20}"
export DXC_REPORT_LATENCY=1
export DXC_REPORT_INPUT=1
export DXC_REPORT_RESIZE=1
# Every requested, confirmed and presented size, so a stale frame can be placed among them.
export DXC_REPORT_RESIZE_DETAIL=1
export GTK_THEME="${GTK_THEME:-Adwaita:dark}"

"$@" >"$log" 2>"$err" &
Expand Down
5 changes: 5 additions & 0 deletions scripts/tests/parity-linux.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ done
# Both paths on both platforms run the scripts in CI.
grep -q 'scripts/parity/linux.sh native' "$repo_root/.github/workflows/static-renderer.yml" || fail "the Kotlin/Native Linux window is not measured in CI"
grep -q 'scripts/parity/macos.sh native' "$repo_root/.github/workflows/static-renderer.yml" || fail "the Kotlin/Native macOS window is not measured in CI"
for workflow in static-renderer.yml test-graalvm-renderer.yml; do
grep -q 'PARITY_GATE="resize_stale_ratio resize_stretched"' "$repo_root/.github/workflows/$workflow" \
|| fail "$workflow does not gate the Linux parity run on the resize rows"
done
grep -q 'PARITY_GATE' "$repo_root/scripts/parity/common.sh" || fail "the parity table does not honour PARITY_GATE"
grep -q 'scripts/parity/linux.sh graalvm' "$repo_root/.github/workflows/test-graalvm-renderer.yml" || fail "the GraalVM X11 window is not measured in CI"
grep -q 'scripts/parity/macos.sh graalvm' "$repo_root/.github/workflows/test-graalvm-renderer.yml" || fail "the GraalVM AppKit window is not measured in CI"

Expand Down
Loading