|
78 | 78 | if: runner.os == 'macOS' |
79 | 79 | run: | |
80 | 80 | brew install ninja meson pkg-config glib pixman |
| 81 | + # ⚠️ `distlib`, AND IT IS NOT AN OPTIONAL EXTRA. QEMU's `configure` |
| 82 | + # builds a non-isolated virtual environment with its own `mkvenv` |
| 83 | + # script, which needs `distlib` to populate it. Homebrew's Python 3.14 |
| 84 | + # does not carry it, and the failure is a configure-time |
| 85 | + # |
| 86 | + # *** Ouch! *** |
| 87 | + # found no usable distlib, please install it |
| 88 | + # |
| 89 | + # twenty seconds in, which reads like a QEMU problem and is a Python |
| 90 | + # packaging one. |
| 91 | + # |
| 92 | + # `--break-system-packages` because Homebrew's Python is |
| 93 | + # externally-managed (PEP 668) and refuses otherwise. On a throwaway |
| 94 | + # runner that is the right trade; on a developer's machine it is not, |
| 95 | + # which is why it is spelled out rather than hidden in a helper. |
| 96 | + python3 -m pip install --break-system-packages distlib |
81 | 97 | # ⚠️ NOT INSTALLING `qemu` ITSELF. Homebrew's formula would pull a |
82 | 98 | # working emulator and every check below would pass without this |
83 | 99 | # workflow having built anything — the shape of false green this |
@@ -110,7 +126,37 @@ jobs: |
110 | 126 | mingw-w64-ucrt-x86_64-pkgconf |
111 | 127 | mingw-w64-ucrt-x86_64-zlib |
112 | 128 |
|
| 129 | + # ⚠️ WINDOWS EXTRACTS UNDER MSYS2, AND THE REASON IS SYMLINKS. |
| 130 | + # |
| 131 | + # QEMU's source tarball carries `roms/u-boot`, which is full of them. |
| 132 | + # Git Bash's `tar` cannot create a symlink without the privilege or |
| 133 | + # developer mode, and produces hundreds of |
| 134 | + # |
| 135 | + # tar: qemu-9.2.4/roms/u-boot/include/ctype.h: |
| 136 | + # Cannot create symlink to 'linux/ctype.h' |
| 137 | + # |
| 138 | + # before failing. MSYS2's `tar` copies instead, which is what its symlink |
| 139 | + # emulation does by default. |
| 140 | + # |
| 141 | + # `roms/` is excluded regardless: it holds firmware SOURCE for machines |
| 142 | + # this build does not produce, and `x86_64-softmmu` takes its firmware |
| 143 | + # from the prebuilt blobs in `pc-bios/`. Excluding it removes the problem |
| 144 | + # rather than working around it, and it removes about a third of the |
| 145 | + # extraction. |
| 146 | + - name: Fetch QEMU ${{ env.QEMU_VERSION }} (Windows) |
| 147 | + if: runner.os == 'Windows' |
| 148 | + shell: msys2 {0} |
| 149 | + run: | |
| 150 | + set -euo pipefail |
| 151 | + cd "$(cygpath "$GITHUB_WORKSPACE")" |
| 152 | + curl -fsSL --retry 5 --retry-all-errors --retry-delay 3 \ |
| 153 | + -o qemu.tar.xz \ |
| 154 | + "https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz" |
| 155 | + tar xf qemu.tar.xz --exclude="qemu-${QEMU_VERSION}/roms/*" |
| 156 | + test -d "qemu-${QEMU_VERSION}/pc-bios" || { echo "the firmware blobs the build needs are missing"; exit 1; } |
| 157 | +
|
113 | 158 | - name: Fetch QEMU ${{ env.QEMU_VERSION }} |
| 159 | + if: runner.os != 'Windows' |
114 | 160 | run: | |
115 | 161 | set -euo pipefail |
116 | 162 | # ⚠️ `--retry-all-errors`, NOT JUST `--retry`. curl's plain `--retry` |
|
0 commit comments