From 0d61635eee23f89660edba74deadd5462ec06c68 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Mon, 20 Oct 2025 02:21:51 +0900 Subject: [PATCH 01/27] Omit SELINUX_PROGS on non SELinux env --- .github/workflows/ignore-intermittent.txt | 2 ++ GNUmakefile | 8 ++------ util/why-skip.md | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ignore-intermittent.txt b/.github/workflows/ignore-intermittent.txt index 0d99da29bf9..7a6eb9d9d42 100644 --- a/.github/workflows/ignore-intermittent.txt +++ b/.github/workflows/ignore-intermittent.txt @@ -5,3 +5,5 @@ tests/rm/rm1 tests/misc/stdbuf tests/misc/usage_vs_getopt tests/misc/tee +tests/misc/invalid-opt +tests/runcon/runcon-no-reorder diff --git a/GNUmakefile b/GNUmakefile index 19f47db4eb4..e520932c7af 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -216,14 +216,10 @@ HASHSUM_PROGS := \ $(info Detected OS = $(OS)) -# Don't build the SELinux programs on macOS (Darwin) and FreeBSD -ifeq ($(filter $(OS),Darwin FreeBSD),$(OS)) - SELINUX_PROGS := -endif - ifneq ($(OS),Windows_NT) PROGS := $(PROGS) $(UNIX_PROGS) -# Build the selinux command even if not on the system +endif +ifeq ($(SELINUX_ENABLED),1) PROGS := $(PROGS) $(SELINUX_PROGS) endif diff --git a/util/why-skip.md b/util/why-skip.md index 915b9460ed4..873e57b5fe4 100644 --- a/util/why-skip.md +++ b/util/why-skip.md @@ -29,6 +29,8 @@ * tests/mkdir/restorecon.sh * tests/misc/selinux.sh * tests/misc/chcon.sh +* tests/misc/invalid-opt +* tests/runcon/runcon-no-reorder.sh * tests/install/install-Z-selinux.sh * tests/install/install-C-selinux.sh * tests/id/no-context.sh From 796c76100969f40bff45719fb5ef220f259365ac Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Mon, 20 Oct 2025 02:27:54 +0900 Subject: [PATCH 02/27] Test make without libselinux --- .github/workflows/CICD.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 99ae0a48a65..1b90be43363 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -273,10 +273,10 @@ jobs: target: aarch64-unknown-linux-gnu - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - - name: Install/setup prerequisites + - name: Install/setup prerequisites (no libselinux) shell: bash run: | - sudo apt-get -y update ; sudo apt-get -y install libselinux1-dev + sudo apt-get -y update - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - name: "`make build`" @@ -308,6 +308,8 @@ jobs: run: | set -x DESTDIR=/tmp/ make PROFILE=release COMPLETIONS=n MANPAGES=n install + # Check that SELinux progs are missing + ! test -f /tmp/usr/local/bin/chcon # Check that the utils are present test -f /tmp/usr/local/bin/tty # Check that the manpage is not present From 34d3f0c52303eb4f2e3959efe90dd573a21377a4 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Mon, 20 Oct 2025 19:07:33 +0900 Subject: [PATCH 03/27] Drop runcon from tests_invalid_opt.patch for non-SELinux env --- .github/workflows/ignore-intermittent.txt | 1 - util/gnu-patches/tests_invalid_opt.patch | 8 ++++++++ util/why-skip.md | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ignore-intermittent.txt b/.github/workflows/ignore-intermittent.txt index 7a6eb9d9d42..226443ebfb2 100644 --- a/.github/workflows/ignore-intermittent.txt +++ b/.github/workflows/ignore-intermittent.txt @@ -5,5 +5,4 @@ tests/rm/rm1 tests/misc/stdbuf tests/misc/usage_vs_getopt tests/misc/tee -tests/misc/invalid-opt tests/runcon/runcon-no-reorder diff --git a/util/gnu-patches/tests_invalid_opt.patch b/util/gnu-patches/tests_invalid_opt.patch index c23476674e7..c1dc5bd6b21 100644 --- a/util/gnu-patches/tests_invalid_opt.patch +++ b/util/gnu-patches/tests_invalid_opt.patch @@ -2,6 +2,14 @@ Index: gnu/tests/misc/invalid-opt.pl =================================================================== --- gnu.orig/tests/misc/invalid-opt.pl +++ gnu/tests/misc/invalid-opt.pl +@@ -34,7 +34,6 @@ + expr => 0, + nice => 125, + nohup => 125, +- runcon => 125, + sort => 2, + stdbuf => 125, + test => 0, @@ -74,23 +74,13 @@ foreach my $prog (@built_programs) defined $out or $out = ''; diff --git a/util/why-skip.md b/util/why-skip.md index 873e57b5fe4..a43a243f56d 100644 --- a/util/why-skip.md +++ b/util/why-skip.md @@ -29,7 +29,6 @@ * tests/mkdir/restorecon.sh * tests/misc/selinux.sh * tests/misc/chcon.sh -* tests/misc/invalid-opt * tests/runcon/runcon-no-reorder.sh * tests/install/install-Z-selinux.sh * tests/install/install-C-selinux.sh From 8dd81de724cdecba4e82142a0cec08736b9d67d5 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:00:57 +0900 Subject: [PATCH 04/27] build-gnu.sh: Force build SELINUX_PROGS for tests --- util/build-gnu.sh | 2 ++ util/gnu-patches/tests_invalid_opt.patch | 8 -------- util/why-skip.md | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 734088252f4..813e9b97c51 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -136,6 +136,8 @@ cd - # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" +# Foece-add SELINUX_PROGS for tests +"${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" UTILS="runcon chcon" touch g echo "stat with selinux support" ./target/debug/stat -c%C g || true diff --git a/util/gnu-patches/tests_invalid_opt.patch b/util/gnu-patches/tests_invalid_opt.patch index c1dc5bd6b21..c23476674e7 100644 --- a/util/gnu-patches/tests_invalid_opt.patch +++ b/util/gnu-patches/tests_invalid_opt.patch @@ -2,14 +2,6 @@ Index: gnu/tests/misc/invalid-opt.pl =================================================================== --- gnu.orig/tests/misc/invalid-opt.pl +++ gnu/tests/misc/invalid-opt.pl -@@ -34,7 +34,6 @@ - expr => 0, - nice => 125, - nohup => 125, -- runcon => 125, - sort => 2, - stdbuf => 125, - test => 0, @@ -74,23 +74,13 @@ foreach my $prog (@built_programs) defined $out or $out = ''; diff --git a/util/why-skip.md b/util/why-skip.md index a43a243f56d..915b9460ed4 100644 --- a/util/why-skip.md +++ b/util/why-skip.md @@ -29,7 +29,6 @@ * tests/mkdir/restorecon.sh * tests/misc/selinux.sh * tests/misc/chcon.sh -* tests/runcon/runcon-no-reorder.sh * tests/install/install-Z-selinux.sh * tests/install/install-C-selinux.sh * tests/id/no-context.sh From 675e488124ecaec2f3b56fa8e9c3113fe1556062 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:06:49 +0900 Subject: [PATCH 05/27] Remove typo of build-gnu.sh --- util/build-gnu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 813e9b97c51..db43af05223 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -136,7 +136,7 @@ cd - # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" -# Foece-add SELINUX_PROGS for tests +# Add missing SELINUX_PROGS for tests "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" UTILS="runcon chcon" touch g echo "stat with selinux support" From ef3966444f7fe4cefb92b245f97f29e870b5e246 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:26:13 +0900 Subject: [PATCH 06/27] build-gnu.sh: Addmossing SELINUX_PROGS by cargo --- util/build-gnu.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index db43af05223..8e63dac5279 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -133,11 +133,10 @@ else quilt push -a || { echo "Failed to apply patches"; exit 1; } fi cd - - +# Add missing SELINUX_PROGS for tests +cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon -p uu_chcon # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" -# Add missing SELINUX_PROGS for tests -"${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" UTILS="runcon chcon" touch g echo "stat with selinux support" ./target/debug/stat -c%C g || true From 0b10c8cfa4acacad45d5096002ce6b3abb40b53b Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:30:40 +0900 Subject: [PATCH 07/27] Enable tests/runcon/runcon-no-reorder --- .github/workflows/ignore-intermittent.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ignore-intermittent.txt b/.github/workflows/ignore-intermittent.txt index 226443ebfb2..0d99da29bf9 100644 --- a/.github/workflows/ignore-intermittent.txt +++ b/.github/workflows/ignore-intermittent.txt @@ -5,4 +5,3 @@ tests/rm/rm1 tests/misc/stdbuf tests/misc/usage_vs_getopt tests/misc/tee -tests/runcon/runcon-no-reorder From 614f0a986d64dd9d9255b0c898e489d4bbd8bb30 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Fri, 24 Oct 2025 01:55:37 +0900 Subject: [PATCH 08/27] Replace := with += --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e520932c7af..53456787556 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -217,10 +217,10 @@ HASHSUM_PROGS := \ $(info Detected OS = $(OS)) ifneq ($(OS),Windows_NT) - PROGS := $(PROGS) $(UNIX_PROGS) + PROGS += $(UNIX_PROGS) endif ifeq ($(SELINUX_ENABLED),1) - PROGS := $(PROGS) $(SELINUX_PROGS) + PROGS += $(SELINUX_PROGS) endif UTILS ?= $(filter-out $(SKIP_UTILS),$(PROGS)) From dfc712cf421026f215bbed5791f4b739a2516e46 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Sat, 8 Nov 2025 19:01:28 +0900 Subject: [PATCH 09/27] build-gnu.sh omit uu_chcon --- util/build-gnu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 8e63dac5279..e18f8568d08 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -134,7 +134,7 @@ else fi cd - # Add missing SELINUX_PROGS for tests -cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon -p uu_chcon +cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon #-p uu_chcon # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" touch g From 5879d012bbcfa3ec5279d7359663f0e28304a75a Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Sat, 8 Nov 2025 23:10:47 +0900 Subject: [PATCH 10/27] backport skipping selinux --- .github/workflows/GnuTests.yml | 13 ++++++++++--- util/build-gnu.sh | 9 +-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 1feb49677da..c4c697ab91c 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -63,15 +63,19 @@ jobs: git submodule sync --recursive git config submodule.gnulib.url https://github.com/coreutils/gnulib.git git submodule update --init --recursive --depth 1 + # Backport auto-skip for SELinux progs + # Drop this at coreutils 9.9 + curl https://github.com/coreutils/coreutils/commit/8ba47d09a33f0740e071a8394f3504e0fb57948e.patch -o skip-selinux.patch + patch -Np1 -i skip-selinux.patch working-directory: gnu - #### Build environment setup + #### Build environment setup without libselinux - name: Install dependencies shell: bash run: | ## Install dependencies sudo apt-get update - sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt - name: Add various locales shell: bash run: | @@ -158,6 +162,9 @@ jobs: name: Run GNU tests (SELinux) runs-on: ubuntu-24.04 steps: + - name: Install libselinux + shell: bash + run: sudo apt-get install -y libselinux1-dev #### Get the code, setup cache - name: Checkout code (uutils) uses: actions/checkout@v5 @@ -225,7 +232,7 @@ jobs: ### Build - name: Build binaries run: | - lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build" + env SELINUX_ENABLED=1 lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build" ### Run tests as user - name: Generate SELinux tests list diff --git a/util/build-gnu.sh b/util/build-gnu.sh index e18f8568d08..db8c9dc9483 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -105,12 +105,7 @@ echo "UU_BUILD_DIR='${UU_BUILD_DIR}'" cd "${path_UUTILS}" && echo "[ pwd:'${PWD}' ]" -# Check for SELinux support -if [ "$(uname)" == "Linux" ]; then - # Only attempt to enable SELinux features on Linux - export SELINUX_ENABLED=1 - CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" -fi +[ "$SELINUX_ENABLED" -eq 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" # Trim leading whitespace from feature flags CARGO_FEATURE_FLAGS="$(echo "${CARGO_FEATURE_FLAGS}" | sed -e 's/^[[:space:]]*//')" @@ -133,8 +128,6 @@ else quilt push -a || { echo "Failed to apply patches"; exit 1; } fi cd - -# Add missing SELINUX_PROGS for tests -cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon #-p uu_chcon # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" touch g From a3557710d5674b245d4342fbfc61984370d3fe1f Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Mon, 10 Nov 2025 23:46:41 +0900 Subject: [PATCH 11/27] Add missing export to build-gnu.sh --- util/build-gnu.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index db8c9dc9483..5f547e2c918 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -105,6 +105,7 @@ echo "UU_BUILD_DIR='${UU_BUILD_DIR}'" cd "${path_UUTILS}" && echo "[ pwd:'${PWD}' ]" +export SELINUX_ENABLED # Run this script with=1 for testing SELinux [ "$SELINUX_ENABLED" -eq 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" # Trim leading whitespace from feature flags From d612238bdd78f4dea724a61e3340d6d6cbeeea15 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:12:56 +0900 Subject: [PATCH 12/27] Update build-gnu.sh: let SELINUX_ENABLED=0 by default --- util/build-gnu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 5f547e2c918..3a9dca3ddd3 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -106,7 +106,7 @@ echo "UU_BUILD_DIR='${UU_BUILD_DIR}'" cd "${path_UUTILS}" && echo "[ pwd:'${PWD}' ]" export SELINUX_ENABLED # Run this script with=1 for testing SELinux -[ "$SELINUX_ENABLED" -eq 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" +[ "${SELINUX_ENABLED:-0}" -eq 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" # Trim leading whitespace from feature flags CARGO_FEATURE_FLAGS="$(echo "${CARGO_FEATURE_FLAGS}" | sed -e 's/^[[:space:]]*//')" From a1adf60fac16b3bd3e63b93e358f473c170d403f Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:21:58 +0900 Subject: [PATCH 13/27] Simplify build-gnu.sh --- util/build-gnu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 3a9dca3ddd3..5f946cd5d3d 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -106,7 +106,7 @@ echo "UU_BUILD_DIR='${UU_BUILD_DIR}'" cd "${path_UUTILS}" && echo "[ pwd:'${PWD}' ]" export SELINUX_ENABLED # Run this script with=1 for testing SELinux -[ "${SELINUX_ENABLED:-0}" -eq 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" +[ "${SELINUX_ENABLED}" = 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux" # Trim leading whitespace from feature flags CARGO_FEATURE_FLAGS="$(echo "${CARGO_FEATURE_FLAGS}" | sed -e 's/^[[:space:]]*//')" From 1aa8fe1815a6b20edaa010a8421ec42b44877b27 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:32:12 +0900 Subject: [PATCH 14/27] GnuTests.yml: set SELINUX_ENABLED in lima --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index c4c697ab91c..4de88ea5fa6 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -232,7 +232,7 @@ jobs: ### Build - name: Build binaries run: | - env SELINUX_ENABLED=1 lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build" + lima bash -c "cd ~/work/uutils/ && SELINUX_ENABLED=1 bash util/build-gnu.sh --release-build" ### Run tests as user - name: Generate SELinux tests list From f69fa1c6d955f98492ece22602f8ca4bb3f36ff3 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:17:31 +0900 Subject: [PATCH 15/27] Move runcon-no-reorder to selinux_tests.txt --- .github/workflows/GnuTests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 4de88ea5fa6..af373d61163 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -239,6 +239,8 @@ jobs: run: | # Find and list all tests that require SELinux lima bash -c "cd ~/work/gnu/ && grep -l 'require_selinux_' -r tests/ > ~/work/uutils/selinux-tests.txt" + # Since we don't have runcon buildable without libselinux, we move some tests. + cat tests/runcon/runcon-no-reorder >> ~/work/uutils/selinux-tests.txt lima bash -c "cd ~/work/uutils/ && cat selinux-tests.txt" # Count the tests From 9f708e6190516acd8d33860fc8e9d6395efd1984 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:19:21 +0900 Subject: [PATCH 16/27] Fix typo --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 1be41039910..3aa6a89c960 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -259,7 +259,7 @@ jobs: # Find and list all tests that require SELinux lima bash -c "cd ~/work/gnu/ && grep -l 'require_selinux_' -r tests/ > ~/work/uutils/selinux-tests.txt" # Since we don't have runcon buildable without libselinux, we move some tests. - cat tests/runcon/runcon-no-reorder >> ~/work/uutils/selinux-tests.txt + echo tests/runcon/runcon-no-reorder >> ~/work/uutils/selinux-tests.txt lima bash -c "cd ~/work/uutils/ && cat selinux-tests.txt" # Count the tests From 6a1ee221c92379b2b9d66a8658aa3456b860123a Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:20:50 +0900 Subject: [PATCH 17/27] Remove backport from coreutils 9.9 --- .github/workflows/GnuTests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 3aa6a89c960..e161940c46d 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -72,10 +72,6 @@ jobs: git submodule sync --recursive git config submodule.gnulib.url https://github.com/coreutils/gnulib.git git submodule update --init --recursive --depth 1 - # Backport auto-skip for SELinux progs - # Drop this at coreutils 9.9 - curl https://github.com/coreutils/coreutils/commit/8ba47d09a33f0740e071a8394f3504e0fb57948e.patch -o skip-selinux.patch - patch -Np1 -i skip-selinux.patch working-directory: gnu #### Build environment setup without libselinux From 9b9b9954fb3e66b7ab5240ac8b7b9474b5e7045b Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:45:46 +0900 Subject: [PATCH 18/27] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index e161940c46d..107c944fa1a 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -253,9 +253,8 @@ jobs: - name: Generate SELinux tests list run: | # Find and list all tests that require SELinux - lima bash -c "cd ~/work/gnu/ && grep -l 'require_selinux_' -r tests/ > ~/work/uutils/selinux-tests.txt" # Since we don't have runcon buildable without libselinux, we move some tests. - echo tests/runcon/runcon-no-reorder >> ~/work/uutils/selinux-tests.txt + lima bash -c "cd ~/work/gnu/ && grep -l 'require_selinux_' -r tests/ > ~/work/uutils/selinux-tests.txt && echo tests/runcon/runcon-no-reorder >> ~/work/uutils/selinux-tests.txt" lima bash -c "cd ~/work/uutils/ && cat selinux-tests.txt" # Count the tests From 59daee9624da9ced7057276c927c6d4087720645 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 02:55:49 +0900 Subject: [PATCH 19/27] GnuTests.yml: remove wrong apt-get install --- .github/workflows/GnuTests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 107c944fa1a..f82f9b91781 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -167,9 +167,6 @@ jobs: name: Run GNU tests (SELinux) runs-on: ubuntu-24.04 steps: - - name: Install libselinux - shell: bash - run: sudo apt-get install -y libselinux1-dev #### Get the code, setup cache - name: Checkout code (uutils) uses: actions/checkout@v5 From 0456b302ee7c3d79602719053c363fa76cb0f5ae Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:27:01 +0900 Subject: [PATCH 20/27] Add accidentary removed newline --- util/build-gnu.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index c5a1a7d6a97..f8c015656f7 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -129,6 +129,7 @@ else quilt push -a || { echo "Failed to apply patches"; exit 1; } fi cd - + # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" touch g From e77ded163ffa4e99b759678c8ce1368812e5b6b3 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:33:28 +0900 Subject: [PATCH 21/27] Update build-gnu.sh --- util/build-gnu.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/build-gnu.sh b/util/build-gnu.sh index f8c015656f7..b2ff20bc387 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -130,6 +130,8 @@ else fi cd - +# While we support system missing libselinux, we still tun tests for runcon +cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" touch g From d0d4351fd95584b4317290c8a529cde0a0dda3c8 Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:34:52 +0900 Subject: [PATCH 22/27] Update GnuTests.yml --- .github/workflows/GnuTests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index f82f9b91781..7cf50b94ab7 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -250,8 +250,7 @@ jobs: - name: Generate SELinux tests list run: | # Find and list all tests that require SELinux - # Since we don't have runcon buildable without libselinux, we move some tests. - lima bash -c "cd ~/work/gnu/ && grep -l 'require_selinux_' -r tests/ > ~/work/uutils/selinux-tests.txt && echo tests/runcon/runcon-no-reorder >> ~/work/uutils/selinux-tests.txt" + lima bash -c "cd ~/work/gnu/ && grep -l 'require_selinux_' -r tests/ > ~/work/uutils/selinux-tests.txt" lima bash -c "cd ~/work/uutils/ && cat selinux-tests.txt" # Count the tests From 070559d525c0e840e530a5931eb61264685815ea Mon Sep 17 00:00:00 2001 From: E <79379754+oech3@users.noreply.github.com> Date: Tue, 11 Nov 2025 12:42:18 +0900 Subject: [PATCH 23/27] resolve conflict --- .github/workflows/GnuTests.yml | 2 +- util/build-gnu.sh | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 7cf50b94ab7..7fd84ca992a 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -80,7 +80,7 @@ jobs: run: | ## Install dependencies sudo apt-get update - sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt - name: Add various locales shell: bash run: | diff --git a/util/build-gnu.sh b/util/build-gnu.sh index e452bbcfe86..75dfdb0358d 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -130,8 +130,6 @@ else fi cd - -# While we support system missing libselinux, we still tun tests for runcon -cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon # Pass the feature flags to make, which will pass them to cargo "${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}" touch g From a231f2623cc7d20860c95080c3285d2aebadbe32 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Wed, 12 Nov 2025 22:02:41 +0900 Subject: [PATCH 24/27] Reduce diff --- .github/workflows/GnuTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 7fd84ca992a..93716281f5c 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -74,7 +74,7 @@ jobs: git submodule update --init --recursive --depth 1 working-directory: gnu - #### Build environment setup without libselinux + #### Build environment setup - name: Install dependencies shell: bash run: | From e44a76eb873f8cc8e8fd051dc8d0e29ecec27d3e Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Thu, 13 Nov 2025 00:21:42 +0900 Subject: [PATCH 25/27] Remove libselinux from host --- .github/workflows/GnuTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 93716281f5c..618f4b223ac 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -78,9 +78,9 @@ jobs: - name: Install dependencies shell: bash run: | - ## Install dependencies + ## Install dependencies (without libselinux) sudo apt-get update - sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev attr quilt - name: Add various locales shell: bash run: | From 857563db2096edd7b5c046bb8288b26c0465d483 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Thu, 13 Nov 2025 21:13:40 +0900 Subject: [PATCH 26/27] Drop useless string --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index eefce37208d..000ad89ebe2 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -273,7 +273,7 @@ jobs: target: aarch64-unknown-linux-gnu - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - - name: Install/setup prerequisites (no libselinux) + - name: Install/setup prerequisites shell: bash run: | sudo apt-get -y update From 38e7fbe89ca780aa8bef88a7335c76dea5032a59 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:23:01 +0900 Subject: [PATCH 27/27] CICD.yml: Minimize tests --- .github/workflows/CICD.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 000ad89ebe2..1182f06c6e6 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -273,10 +273,7 @@ jobs: target: aarch64-unknown-linux-gnu - uses: taiki-e/install-action@nextest - uses: Swatinem/rust-cache@v2 - - name: Install/setup prerequisites - shell: bash - run: | - sudo apt-get -y update + # Test build on the system missing libselinux (don't install libselinux1-dev at here) - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.9 - name: "`make build`" @@ -308,8 +305,6 @@ jobs: run: | set -x DESTDIR=/tmp/ make PROFILE=release COMPLETIONS=n MANPAGES=n LOCALES=n install - # Check that SELinux progs are missing - ! test -f /tmp/usr/local/bin/chcon # Check that the utils are present test -f /tmp/usr/local/bin/tty # Check that the manpage is not present