Skip to content

Commit 9225670

Browse files
authored
Merge pull request #9220 from oech3/gtest-sel-opt
build-gnu.sh: Let SELinux optional to use it locally without libselinux
2 parents b78e067 + db4439f commit 9225670

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

.github/workflows/GnuTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
### Build
245245
- name: Build binaries
246246
run: |
247-
lima bash -c "cd ~/work/uutils/ && bash util/build-gnu.sh --release-build"
247+
lima bash -c "cd ~/work/uutils/ && SELINUX_ENABLED=1 bash util/build-gnu.sh --release-build"
248248
249249
### Run tests as user
250250
- name: Generate SELinux tests list

util/build-gnu.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,8 @@ 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+
export SELINUX_ENABLED # Run this script with=1 for testing SELinux
109+
[ "${SELINUX_ENABLED}" = 1 ] && CARGO_FEATURE_FLAGS="${CARGO_FEATURE_FLAGS} selinux"
114110

115111
# Trim leading whitespace from feature flags
116112
CARGO_FEATURE_FLAGS="$(echo "${CARGO_FEATURE_FLAGS}" | sed -e 's/^[[:space:]]*//')"

0 commit comments

Comments
 (0)