Skip to content

Commit 242906c

Browse files
authored
backport skipping selinux
1 parent 1d49a75 commit 242906c

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/GnuTests.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,19 @@ jobs:
6363
git submodule sync --recursive
6464
git config submodule.gnulib.url https://github.com/coreutils/gnulib.git
6565
git submodule update --init --recursive --depth 1
66+
# Backport auto-skip for SELinux progs
67+
# Drop this at coreutils 9.9
68+
curl https://github.com/coreutils/coreutils/commit/8ba47d09a33f0740e071a8394f3504e0fb57948e.patch -o skip-selinux.patch
69+
patch -Np1 -i skip-selinux.patch
6670
working-directory: gnu
6771

68-
#### Build environment setup
72+
#### Build environment setup without libselinux
6973
- name: Install dependencies
7074
shell: bash
7175
run: |
7276
## Install dependencies
7377
sudo apt-get update
74-
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
78+
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
7579
- name: Add various locales
7680
shell: bash
7781
run: |
@@ -158,6 +162,9 @@ jobs:
158162
name: Run GNU tests (SELinux)
159163
runs-on: ubuntu-24.04
160164
steps:
165+
- name: Install libselinux
166+
shell: bash
167+
run: sudo apt-get install -y libselinux1-dev
161168
#### Get the code, setup cache
162169
- name: Checkout code (uutils)
163170
uses: actions/checkout@v5
@@ -225,7 +232,7 @@ jobs:
225232
### Build
226233
- name: Build binaries
227234
run: |
228-
lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build"
235+
env SELINUX_ENABLED=1 lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build"
229236
230237
### Run tests as user
231238
- name: Generate SELinux tests list

util/build-gnu.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,7 @@ echo "UU_BUILD_DIR='${UU_BUILD_DIR}'"
105105

106106
cd "${path_UUTILS}" && echo "[ pwd:'${PWD}' ]"
107107

108-
# Check for SELinux support
109-
if [ "$(uname)" == "Linux" ]; then
110-
# Only attempt to enable SELinux features on Linux
111-
export SELINUX_ENABLED=1
112-
CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux"
113-
fi
108+
[ "$SELINUX_ENABLED" -eq 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux"
114109

115110
# Trim leading whitespace from feature flags
116111
CARGO_FEATURE_FLAGS="$(echo "${CARGO_FEATURE_FLAGS}" | sed -e 's/^[[:space:]]*//')"
@@ -133,8 +128,6 @@ else
133128
quilt push -a || { echo "Failed to apply patches"; exit 1; }
134129
fi
135130
cd -
136-
# Add missing SELINUX_PROGS for tests
137-
cargo build --profile="${UU_MAKE_PROFILE}" -p uu_runcon #-p uu_chcon
138131
# Pass the feature flags to make, which will pass them to cargo
139132
"${MAKE}" PROFILE="${UU_MAKE_PROFILE}" CARGOFLAGS="${CARGO_FEATURE_FLAGS}"
140133
touch g

0 commit comments

Comments
 (0)