From 18f05b2a0bff3cd6462c173b518666c32eaea279 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 13 Sep 2023 08:38:48 +1200 Subject: [PATCH] Support CentOS 8 and 9 for release-testing Supporting RHEL directly is a pain due to subscription requirements, and Fedora doesn't seem to have AMIs available anymore --- release-process/distro-configs/centos8.json | 16 ++++++++++++++++ release-process/distro-configs/centos9.json | 15 +++++++++++++++ release-process/rr-testing.sh | 3 ++- release-process/test-system.py | 12 +++++++++--- src/test/invalid_interpreter.c | 2 ++ 5 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 release-process/distro-configs/centos8.json create mode 100644 release-process/distro-configs/centos9.json diff --git a/release-process/distro-configs/centos8.json b/release-process/distro-configs/centos8.json new file mode 100644 index 00000000000..a0e6393c53b --- /dev/null +++ b/release-process/distro-configs/centos8.json @@ -0,0 +1,16 @@ +{ + "name": "CentOS Stream 8", + "ami_owner": "125523088429", + "ami_name_pattern": "CentOS Stream 8 *", + "user": "centos", + "staticlibs": false, + "setup_commands": [ + "cloud-init status --wait", + "sudo dnf config-manager --set-enabled powertools", + "sudo dnf install -y epel-release epel-next-release", + "sudo dnf update -y" + ], + "install_build_deps": "sudo dnf install -y rpm ccache cmake gcc gcc-c++ gdb glibc-devel glibc-devel.i686 libstdc++-devel libstdc++-devel.i686 libstdc++-static libstdc++-static.i686 zlib-devel git python3 python3-pexpect rpm-build ninja-build capnproto capnproto-libs capnproto-devel", + "install_test_deps": "sudo dnf install -y gtk3 dbus-glib xorg-x11-utils gnutls-devel libacl-devel openldap-devel tigervnc-server-minimal curl tar bzip2 libreoffice-writer", + "exclude_tests": ["x86/pkeys.*"] +} diff --git a/release-process/distro-configs/centos9.json b/release-process/distro-configs/centos9.json new file mode 100644 index 00000000000..55360d476f2 --- /dev/null +++ b/release-process/distro-configs/centos9.json @@ -0,0 +1,15 @@ +{ + "name": "CentOS Stream 9", + "ami_owner": "125523088429", + "ami_name_pattern": "CentOS Stream 9 *", + "user": "ec2-user", + "staticlibs": false, + "setup_commands": [ + "cloud-init status --wait", + "sudo dnf config-manager --set-enabled crb", + "sudo dnf install -y epel-release epel-next-release", + "sudo dnf update -y" + ], + "install_build_deps": "sudo dnf install -y rpm ccache cmake gcc gcc-c++ gdb glibc-devel glibc-devel.i686 libstdc++-devel libstdc++-devel.i686 libstdc++-static libstdc++-static.i686 zlib-devel git python3 python3-pexpect rpm-build ninja-build capnproto capnproto-libs capnproto-devel", + "install_test_deps": "sudo dnf install -y gtk3 dbus-glib xorg-x11-utils gnutls-devel libacl-devel openldap-devel tigervnc-server-minimal curl tar bzip2 libreoffice-writer" +} diff --git a/release-process/rr-testing.sh b/release-process/rr-testing.sh index 7e12df7ade6..8f8d373c023 100644 --- a/release-process/rr-testing.sh +++ b/release-process/rr-testing.sh @@ -2,6 +2,7 @@ # # Requires variables and functions to be set. See test-system.py. # $git_revision : git revision to check out, build and test +# $staticlibs : TRUE or FALSE to build with static libs # $build_dist : 1 if we should build dist packages, 0 otherwise # $test_firefox : 1 to run firefox tests, 0 to skip # $ctest_options : options to pass to ctest, e.g to exclude certain tests @@ -29,7 +30,7 @@ git checkout $git_revision rm -rf ~/obj || true mkdir ~/obj cd ~/obj -cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE -Dstaticlibs=TRUE -Dstrip=TRUE ../rr +cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE -Dstaticlibs=$staticlibs -Dstrip=TRUE ../rr ninja # Test deps are installed in parallel with our build. diff --git a/release-process/test-system.py b/release-process/test-system.py index a70818984da..d45be71900f 100755 --- a/release-process/test-system.py +++ b/release-process/test-system.py @@ -76,14 +76,15 @@ def wait_for_ssh(self): self.instance.wait_until_running() self.instance.reload() print('Started VM %s "%s" at %s'%(self.instance.id, self.distro_name, self.instance.public_ip_address), file=sys.stderr) - for retries in range(30): + for retries in range(60): result = subprocess.run(self.ssh_command() + ['true'], stdin=subprocess.DEVNULL, stderr=subprocess.PIPE) if result.returncode == 0: self.ssh_ready = True - break - if b'Connection refused' not in result.stderr: + return + if b'Connection refused' not in result.stderr and b'reset by peer' not in result.stderr: raise Exception('SSH connection failed:\n%s'%result.stderr.decode('utf-8')) time.sleep(1) + raise Exception('Too many retries, cannot connect via SSH') def ssh(self, cmd, input): """Run `cmd` (command + args list) via SSH and wait for it to finish. @@ -137,6 +138,10 @@ def config_script_function(config_key): raise ValueError('Invalid config entry %s: %s' % (config_key, entry)) return ('function %s {\n%s\n}' % (config_key, '\n'.join(lines))) +if args.dist_files_dir and not distro_config.get('staticlibs', True): + print('Dist builds must use staticlibs, aborting', file=sys.stderr) + sys.exit(1) + vm = Ec2Vm(args.machine_type, args.architecture, distro_config, args.keypair_pem_file) success = False try: @@ -148,6 +153,7 @@ def config_script_function(config_key): config_script_function('install_build_deps'), config_script_function('install_test_deps'), 'git_revision=%s'%args.git_revision, + 'staticlibs=%s'%('TRUE' if distro_config.get('staticlibs', True) else 'FALSE'), 'build_dist=%d'%(1 if args.dist_files_dir is not None else 0), 'test_firefox=%d'%(1 if args.architecture == 'x86_64' else 0), 'ctest_options="%s"'%' '.join('-E %s'%r for r in exclude_tests), diff --git a/src/test/invalid_interpreter.c b/src/test/invalid_interpreter.c index 1983baa0be7..ff5fec982dc 100644 --- a/src/test/invalid_interpreter.c +++ b/src/test/invalid_interpreter.c @@ -23,6 +23,8 @@ void callback(__attribute__((unused)) uint64_t env, char* name, map_properties_t int main(void) { page_size = sysconf(_SC_PAGESIZE); + /* Trigger dl_runtime_resolve etc for mmap */ + mmap(NULL, page_size, PROT_NONE, MAP_ANONYMOUS, -1, 0); FILE* maps_file = fopen("/proc/self/maps", "r"); iterate_maps(0, callback, maps_file); test_assert(n_to_unmap > 0);