Fix: Add missing sctp.h header file to sonarqube cmake/build 17/71117/1
authorMatthew Watkins <mwatkins@linuxfoundation.org>
Wed, 21 Dec 2022 14:57:08 +0000 (14:57 +0000)
committerMatthew Watkins <mwatkins@linuxfoundation.org>
Wed, 21 Dec 2022 14:59:41 +0000 (14:59 +0000)
Addresses a cmake/build failure due to a missing header file.
Adds the required platform-specific package dependency to the relevant
script.

Issue-ID: RELENG-4551
Signed-off-by: MatthewWatkins <mwatkins@linuxfoundation.org>
Change-Id: Icfef14917bf4dbc0dd4c506b44648e9ccae78131

releasenotes/notes/fix-missing-sctp-header-36d78588c6d1a644.yaml [new file with mode: 0644]
shell/cmake-sonarqube.sh

diff --git a/releasenotes/notes/fix-missing-sctp-header-36d78588c6d1a644.yaml b/releasenotes/notes/fix-missing-sctp-header-36d78588c6d1a644.yaml
new file mode 100644 (file)
index 0000000..a27561e
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Address missing sctp.h header file during sonarqube cmake/build
index d335419..da433b2 100644 (file)
@@ -15,6 +15,20 @@ echo "---> cmake-sonarqube.sh"
 
 set -eux -o pipefail
 
+# Add missing sctp.h header file to prevent cmake/build failure
+if (grep Ubuntu /etc/os-release > /dev/null 2>&1); then
+    echo "Installing libsctp-dev dependency for Ubuntu"
+    sudo apt-get update
+    sudo apt-get install -y libsctp-dev
+elif (grep RedHat /etc/os-release > /dev/null 2>&1) || \
+     (grep CentOS /etc/os-release > /dev/null 2>&1); then
+    echo "Installing lksctp-tools-devel dependency for CentOS/RedHat"
+    sudo yum install -y lksctp-tools-devel
+else
+    echo "Unmatched OS/Distribution"
+    echo "Missing sctp library not installed"
+fi
+
 build_dir="${BUILD_DIR:-$WORKSPACE/build}"
 build_wrap_dir="${BUILD_WRAP_DIR:-$WORKSPACE/bw-output}"
 cmake_opts="${CMAKE_OPTS:-}"