You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 275f935
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .gitlab/compile_extension.sh
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,30 @@ if [ "${WITH_ASAN}" -eq "1" ]; then
20
20
export COMPILE_ASAN=1
21
21
fi
22
22
# Compile Rust and PHP in parallel
23
-
SHARED=1 ./compile_rust.sh &
23
+
rust_build_log=$(mktemp)
24
+
trap'rm -f "$rust_build_log"' EXIT
25
+
SHARED=1 ./compile_rust.sh 2>&1| tee "$rust_build_log"&
26
+
rust_build_pid=$!
24
27
make -j static &
25
-
wait
28
+
c_build_pid=$!
29
+
30
+
# A bare wait discards the exit statuses of both background builds.
31
+
rust_build_status=0
32
+
c_build_status=0
33
+
wait"$rust_build_pid"|| rust_build_status=$?
34
+
wait"$c_build_pid"|| c_build_status=$?
35
+
if [ "$c_build_status"-ne 0 ];then
36
+
exit"$c_build_status"
37
+
fi
38
+
if [ "$rust_build_status"-ne 0 ];then
39
+
# Retry the job with a clean target directory: libddwaf may have left a
40
+
# partially extracted archive, which cannot safely be reused locally.
41
+
if grep -Eq 'Failed to (download archive|write archive entry contents to file):.*reqwest::Error.*(ConnectionReset|ConnectionAborted|TimedOut|IncompleteMessage|UnexpectedEof)'"$rust_build_log";then
42
+
echo"Transient libddwaf download failure; exiting 75 for GitLab retry.">&2
43
+
exit 75
44
+
fi
45
+
exit"$rust_build_status"
46
+
fi
26
47
27
48
# Link extension
28
49
cc -shared -Wl,-whole-archive "${MODULES_DIR}/ddtrace.a" \
0 commit comments