Merge pull request #9220 from oech3/gtest-sel-opt

build-gnu.sh: Let SELinux optional to use it locally without libselinux
This commit is contained in:
Sylvestre Ledru
2025-11-11 08:35:19 +01:00
committed by GitHub
2 changed files with 3 additions and 7 deletions
+1 -1
View File
@@ -244,7 +244,7 @@ jobs:
### Build
- name: Build binaries
run: |
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
+2 -6
View File
@@ -105,12 +105,8 @@ 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
export SELINUX_ENABLED # Run this script with=1 for testing 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:]]*//')"