Skip to content

Commit

Permalink
Support windows-gnu/windows-gnullvm targets on ubuntu-24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Dec 25, 2024
1 parent dd526fc commit 7898efc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 35 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
push:
branches:
- main
- dev
- dev*
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
Expand Down Expand Up @@ -230,13 +230,25 @@ jobs:
# Linux host:
# - target: i686-pc-windows-gnu
- target: x86_64-pc-windows-gnu
os: ubuntu-24.04
- target: x86_64-pc-windows-gnu
os: ubuntu-22.04
- target: x86_64-pc-windows-gnu
runner: wine@9.3
- target: x86_64-pc-windows-gnu
wine: '9.0.0.0'
- target: x86_64-pc-windows-gnullvm
os: ubuntu-24.04
- target: x86_64-pc-windows-gnullvm
os: ubuntu-22.04
- target: i686-pc-windows-gnullvm
os: ubuntu-24.04
- target: i686-pc-windows-gnullvm
os: ubuntu-22.04
- target: aarch64-pc-windows-gnullvm
os: ubuntu-24.04
- target: aarch64-pc-windows-gnullvm
os: ubuntu-22.04
# prettier-ignore
exclude:
# Linker error "unsupported ISA subset `z'" since nightly-2023-08-09 (LLVM 17)
Expand Down Expand Up @@ -326,12 +338,8 @@ jobs:
- { target: x86_64-pc-windows-gnu, container: 'debian:10-slim' }
- { target: x86_64-pc-windows-gnullvm, container: 'ubuntu:18.04' }
- { target: x86_64-pc-windows-gnullvm, container: 'debian:10-slim' }
# winehq now supports noble but 9.0.0 is not available in it
# https://dl.winehq.org/wine-builds/ubuntu/dists/noble/main/binary-amd64
# TODO: ubuntu repository's wine is 9.0.0, so we can use it
# https://packages.ubuntu.com/en/noble/wine
# TODO: wine: could not load kernel32.dll
- { target: x86_64-pc-windows-gnu, container: 'ubuntu:24.04' }
- { target: x86_64-pc-windows-gnullvm, container: 'ubuntu:24.04' }
# Linker error "unsupported ISA subset `z'" since nightly-2023-08-09 (LLVM 17)
- { target: riscv64gc-unknown-linux-gnu, container: 'ubuntu:20.04' }
# sparc64-linux-gnu-gcc: error: 20210110/32: No such file or directory
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ Only specifying a major version is supported.

| target | host | runner | note |
| ------ | ---- | ------ | ---- |
| `x86_64-pc-windows-gnu` | *Windows*, Ubuntu (22.04), Debian (11, 12) [1] | native (Windows host) / wine (Linux host) | |
| `x86_64-pc-windows-gnu` | *Windows*, Ubuntu (22.04, 24.04), Debian (11, 12) [1] | native (Windows host) / wine (Linux host) | |

[1] [GCC 10](https://packages.ubuntu.com/en/jammy/gcc-mingw-w64-base), [MinGW-w64 8](https://packages.ubuntu.com/en/jammy/mingw-w64-x86-64-dev) for Ubuntu 22.04. [GCC 10](https://packages.debian.org/en/bullseye/gcc-mingw-w64-base), [MinGW-w64 8](https://packages.debian.org/en/bullseye/mingw-w64-x86-64-dev) for Debian 11. [GCC 12](https://packages.debian.org/en/bookworm/gcc-mingw-w64-base), [MinGW-w64 10](https://packages.debian.org/en/bookworm/mingw-w64-x86-64-dev) for Debian 12.<br>

Expand Down Expand Up @@ -457,9 +457,9 @@ You can select/pin the version by using `wine` input option, or `@` syntax in `r

| target | host | runner | note |
| ------ | ---- | ------ | ---- |
| `aarch64-pc-windows-gnullvm` | Ubuntu (22.04) | wine | |
| `i686-pc-windows-gnullvm` | Ubuntu (22.04) | wine | |
| `x86_64-pc-windows-gnullvm` | Ubuntu (22.04) | wine | |
| `aarch64-pc-windows-gnullvm` | Ubuntu (22.04, 24.04) | wine | |
| `i686-pc-windows-gnullvm` | Ubuntu (22.04, 24.04) | wine | |
| `x86_64-pc-windows-gnullvm` | Ubuntu (22.04, 24.04) | wine | |

For the `wine` runner for {i686,x86_64}-pc-windows-gnullvm, see ["wine runner" section for windows-gnu targets](#wine-runner).

Expand Down
56 changes: 31 additions & 25 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -577,38 +577,44 @@ EOF
_sudo dpkg --add-architecture i386
distro=$(grep '^ID=' /etc/os-release | cut -d= -f2)
codename=$(grep '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2)
_sudo mkdir -pm755 /etc/apt/keyrings
if ! type -P curl &>/dev/null; then
apt_packages+=(ca-certificates curl)
install_apt_packages
fi
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://dl.winehq.org/wine-builds/winehq.key \
| _sudo tee /etc/apt/keyrings/winehq-archive.key >/dev/null
retry curl --proto '=https' --tlsv1.2 -fsSLR --retry 10 --retry-connrefused "https://dl.winehq.org/wine-builds/${distro}/dists/${codename}/winehq-${codename}.sources" \
| _sudo tee "/etc/apt/sources.list.d/winehq-${codename}.sources" >/dev/null
case "${runner}" in
'' | wine) wine_version="${INPUT_WINE:-"${default_wine_version}"}" ;;
wine@*) wine_version="${runner#*@}" ;;
*) bail "unrecognized runner '${runner}'" ;;
esac
if [[ "${wine_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
wine_branch=stable
elif [[ "${wine_version}" =~ ^[0-9]+\.[0-9]+$ ]]; then
wine_branch=devel
if [[ "${codename}" == 'noble' ]] && [[ "${wine_version}" == '9.0.0.0' ]]; then
# winehq supports noble but 9.0.0 is not available in it
# https://dl.winehq.org/wine-builds/ubuntu/dists/noble/main/binary-amd64
apt_packages+=(wine wine32 wine64)
else
bail "unrecognized Wine version '${wine_version}'"
_sudo mkdir -pm755 /etc/apt/keyrings
if ! type -P curl &>/dev/null; then
apt_packages+=(ca-certificates curl)
install_apt_packages
fi
retry curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused https://dl.winehq.org/wine-builds/winehq.key \
| _sudo tee /etc/apt/keyrings/winehq-archive.key >/dev/null
retry curl --proto '=https' --tlsv1.2 -fsSLR --retry 10 --retry-connrefused "https://dl.winehq.org/wine-builds/${distro}/dists/${codename}/winehq-${codename}.sources" \
| _sudo tee "/etc/apt/sources.list.d/winehq-${codename}.sources" >/dev/null
if [[ "${wine_version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$ ]]; then
wine_branch=stable
elif [[ "${wine_version}" =~ ^[0-9]+\.[0-9]+$ ]]; then
wine_branch=devel
else
bail "unrecognized Wine version '${wine_version}'"
fi
# The suffix is 1 in most cases, rarely 2.
# https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/main/binary-amd64
# https://dl.winehq.org/wine-builds/ubuntu/dists/focal/main/binary-amd64
wine_build_suffix=1
apt_packages+=(
"winehq-${wine_branch}=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}-amd64=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}-i386=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}-dev=${wine_version}~${codename}-${wine_build_suffix}"
)
fi
# The suffix is 1 in most cases, rarely 2.
# https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/main/binary-amd64
# https://dl.winehq.org/wine-builds/ubuntu/dists/focal/main/binary-amd64
wine_build_suffix=1
apt_packages+=(
"winehq-${wine_branch}=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}-amd64=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}-i386=${wine_version}~${codename}-${wine_build_suffix}"
"wine-${wine_branch}-dev=${wine_version}~${codename}-${wine_build_suffix}"
)
install_apt_packages
x wine --version
wineboot=wineboot
Expand Down

0 comments on commit 7898efc

Please sign in to comment.