From 53521a84f45a710fc9fdefc2b7d1ceadc87ea7b0 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Tue, 17 Sep 2024 13:58:47 +0200 Subject: [PATCH 1/5] Pull in composer dependencies before running make tests This is because Makefiles implicitly depend on a distributed tarball (or initialized maintainer/inplace install). Running `make dist` would be a bit too much, so take this shortcut. --- .github/jobs/configure-checks/all.bats | 2 +- .../configure-checks/setup_configure_image.sh | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/jobs/configure-checks/all.bats b/.github/jobs/configure-checks/all.bats index 207650895f..f2445ddb8d 100755 --- a/.github/jobs/configure-checks/all.bats +++ b/.github/jobs/configure-checks/all.bats @@ -210,7 +210,7 @@ compile_assertions_finished () { @test "cgroup library needed" { cgroup_init_find="checking for cgroup_init in -lcgroup... no" cgroup_init_error="configure: error: Linux cgroup library not found." - setup_user + setup repo-install gcc g++ repo-remove libcgroup-dev run run_configure diff --git a/.github/jobs/configure-checks/setup_configure_image.sh b/.github/jobs/configure-checks/setup_configure_image.sh index 6be3f188ef..8853fda72c 100755 --- a/.github/jobs/configure-checks/setup_configure_image.sh +++ b/.github/jobs/configure-checks/setup_configure_image.sh @@ -7,16 +7,23 @@ distro_id=$(grep "^ID=" /etc/os-release) # Install everything for configure and testing case $distro_id in "ID=fedora") - dnf install pkg-config make bats autoconf automake util-linux -y ;; + dnf install -y pkg-config make bats autoconf automake util-linux \ + httpd + ;; *) apt-get update; apt-get full-upgrade -y - apt-get install pkg-config make bats autoconf -y ;; + apt-get install -y pkg-config make bats autoconf composer \ + php-fpm php-gd php-cli php-intl php-mbstring php-mysql \ + php-curl php-json php-xml php-zip + ;; esac -# Build the configure file +# Start from a configured, distribution-ready source tree. Ideally, +# we'd like to call `make dist` but that depends on LaTeX for building +# the documentation, so take a shortcut. make configure -# Install extra assert statements for bots +# Install extra assert statements for bats cp submit/assert.bash .github/jobs/configure-checks/ # Run the configure tests for this usecase From 2a27cd1ee5874f5352553ccd2af8896174d50541 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Wed, 18 Sep 2024 06:03:46 +0200 Subject: [PATCH 2/5] DEBUG --- .github/jobs/configure-checks/all.bats | 8 +++++--- .github/jobs/configure-checks/setup_configure_image.sh | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/jobs/configure-checks/all.bats b/.github/jobs/configure-checks/all.bats index f2445ddb8d..05229996a7 100755 --- a/.github/jobs/configure-checks/all.bats +++ b/.github/jobs/configure-checks/all.bats @@ -1,4 +1,4 @@ -#!/usr/bin/env bats +#!/usr/bin/env bats --trace load 'assert' @@ -46,13 +46,13 @@ run_configure () { repo-install () { args=$(translate $@) - ${cmd} install $args -y >/dev/null + ${cmd} install $args -y } repo-remove () { args=$(translate $@) ${cmd} remove $args -y #>/dev/null if [ "$distro_id" != "ID=fedora" ]; then - apt-get autoremove -y 2>/dev/null + apt-get autoremove -y fi } @@ -178,6 +178,8 @@ compile_assertions_finished () { groupdel ${www_group} || true done repo-install httpd +# grep -E 'nginx|apache' /etc/passwd || true +# grep -E 'nginx|apache' /etc/group || true run ./configure --with-domjudge-user=$u assert_line "checking webserver-group... apache (detected)" assert_line " * webserver group.....: apache" diff --git a/.github/jobs/configure-checks/setup_configure_image.sh b/.github/jobs/configure-checks/setup_configure_image.sh index 8853fda72c..4b12cfb1aa 100755 --- a/.github/jobs/configure-checks/setup_configure_image.sh +++ b/.github/jobs/configure-checks/setup_configure_image.sh @@ -7,8 +7,14 @@ distro_id=$(grep "^ID=" /etc/os-release) # Install everything for configure and testing case $distro_id in "ID=fedora") +# grep -E 'nginx|apache' /etc/passwd || true +# grep -E 'nginx|apache' /etc/group || true + dnf install -y pkg-config make bats autoconf automake util-linux \ httpd + +# grep -E 'nginx|apache' /etc/passwd || true +# grep -E 'nginx|apache' /etc/group || true ;; *) apt-get update; apt-get full-upgrade -y @@ -27,4 +33,4 @@ make configure cp submit/assert.bash .github/jobs/configure-checks/ # Run the configure tests for this usecase -test_path="/__w/domjudge/domjudge" bats .github/jobs/configure-checks/all.bats +test_path="/__w/domjudge/domjudge" bats --trace .github/jobs/configure-checks/all.bats From d3f06c0a6d40b4502ee430c6f70faf9b93b8cf73 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Thu, 19 Sep 2024 06:00:38 +0200 Subject: [PATCH 3/5] TEST --- .github/jobs/configure-checks/setup_configure_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/jobs/configure-checks/setup_configure_image.sh b/.github/jobs/configure-checks/setup_configure_image.sh index 4b12cfb1aa..6043bf0d69 100755 --- a/.github/jobs/configure-checks/setup_configure_image.sh +++ b/.github/jobs/configure-checks/setup_configure_image.sh @@ -11,7 +11,7 @@ case $distro_id in # grep -E 'nginx|apache' /etc/group || true dnf install -y pkg-config make bats autoconf automake util-linux \ - httpd + php-fpm # grep -E 'nginx|apache' /etc/passwd || true # grep -E 'nginx|apache' /etc/group || true From 37e034cb83d944c3dee8cc66c5cfa05872c9fe72 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Thu, 19 Sep 2024 06:38:18 +0200 Subject: [PATCH 4/5] TEST --- .github/jobs/configure-checks/all.bats | 4 ++-- .github/jobs/configure-checks/setup_configure_image.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/jobs/configure-checks/all.bats b/.github/jobs/configure-checks/all.bats index 05229996a7..9fd6ebf2bc 100755 --- a/.github/jobs/configure-checks/all.bats +++ b/.github/jobs/configure-checks/all.bats @@ -178,8 +178,8 @@ compile_assertions_finished () { groupdel ${www_group} || true done repo-install httpd -# grep -E 'nginx|apache' /etc/passwd || true -# grep -E 'nginx|apache' /etc/group || true + grep -E 'nginx|apache' /etc/passwd || true + grep -E 'nginx|apache' /etc/group || true run ./configure --with-domjudge-user=$u assert_line "checking webserver-group... apache (detected)" assert_line " * webserver group.....: apache" diff --git a/.github/jobs/configure-checks/setup_configure_image.sh b/.github/jobs/configure-checks/setup_configure_image.sh index 6043bf0d69..070c77a68d 100755 --- a/.github/jobs/configure-checks/setup_configure_image.sh +++ b/.github/jobs/configure-checks/setup_configure_image.sh @@ -7,14 +7,14 @@ distro_id=$(grep "^ID=" /etc/os-release) # Install everything for configure and testing case $distro_id in "ID=fedora") -# grep -E 'nginx|apache' /etc/passwd || true -# grep -E 'nginx|apache' /etc/group || true + grep -E 'nginx|apache' /etc/passwd || true + grep -E 'nginx|apache' /etc/group || true dnf install -y pkg-config make bats autoconf automake util-linux \ php-fpm -# grep -E 'nginx|apache' /etc/passwd || true -# grep -E 'nginx|apache' /etc/group || true + grep -E 'nginx|apache' /etc/passwd || true + grep -E 'nginx|apache' /etc/group || true ;; *) apt-get update; apt-get full-upgrade -y From 233867a02b0c8a11fae99ffc330e8724db960742 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Thu, 19 Sep 2024 06:47:00 +0200 Subject: [PATCH 5/5] TEST --- .github/jobs/configure-checks/setup_configure_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/jobs/configure-checks/setup_configure_image.sh b/.github/jobs/configure-checks/setup_configure_image.sh index 070c77a68d..a1d10e6274 100755 --- a/.github/jobs/configure-checks/setup_configure_image.sh +++ b/.github/jobs/configure-checks/setup_configure_image.sh @@ -11,7 +11,7 @@ case $distro_id in grep -E 'nginx|apache' /etc/group || true dnf install -y pkg-config make bats autoconf automake util-linux \ - php-fpm + httpd php-fpm grep -E 'nginx|apache' /etc/passwd || true grep -E 'nginx|apache' /etc/group || true