|
14 | 14 | strategy: |
15 | 15 | fail-fast: false |
16 | 16 | matrix: |
17 | | - os: [windows-2022, ubuntu-22.04, macos-14] |
| 17 | + # arm64 is not a rounding error on the desktop any more, and the |
| 18 | + # dependency set is where it shows. macos-14 is already arm64; |
| 19 | + # ubuntu-22.04-arm adds Linux, and it passes. |
| 20 | + # |
| 21 | + # windows-11-arm is deliberately absent, and it was measured rather |
| 22 | + # than assumed. Two dependencies have no win_arm64 wheel, and both |
| 23 | + # have to go before the runner is worth adding back: |
| 24 | + # |
| 25 | + # opencv-python — no win_arm64 wheel in any version, so pip falls |
| 26 | + # back to building from source and CMake cannot |
| 27 | + # configure for ARM64. Twelve minutes, then failure. |
| 28 | + # cryptography — wheels stop at 46.0.3; 46.0.4 onwards ship none. |
| 29 | + # Our floor is >=48.0.1 and that is a security floor |
| 30 | + # (GHSA-537c-gmf6-5ccf), so it cannot be lowered. |
| 31 | + # |
| 32 | + # Neither is a CI problem to work around — the package genuinely |
| 33 | + # cannot be installed on Windows arm64 today. Re-check without a |
| 34 | + # runner, in about ten seconds: |
| 35 | + # |
| 36 | + # pip install --dry-run --only-binary=:all: --platform win_arm64 \ |
| 37 | + # --python-version 3.12 --target /tmp/probe \ |
| 38 | + # 'opencv-python>=4.8,<6' 'cryptography>=48.0.1' |
| 39 | + # |
| 40 | + # Recorded in Progress.md; add the runner back when both resolve. |
| 41 | + os: [windows-2022, ubuntu-22.04, macos-14, ubuntu-22.04-arm] |
18 | 42 | python-version: ["3.10", "3.14"] |
19 | 43 | runs-on: ${{ matrix.os }} |
20 | 44 | steps: |
@@ -49,3 +73,118 @@ jobs: |
49 | 73 | name: platform-smoke-${{ matrix.os }}-${{ matrix.python-version }} |
50 | 74 | path: platform-smoke.zip |
51 | 75 | if-no-files-found: warn |
| 76 | + |
| 77 | + freebsd: |
| 78 | + name: The X11 backend driving input on a real FreeBSD |
| 79 | + runs-on: ubuntu-22.04 |
| 80 | + timeout-minutes: 30 |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + |
| 85 | + # The X11 backend was gated on sys.platform being linux/linux2, so it |
| 86 | + # refused to load on a FreeBSD desktop that runs the same X server, the |
| 87 | + # same python-Xlib and the same code. Relaxing that guard is only worth |
| 88 | + # something if a BSD actually runs it, and no hosted runner is one — so |
| 89 | + # this boots a real FreeBSD VM inside the runner. |
| 90 | + # |
| 91 | + # For a while it could only check the *decision*, because importing |
| 92 | + # anything under je_auto_control ran the facade and the facade imported |
| 93 | + # OpenCV and cryptography at module scope. Neither publishes a FreeBSD |
| 94 | + # wheel and building them from ports had not finished after fifty |
| 95 | + # minutes, so utils/platform_id was loaded by file path and the backend |
| 96 | + # itself went untested. |
| 97 | + # |
| 98 | + # That was the wrong thing to work around. Moving a mouse needs neither |
| 99 | + # package, and the facade no longer insists on them — they are imported |
| 100 | + # by the functions that use them, which test_facade_import_is_light.py |
| 101 | + # keeps true. What is left for this VM is python-Xlib and defusedxml, |
| 102 | + # both pure Python, plus an X server. So the whole backend runs here now |
| 103 | + # and the reads come back off the server itself: query_pointer for the |
| 104 | + # cursor, its button mask for the buttons, query_keymap for the keys. |
| 105 | + # nosemgrep: yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha |
| 106 | + - uses: vmactions/freebsd-vm@v1 # NOSONAR githubactions:S7637 |
| 107 | + with: |
| 108 | + release: "14.2" |
| 109 | + usesh: true |
| 110 | + prepare: | |
| 111 | + pkg install -y python311 xorg-vfbserver |
| 112 | + run: | |
| 113 | + set -eu |
| 114 | + echo "uname: $(uname -a)" |
| 115 | +
|
| 116 | + # pip comes from ensurepip, not from pkg: FreeBSD 14.2's repository |
| 117 | + # has no py311-pip (the flavoured port names are not dependable |
| 118 | + # here, while python311 itself is). These are the only dependencies |
| 119 | + # the facade still needs, all pure Python, at the versions |
| 120 | + # pyproject pins and by their PyPI names. |
| 121 | + # |
| 122 | + # --no-deps is the point of this job rather than a detail: it is |
| 123 | + # what proves nothing heavy is being dragged in behind the |
| 124 | + # verification. six is therefore named explicitly — python-Xlib |
| 125 | + # 0.33 imports it from Xlib.display, and with --no-deps nothing |
| 126 | + # else would install it. |
| 127 | + # |
| 128 | + # py311-sqlite3 is deliberately not installed either. FreeBSD |
| 129 | + # packages sqlite3 apart from python311, this VM is the only |
| 130 | + # machine in CI that does, and it is what caught ten subsystems |
| 131 | + # importing it at module scope — which made `import |
| 132 | + # je_auto_control` fail outright on a stock FreeBSD. Adding the |
| 133 | + # package here would make that regression invisible again. |
| 134 | + python3.11 -m ensurepip --upgrade |
| 135 | + python3.11 -m pip install --no-deps \ |
| 136 | + python-xlib==0.33 six defusedxml==0.7.1 |
| 137 | +
|
| 138 | + # The backend connects to a display at import time, so the server |
| 139 | + # has to be up first. 1280x1024 because the verification drives the |
| 140 | + # cursor to the far corner and reads it back. |
| 141 | + Xvfb :99 -screen 0 1280x1024x24 & |
| 142 | + xvfb_pid=$! |
| 143 | + trap 'kill "$xvfb_pid" 2>/dev/null || true' EXIT |
| 144 | + waited=0 |
| 145 | + while [ ! -e /tmp/.X11-unix/X99 ]; do |
| 146 | + waited=$((waited + 1)) |
| 147 | + if [ "$waited" -gt 100 ]; then |
| 148 | + echo "Xvfb never created /tmp/.X11-unix/X99" >&2 |
| 149 | + exit 1 |
| 150 | + fi |
| 151 | + sleep 0.1 |
| 152 | + done |
| 153 | +
|
| 154 | + DISPLAY=:99 PYTHONPATH="$(pwd)" python3.11 test/verify/freebsd_verify.py |
| 155 | + macos-capabilities: |
| 156 | + name: What a real macOS runner permits |
| 157 | + runs-on: macos-14 |
| 158 | + |
| 159 | + steps: |
| 160 | + - uses: actions/checkout@v4 |
| 161 | + |
| 162 | + - uses: actions/setup-python@v5 |
| 163 | + with: |
| 164 | + python-version: "3.12" |
| 165 | + |
| 166 | + - run: python -m pip install -e . # NOSONAR githubactions:S8544 # reason: installs the checked-out project itself, there is no upstream version to lock |
| 167 | + |
| 168 | + # macOS is the one supported platform with no container to put it in, |
| 169 | + # and every macOS row in docs/CAPABILITY_MATRIX.md said |
| 170 | + # "implementation": the code was there and nothing had run it on a Mac. |
| 171 | + # |
| 172 | + # Two of these capabilities are gated by TCC — macOS asks a *user* to |
| 173 | + # grant Screen Recording and Accessibility, and a CI runner has no user |
| 174 | + # to ask. Which of them a runner grants is not something to guess at, |
| 175 | + # and guessing is how the Wayland work twice recorded a desktop's |
| 176 | + # refusal as a container's limitation. |
| 177 | + # |
| 178 | + # Measured first, in --measure mode, and the answer was a surprise: a |
| 179 | + # macos-14 runner grants BOTH Screen Recording and Accessibility, so |
| 180 | + # every capability works — capture returns real pixels rather than the |
| 181 | + # black rectangle a refusal produces, CGEventPost moves the cursor and |
| 182 | + # the move reads back exactly, and the AX walk returns real elements. |
| 183 | + # The usual assumption that CI cannot exercise a TCC-gated macOS API is |
| 184 | + # simply wrong for this runner. |
| 185 | + # |
| 186 | + # So the flag is off and this is a gate now: EXPECTED in the script |
| 187 | + # holds what was measured, and a capability appearing or disappearing |
| 188 | + # turns this red and names which one. |
| 189 | + - name: Verify the macOS backend against a real window server |
| 190 | + run: python test/verify/macos_verify.py |
0 commit comments