Skip to content

Commit

Permalink
Update CI to QEMU 8.1.0. (#843)
Browse files Browse the repository at this point in the history
* Update CI to QEMU 8.1.0.

* Patch qemu to properly handle `O_LARGEFILE` on aarch64.

* Remove a redundant ubuntu-1.63 from the CI.

* Patch qemu to properly handle `TCGETS2` on powerpc.

And in the libc backend, ensure that input_speed and output_speed
are set after a `tcgetattr` call.

And, work around the fact that even with the patches, QEMU is still
not setting `input_speed`/`output_speed` in `TCGETS2`, so set them
manually when we can.
  • Loading branch information
sunfishcode authored Sep 21, 2023
1 parent e1226f1 commit 9247191
Show file tree
Hide file tree
Showing 7 changed files with 441 additions and 25 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ jobs:
name: Test
runs-on: ${{ matrix.os }}
env:
QEMU_BUILD_VERSION: 8.0.2
QEMU_BUILD_VERSION: 8.1.0
# Enabling testing of experimental features.
RUSTFLAGS: --cfg rustix_use_experimental_features
strategy:
matrix:
build: [ubuntu, ubuntu-20.04, i686-linux, aarch64-linux, powerpc64le-linux, riscv64-linux, s390x-linux, arm-linux, ubuntu-stable, ubuntu-1.63, i686-linux-stable, aarch64-linux-stable, riscv64-linux-stable, s390x-linux-stable, powerpc64le-linux-stable, arm-linux-stable, ubuntu-1.63, i686-linux-1.63, aarch64-linux-1.63, riscv64-linux-1.63, s390x-linux-1.63, powerpc64le-linux-1.63, arm-linux-1.63, macos-latest, macos-11, windows, windows-2019]
build: [ubuntu, ubuntu-20.04, i686-linux, aarch64-linux, powerpc64le-linux, riscv64-linux, s390x-linux, arm-linux, ubuntu-stable, i686-linux-stable, aarch64-linux-stable, riscv64-linux-stable, s390x-linux-stable, powerpc64le-linux-stable, arm-linux-stable, ubuntu-1.63, i686-linux-1.63, aarch64-linux-1.63, riscv64-linux-1.63, s390x-linux-1.63, powerpc64le-linux-1.63, arm-linux-1.63, macos-latest, macos-11, windows, windows-2019]
include:
- build: ubuntu
os: ubuntu-latest
Expand Down Expand Up @@ -470,6 +470,8 @@ jobs:
patch -p1 < $GITHUB_WORKSPACE/ci/translate-errno.patch
patch -p1 < $GITHUB_WORKSPACE/ci/getsockopt-timeouts.patch
patch -p1 < $GITHUB_WORKSPACE/ci/s390x-stat-have-nsec.patch
patch -p1 < $GITHUB_WORKSPACE/ci/aarch64-o-largefile.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tcgets2-tcsets2.patch
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache }}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
ninja -C build install
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -542,7 +544,7 @@ jobs:
env:
# -D warnings is commented out in our install-rust action; re-add it here.
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
QEMU_BUILD_VERSION: 8.0.2
QEMU_BUILD_VERSION: 8.1.0
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -601,6 +603,8 @@ jobs:
patch -p1 < $GITHUB_WORKSPACE/ci/translate-errno.patch
patch -p1 < $GITHUB_WORKSPACE/ci/getsockopt-timeouts.patch
patch -p1 < $GITHUB_WORKSPACE/ci/s390x-stat-have-nsec.patch
patch -p1 < $GITHUB_WORKSPACE/ci/aarch64-o-largefile.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tcgets2-tcsets2.patch
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache }}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
ninja -C build install
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -631,7 +635,7 @@ jobs:
RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings -D elided-lifetimes-in-paths
RUSTDOCFLAGS: --cfg rustix_use_experimental_asm
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
QEMU_BUILD_VERSION: 8.0.2
QEMU_BUILD_VERSION: 8.1.0
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -690,6 +694,8 @@ jobs:
patch -p1 < $GITHUB_WORKSPACE/ci/translate-errno.patch
patch -p1 < $GITHUB_WORKSPACE/ci/getsockopt-timeouts.patch
patch -p1 < $GITHUB_WORKSPACE/ci/s390x-stat-have-nsec.patch
patch -p1 < $GITHUB_WORKSPACE/ci/aarch64-o-largefile.patch
patch -p1 < $GITHUB_WORKSPACE/ci/tcgets2-tcsets2.patch
./configure --target-list=${{ matrix.qemu_target }} --prefix=${{ runner.tool_cache }}/qemu --disable-tools --disable-slirp --disable-fdt --disable-capstone --disable-docs
ninja -C build install
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
Expand Down
17 changes: 17 additions & 0 deletions ci/aarch64-o-largefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
From Dan Gohman <[email protected]>
Subject: [PATCH] Correct the definition of `O_LARGEFILE` on aarch64

This fixes `fcntl` with `F_GETFL` from spuriously returning `O_NOFOLLOW`
on hosts such as x86_64.

diff -ur a/linux-user/aarch64/target_fcntl.h b/linux-user/aarch64/target_fcntl.h
--- a/linux-user/aarch64/target_fcntl.h
+++ b/linux-user/aarch64/target_fcntl.h
@@ -11,6 +11,7 @@
#define TARGET_O_DIRECTORY 040000 /* must be a directory */
#define TARGET_O_NOFOLLOW 0100000 /* don't follow links */
#define TARGET_O_DIRECT 0200000 /* direct disk access hint */
+#define TARGET_O_LARGEFILE 0400000

#include "../generic/fcntl.h"
#endif
Loading

0 comments on commit 9247191

Please sign in to comment.