Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ci/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ src_dir=$PWD
mkdir -p "$CI_DIR"
cd "$CI_DIR"
export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}"
cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}")
if ! cmake "$src_dir" "${cmake_args[@]}"; then
# If cmake failed, try it again with debug options.
# Could add --trace / --trace-expand here too but they are very verbose.
cmake_args+=(--debug-find --debug-output --debug-trycompile --log-level=DEBUG)
cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?"
cmake "$src_dir" "${cmake_args[@]}" || echo "cmake exited with $?"

nit: I know this is duplicate, but this way non-Bash people won't have to confirm this works:

# set -o xtrace
false || : "command exited with $?"
set +o xtrace
+ false
+ : 'command exited with 1'
+ set +o xtrace

cat CMakeFiles/CMakeConfigureLog.yaml || true
find . -ls || true
false
fi
if ver_ge "$cmake_ver" "3.15"; then
cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}"
else
Expand Down
Loading