ci(windows): extract the toolchain directly and self-check it
VoidBuildSystem CI / 1 · Requirements (push) Successful in 10s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Failing after 20s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Failing after 24s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (debug) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 3A · Linux test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Canceled after 3m41s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Canceled after 3m44s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Canceled after 3m30s
VoidBuildSystem CI / 1 · Requirements (push) Successful in 10s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Failing after 20s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Failing after 24s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Skipped
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (debug) (push) Skipped
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 3A · Linux test (debug) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Canceled after 0s
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Canceled after 0s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Canceled after 3m41s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Canceled after 3m44s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Canceled after 3m30s
Extracting into the prefix avoids a 1.5 GB copy, and the installer now compiles a probe with the UCRT compiler: a broken toolchain fails with the driver's own diagnostics (exec search path, cc1plus location, disk usage) instead of a later, opaque CMake error.
This commit is contained in:
1 parent
67b89c7d3a
commit
a8bb246095
1 file changed
+25
-8
@@ -9,10 +9,31 @@ release=gcc-16
|
|||||||
host=x86_64-unknown-linux-gnu
|
host=x86_64-unknown-linux-gnu
|
||||||
url="https://github.com/AmanoTeam/mingw-gcc-cross/releases/download/${release}/${host}.tar.xz"
|
url="https://github.com/AmanoTeam/mingw-gcc-cross/releases/download/${release}/${host}.tar.xz"
|
||||||
prefix="${1:-/opt/mingw-gcc-cross}"
|
prefix="${1:-/opt/mingw-gcc-cross}"
|
||||||
|
compiler="${prefix}/bin/x86_64-w64-mingw32-ucrt-g++"
|
||||||
|
|
||||||
if [ -x "${prefix}/bin/x86_64-w64-mingw32-ucrt-g++" ]; then
|
self_check() {
|
||||||
|
local probe
|
||||||
|
probe="$(mktemp -d)"
|
||||||
|
printf 'int main() { return 0; }\n' > "${probe}/probe.cpp"
|
||||||
|
if ! "${compiler}" -c "${probe}/probe.cpp" -o "${probe}/probe.o"; then
|
||||||
|
echo "the MinGW-w64 toolchain at '${prefix}' cannot compile:" >&2
|
||||||
|
"${compiler}" -v -c "${probe}/probe.cpp" -o "${probe}/probe.o" 2>&1 | tail -n 20 >&2 ||
|
||||||
|
true
|
||||||
|
ls -la "${prefix}/libexec/gcc/x86_64-w64-mingw32/"*/cc1plus >&2 || true
|
||||||
|
df -h "${prefix}" >&2 || true
|
||||||
|
rm -rf "${probe}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
rm -rf "${probe}"
|
||||||
|
echo "MinGW-w64 toolchain OK: $("${compiler}" --version | head -n1)"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -x "${compiler}" ]; then
|
||||||
echo "using the existing MinGW-w64 toolchain at ${prefix}"
|
echo "using the existing MinGW-w64 toolchain at ${prefix}"
|
||||||
else
|
self_check
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
sudo=""
|
sudo=""
|
||||||
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
|
if [ "$(id -u)" -ne 0 ]; then sudo="sudo"; fi
|
||||||
tmp="$(mktemp -d)"
|
tmp="$(mktemp -d)"
|
||||||
@@ -22,12 +43,8 @@ else
|
|||||||
else
|
else
|
||||||
wget -qO "${tmp}/toolchain.tar.xz" "${url}"
|
wget -qO "${tmp}/toolchain.tar.xz" "${url}"
|
||||||
fi
|
fi
|
||||||
mkdir -p "${tmp}/toolchain"
|
|
||||||
tar -xJf "${tmp}/toolchain.tar.xz" -C "${tmp}/toolchain" --strip-components=1
|
|
||||||
${sudo} rm -rf "${prefix}"
|
${sudo} rm -rf "${prefix}"
|
||||||
${sudo} mkdir -p "${prefix}"
|
${sudo} mkdir -p "${prefix}"
|
||||||
${sudo} cp -a "${tmp}/toolchain/." "${prefix}/"
|
${sudo} tar -xJf "${tmp}/toolchain.tar.xz" -C "${prefix}" --strip-components=1
|
||||||
fi
|
|
||||||
|
|
||||||
"${prefix}/bin/x86_64-w64-mingw32-ucrt-g++" --version | head -n1
|
|
||||||
echo "toolchain file: ${prefix}/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.cmake"
|
echo "toolchain file: ${prefix}/usr/local/share/mingw/cmake/x86_64-w64-mingw32-ucrt.cmake"
|
||||||
|
self_check
|
||||||
Reference in new issue
Block a user