Skip to content

Commit 2c3f553

Browse files
author
P Charishma Kumari
committed
Fixed yml errors
Signed-off-by: P Charishma Kumari <pcharishmakumari@mac.j9d-in.ibm.com>
1 parent 23f6663 commit 2c3f553

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/build-script-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ jobs:
161161

162162
- name: Test help flag
163163
run: |
164-
./build_liboqs.sh --help > help_output.txt
164+
./build_liboqs.sh --help > help_output.txt 2>&1
165165
if [ ! -s help_output.txt ]; then
166166
echo "Error: Help output is empty"
167167
exit 1

build_liboqs.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,32 @@ check_script_staleness() {
114114
local WARNED=0
115115
local MISSING_OPTIONS=()
116116

117+
# Skip check if CMake files don't exist
118+
if [ ! -f "$CMAKE_FILE" ] && [ ! -f "$ALG_SUPPORT_FILE" ]; then
119+
return 0
120+
fi
121+
117122
# Extract all option() declarations from CMake files
118123
local CMAKE_OPTIONS=()
119124

120125
# Parse main CMakeLists.txt
121126
if [ -f "$CMAKE_FILE" ]; then
122127
while IFS= read -r line; do
123-
CMAKE_OPTIONS+=("$line")
124-
done < <(grep -E '^option\(OQS_|^option\(USE_|^option\(BUILD_' "$CMAKE_FILE" 2>/dev/null | sed -E 's/option\(([A-Z_]+).*/\1/')
128+
[ -n "$line" ] && CMAKE_OPTIONS+=("$line")
129+
done < <(grep -E '^option\(OQS_|^option\(USE_|^option\(BUILD_' "$CMAKE_FILE" 2>/dev/null | sed 's/option(//;s/ .*//' || true)
125130
fi
126131

127132
# Parse .CMake/alg_support.cmake for algorithm options
128133
if [ -f "$ALG_SUPPORT_FILE" ]; then
129134
while IFS= read -r line; do
130-
CMAKE_OPTIONS+=("$line")
131-
done < <(grep -E '^option\(OQS_' "$ALG_SUPPORT_FILE" 2>/dev/null | sed -E 's/option\(([A-Z_]+).*/\1/')
135+
[ -n "$line" ] && CMAKE_OPTIONS+=("$line")
136+
done < <(grep -E '^option\(OQS_' "$ALG_SUPPORT_FILE" 2>/dev/null | sed 's/option(//;s/ .*//' || true)
132137
fi
133138

134-
# Remove duplicates
135-
CMAKE_OPTIONS=($(printf '%s\n' "${CMAKE_OPTIONS[@]}" | sort -u))
139+
# Remove duplicates (handle empty array safely)
140+
if [ ${#CMAKE_OPTIONS[@]} -gt 0 ]; then
141+
CMAKE_OPTIONS=($(printf '%s\n' "${CMAKE_OPTIONS[@]}" | sort -u || true))
142+
fi
136143

137144
# Check each CMake option against the script
138145
for opt in "${CMAKE_OPTIONS[@]}"; do
@@ -172,7 +179,7 @@ check_script_staleness() {
172179
# Additional validation: Check for new algorithm families
173180
if [ -f "$ALG_SUPPORT_FILE" ]; then
174181
local ALG_FAMILIES=$(grep -E '^option\(OQS_ENABLE_(KEM|SIG)_[A-Z_]+' "$ALG_SUPPORT_FILE" 2>/dev/null | \
175-
sed -E 's/option\(OQS_ENABLE_(KEM|SIG)_([A-Z_]+).*/\2/' | sort -u)
182+
sed 's/option(OQS_ENABLE_[KS][EI][MG]_//;s/ .*//' | sort -u || true)
176183

177184
local MISSING_ALG_FAMILIES=()
178185
for alg in $ALG_FAMILIES; do

0 commit comments

Comments
 (0)