diff --git a/.github/workflows/bincheck.yml b/.github/workflows/bincheck.yml index 3ad78a4b0ade..41675c21c87b 100644 --- a/.github/workflows/bincheck.yml +++ b/.github/workflows/bincheck.yml @@ -13,7 +13,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: sudo apt-get update && sudo apt-get install -y qemu-system-x86 - run: cd build/release/bincheck && ./test-linux ${{ github.ref_name }} ${{ github.sha }} darwin: diff --git a/build/release/bincheck/README.md b/build/release/bincheck/README.md index 775ca7a3bb23..84a6391b0726 100644 --- a/build/release/bincheck/README.md +++ b/build/release/bincheck/README.md @@ -10,58 +10,3 @@ sanity checks are: bincheck action is triggered when a new tag with `v` prefix is created. Check https://github.com/cockroachdb/cockroach/actions after a release is published. - - -## The nitty-gritty - -### Overview - -For the MacOS and Windows binaries, the mechanics involved are simple. We ask -GitHub Actions to spin us up a MacOS or Windows runner, download the -appropriate pre-built `cockroach` binary, and run our sanity checks. - -Linux is more complicated, not out of necessity, but out of ambition. We co-opt -the Linux verification step to additionally test support for pre-SSE4.2 -CPUs. This requires emulating such a CPU, and Linux is the only -operating system that is feasible to run under emulation. Windows and MacOS have -prohibitively slow boot times, and, perhaps more importantly, Windows and MacOS -install media are not freely available. - -So, with the help of [Buildroot], an embedded Linux build manager, this -repository ships an [8.7MB Linux distribution][linux-image] that's capable of -running under [QEMU] and launching our pre-built CockroachDB binaries. To verify -the Linux binaries, we first boot this Linux distribution on an emulated -pre-SSE4.2 CPU (`qemu-system-x86_64 -cpu qemu64,-sse4.2`), then run our sanity -checks from inside this VM. - -SSE4.2 support is particularly important in CockroachDB, -since RocksDB internally uses a [CRC32C checksum][crc32c] to protect against -data corruption. SSE4.2 includes hardware support for computing CRC32C -checksums, but is only available on CPUs released after November 2008. Producing -a binary that can dynamically switch between the SSE4.2 and non-SSE4.2 -implementations at runtime [has proven difficult][issue-15589]. - - -### Updating the Linux image - -After [installing Buildroot][buildroot-install]: - -```shell -$ make qemu_x86_64_glibc_defconfig BR2_EXTERNAL=buildroot -$ make menuconfig # Only if configuration changes are necessary. -$ make -$ cp output/images/bzImage images/qemu_x86_64_glibc_bzImage -``` - -At the time of writing, `qemu_x86_64_glibc_defconfig` instructed Buildroot to -build a Linux 4.9 kernel, install Bash and OpenSSH into userland, and configure -sshd to boot at startup and allow passwordless `root` authentication. -`/etc/fstab` is modified to mount the first hard drive at `/bincheck`, assuming -it's a FAT volume. - -[buildroot-install]: https://buildroot.org/download.html -[issue-15589]: https://github.com/cockroachdb/cockroach/issues/15589 -[linux-image]: ./images/qemu_x86_64_glibc_bzImage -[Buildroot]: https://buildroot.org -[CRC32C]: http://www.evanjones.ca/crc32c.html -[QEMU]: http://qemu.org diff --git a/build/release/bincheck/bincheck b/build/release/bincheck/bincheck index d3e267daf3c8..24c9f8e96af2 100755 --- a/build/release/bincheck/bincheck +++ b/build/release/bincheck/bincheck @@ -34,7 +34,7 @@ echo "" # Start node with encryption enabled. "$cockroach" start-single-node --insecure --listening-url-file="$urlfile" --enterprise-encryption=path=cockroach-data,key=aes-128.key,old-key=plain --pid-file="$pidfile" & -trap "kill -9 $! &> /dev/null" EXIT +trap "kill -9 $! || true" EXIT for i in {0..3} do [[ -f "$urlfile" ]] && break @@ -58,7 +58,7 @@ diff -u expected actual # Attempt a clean shutdown for good measure. We'll force-kill in the atexit # handler if this fails. -cat "$pidfile" | xargs kill -TERM +kill -TERM $(cat "$pidfile") || true trap - EXIT # Verify reported version matches expected version. diff --git a/build/release/bincheck/buildroot.patch b/build/release/bincheck/buildroot.patch deleted file mode 100644 index abaa744445ba..000000000000 --- a/build/release/bincheck/buildroot.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/package/ncurses/Config.in b/package/ncurses/Config.in -index 92be164..b3333f1 100644 ---- a/package/ncurses/Config.in -+++ b/package/ncurses/Config.in -@@ -23,4 +23,9 @@ config BR2_PACKAGE_NCURSES_TARGET_PROGS - help - Include ncurses programs in target (clear, reset, tput, ...) - -+config BR2_PACKAGE_NCURSES_TERMLIB -+ bool "separate terminfo library" -+ help -+ Build a separate terminfo library (libtinfo) -+ - endif -diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk -index 94c8c9a..c1b61aa 100644 ---- a/package/ncurses/ncurses.mk -+++ b/package/ncurses/ncurses.mk -@@ -27,6 +27,7 @@ NCURSES_CONF_OPTS = \ - --enable-pc-files \ - --with-pkg-config-libdir="/usr/lib/pkgconfig" \ - $(if $(BR2_PACKAGE_NCURSES_TARGET_PROGS),,--without-progs) \ -+ $(if $(BR2_PACKAGE_NCURSES_TERMLIB),--with-termlib) \ - --without-manpages - - ifeq ($(BR2_STATIC_LIBS),y) -@@ -65,7 +66,7 @@ NCURSES_TERMINFO_FILES = \ - ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y) - NCURSES_CONF_OPTS += --enable-widec - NCURSES_LIB_SUFFIX = w --NCURSES_LIBS = ncurses menu panel form -+NCURSES_LIBS = ncurses menu panel form $(if $(BR2_PACKAGE_NCURSES_TERMLIB),tinfo) - - define NCURSES_LINK_LIBS_STATIC - $(foreach lib,$(NCURSES_LIBS:%=lib%), \ diff --git a/build/release/bincheck/buildroot/Config.in b/build/release/bincheck/buildroot/Config.in deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/build/release/bincheck/buildroot/board/qemu/common/fs-overlay/bincheck/.keep b/build/release/bincheck/buildroot/board/qemu/common/fs-overlay/bincheck/.keep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/build/release/bincheck/buildroot/board/qemu/common/fs-overlay/etc/ssh/sshd_config b/build/release/bincheck/buildroot/board/qemu/common/fs-overlay/etc/ssh/sshd_config deleted file mode 100644 index 5ae17a5a4d05..000000000000 --- a/build/release/bincheck/buildroot/board/qemu/common/fs-overlay/etc/ssh/sshd_config +++ /dev/null @@ -1,3 +0,0 @@ -PasswordAuthentication yes -PermitEmptyPasswords yes -PermitRootLogin yes diff --git a/build/release/bincheck/buildroot/board/qemu/common/post-build.sh b/build/release/bincheck/buildroot/board/qemu/common/post-build.sh deleted file mode 100755 index 6a4758d7d3ea..000000000000 --- a/build/release/bincheck/buildroot/board/qemu/common/post-build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -fstab=$TARGET_DIR/etc/fstab -grep -q /bincheck "$fstab" || cat >> "$fstab" < /dev/null" EXIT - -for i in {0..4} -do - ssh true && break - backoff=$((2 ** i)) - echo "VM not yet available; sleeping for $backoff seconds" - sleep $backoff -done - -ssh /bin/bash -s /bincheck/cockroach "$COCKROACH_VERSION" "$COCKROACH_SHA" < bincheck +./bincheck ./mnt/cockroach "$COCKROACH_VERSION" "$COCKROACH_SHA"