From edfab75ccbde4f19061a91292fe430d7fdfbc12d Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 3 Mar 2024 08:17:08 +0900 Subject: [PATCH] windows-gnu: Use latest stable wine and ubuntu 22.04 Fixed with winehq-stable (9.0.0): ``` 0009:err:module:import_dll Library bcryptprimitives.dll (which is needed by L"Z:\\tmp\\test-gcc\\rust\\target\\i686-pc-windows-gnu\\debug\\rust-test.exe") not found 0009:err:module:LdrInitializeThunk Importing dlls for L"Z:\\tmp\\test-gcc\\rust\\target\\i686-pc-windows-gnu\\debug\\rust-test.exe" failed, status c0000135 ``` Fixed with ubuntu 22.04: ``` wine: Call from 00006FFFFFC4FCF8 to unimplemented function KERNEL32.dll.WaitOnAddress, aborting wine: Call from 00006FFFFFC4FCF8 to unimplemented function KERNEL32.dll.WakeByAddressSingle, aborting ``` --- .github/.cspell/project-dictionary.txt | 2 ++ docker/test/test.sh | 2 +- docker/windows-gnu.Dockerfile | 18 +++++++++++++----- docker/windows-gnullvm.Dockerfile | 18 +++++++++++++----- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/.cspell/project-dictionary.txt b/.github/.cspell/project-dictionary.txt index cadf0fe..ada6da6 100644 --- a/.github/.cspell/project-dictionary.txt +++ b/.github/.cspell/project-dictionary.txt @@ -36,6 +36,7 @@ Icelake INLINES isnan isystem +keyrings keyserver lclang LDFLAGS @@ -134,6 +135,7 @@ virt wasmtime wchar WINEBOOT +winehq WINEPATH WINEPREFIX wineserver diff --git a/docker/test/test.sh b/docker/test/test.sh index ed3d781..15a452a 100755 --- a/docker/test/test.sh +++ b/docker/test/test.sh @@ -1077,7 +1077,7 @@ case "${RUST_TARGET}" in assert_file_info 'for MS Windows' "${bin}" else case "${RUST_TARGET}" in - aarch64-*) assert_file_info 'data' "${bin}" ;; # TODO: ? + aarch64-*) assert_file_info 'Aarch64 COFF object file' "${bin}" ;; i686-*) assert_file_info 'Intel 80386 COFF object file' "${bin}" ;; x86_64*) assert_file_info 'Intel amd64 COFF object file' "${bin}" ;; *) bail "unrecognized target '${RUST_TARGET}'" ;; diff --git a/docker/windows-gnu.Dockerfile b/docker/windows-gnu.Dockerfile index 8cd79de..02ba0ee 100644 --- a/docker/windows-gnu.Dockerfile +++ b/docker/windows-gnu.Dockerfile @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 OR MIT ARG RUST_TARGET -ARG UBUNTU_VERSION=20.04 +ARG UBUNTU_VERSION=22.04 ARG TOOLCHAIN_TAG=dev ARG HOST_ARCH=amd64 @@ -55,11 +55,19 @@ case "${dpkg_arch##*-}" in ;; *) echo >&2 "unsupported architecture '${dpkg_arch}'" && exit 1 ;; esac -# See https://wiki.winehq.org/Ubuntu when install the latest wine. +# Install the latest wine: https://wiki.winehq.org/Ubuntu +codename=$(grep '^VERSION_CODENAME=' /etc/os-release | sed 's/^VERSION_CODENAME=//') +mkdir -pm755 /etc/apt/keyrings +curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://dl.winehq.org/wine-builds/winehq.key \ + | tee /etc/apt/keyrings/winehq-archive.key >/dev/null +curl --proto '=https' --tlsv1.2 -fsSLR --retry 10 --retry-connrefused "https://dl.winehq.org/wine-builds/ubuntu/dists/${codename}/winehq-${codename}.sources" \ + | tee "/etc/apt/sources.list.d/winehq-${codename}.sources" >/dev/null apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \ - wine-stable \ - wine32 \ - wine64 + winehq-stable \ +# apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \ +# wine-stable \ +# wine32 \ +# wine64 wine --version EOF ARG RUST_TARGET diff --git a/docker/windows-gnullvm.Dockerfile b/docker/windows-gnullvm.Dockerfile index 4f1255a..f6fe13a 100644 --- a/docker/windows-gnullvm.Dockerfile +++ b/docker/windows-gnullvm.Dockerfile @@ -6,7 +6,7 @@ # - https://github.com/rust-lang/rust/blob/1.70.0/src/doc/rustc/src/platform-support/pc-windows-gnullvm.md ARG RUST_TARGET -ARG UBUNTU_VERSION=20.04 +ARG UBUNTU_VERSION=22.04 ARG TOOLCHAIN_TAG=dev # https://github.com/mstorsjo/llvm-mingw/releases @@ -68,11 +68,19 @@ esac case "${RUST_TARGET}" in aarch64* | arm64*) ;; *) - # See https://wiki.winehq.org/Ubuntu when install the latest wine. + # Install the latest wine: https://wiki.winehq.org/Ubuntu + codename=$(grep '^VERSION_CODENAME=' /etc/os-release | sed 's/^VERSION_CODENAME=//') + mkdir -pm755 /etc/apt/keyrings + curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://dl.winehq.org/wine-builds/winehq.key \ + | tee /etc/apt/keyrings/winehq-archive.key >/dev/null + curl --proto '=https' --tlsv1.2 -fsSLR --retry 10 --retry-connrefused "https://dl.winehq.org/wine-builds/ubuntu/dists/${codename}/winehq-${codename}.sources" \ + | tee "/etc/apt/sources.list.d/winehq-${codename}.sources" >/dev/null apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \ - wine-stable \ - wine32 \ - wine64 + winehq-stable \ + # apt-get -o Acquire::Retries=10 -qq update && apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends \ + # wine-stable \ + # wine32 \ + # wine64 wine --version ;; esac