about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2022-03-28 13:34:50 +0100
committerCristian Cadar <c.cadar@imperial.ac.uk>2022-03-30 12:18:59 +0100
commit31f92c57dd2627d4f8c7a5a1e280397456af6a72 (patch)
tree4ce3349f11c1536d10e5c0b0e588a0b3153d0eed
parent0d747ccf52025ac0d0d9067fbda33fb61a8d9843 (diff)
downloadklee-31f92c57dd2627d4f8c7a5a1e280397456af6a72.tar.gz
Refactor cmake installation into own component
-rw-r--r--scripts/build/p-cmake-linux-ubuntu.inc51
-rw-r--r--scripts/build/p-cmake-osx.inc15
-rw-r--r--scripts/build/p-klee-linux-ubuntu.inc25
-rw-r--r--scripts/build/p-libcxx-linux-ubuntu.inc23
-rw-r--r--scripts/build/p-llvm-linux-ubuntu.inc23
-rw-r--r--scripts/build/v-clang.inc2
-rw-r--r--scripts/build/v-cmake.inc7
-rw-r--r--scripts/build/v-klee.inc2
-rw-r--r--scripts/build/v-libcxx.inc1
-rw-r--r--scripts/build/v-llvm.inc5
10 files changed, 80 insertions, 74 deletions
diff --git a/scripts/build/p-cmake-linux-ubuntu.inc b/scripts/build/p-cmake-linux-ubuntu.inc
new file mode 100644
index 00000000..50a9d168
--- /dev/null
+++ b/scripts/build/p-cmake-linux-ubuntu.inc
@@ -0,0 +1,51 @@
+install_binary_artifact_cmake() {
+  source "${DIR}/common-functions"
+
+  # Check if the Ubuntu version is an LTS version - otherwise no cmake version available
+  if grep -q LTS /etc/os-release; then
+    if ! grep -qr "apt.kitware.com" /etc/apt; then
+      with_sudo apt update -y
+      # Add Kitware's certificate for CMake
+      dependencies=(
+        apt-transport-https
+        ca-certificates
+        gnupg
+        lsb-release
+        software-properties-common
+        wget
+      )
+
+      with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
+      wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
+          | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
+
+      # Add CMake repository
+      codename="$(lsb_release --codename --short)"
+      with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main"
+    fi
+  fi
+
+  with_sudo apt update -y
+
+  dependencies=(
+    cmake
+  )
+  with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
+}
+
+get_build_artifacts_cmake() {
+  return 0
+}
+
+# Check if the binary artifact is installed
+is_installed_cmake() {
+  if which cmake ; then
+    return 0
+  fi
+
+  return 1
+}
+
+setup_artifact_variables_cmake() {
+  return 0
+}
\ No newline at end of file
diff --git a/scripts/build/p-cmake-osx.inc b/scripts/build/p-cmake-osx.inc
new file mode 100644
index 00000000..52a92004
--- /dev/null
+++ b/scripts/build/p-cmake-osx.inc
@@ -0,0 +1,15 @@
+# Package script for LLVM builds OSX
+install_binary_artifact_cmake () {
+  # Use the brew provided package
+  LLVM_VERSION_MAJOR="${LLVM_VERSION/.*/}"
+  brew install "cmake"
+}
+
+# Check if the binary artifact is installed
+is_installed_cmake() {
+  if which cmake ; then
+    return 0
+  fi
+
+  return 1
+}
\ No newline at end of file
diff --git a/scripts/build/p-klee-linux-ubuntu.inc b/scripts/build/p-klee-linux-ubuntu.inc
index 5e7f8135..c2a0808c 100644
--- a/scripts/build/p-klee-linux-ubuntu.inc
+++ b/scripts/build/p-klee-linux-ubuntu.inc
@@ -1,35 +1,10 @@
 install_build_dependencies_klee() {
   source "${DIR}/common-functions"
 
-  # Check if the Ubuntu version is an LTS version - otherwise no cmake version available
-  if [[ $(grep -q LTS /etc/os-release) ]]; then
-    with_sudo apt update -y
-    # Add Kitware's certificate for CMake
-    dependencies=(
-      apt-transport-https
-      ca-certificates
-      gnupg
-      lsb-release
-      software-properties-common
-      wget
-    )
-
-    with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
-    wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
-        | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
-
-    # Add CMake repository
-    codename="$(lsb_release --codename --short)"
-    with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main"
-  fi
-
-  with_sudo apt update -y
-
   # Install KLEE's dependencies
   dependencies=(
     build-essential
     gcc-multilib # to generate 32bit
-    cmake
     zlib1g-dev
     python3
     python3-setuptools
diff --git a/scripts/build/p-libcxx-linux-ubuntu.inc b/scripts/build/p-libcxx-linux-ubuntu.inc
index 36333f19..623ec1f2 100644
--- a/scripts/build/p-libcxx-linux-ubuntu.inc
+++ b/scripts/build/p-libcxx-linux-ubuntu.inc
@@ -1,28 +1,6 @@
 install_build_dependencies_libcxx() {
   source "${DIR}/common-functions"
 
-  # Check if the Ubuntu version is an LTS version - otherwise no cmake version available
-  if [[ $(grep -q LTS /etc/os-release) ]]; then
-    with_sudo apt update -y
-    # Add Kitware's certificate for CMake
-    dependencies=(
-      apt-transport-https
-      ca-certificates
-      gnupg
-      lsb-release
-      software-properties-common
-      wget
-    )
-
-    with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
-    wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
-        | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
-
-    # Add CMake repository
-    codename="$(lsb_release --codename --short)"
-    with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main"
-  fi
-
   with_sudo apt-get update -y
   dependencies=(
     build-essential
@@ -30,7 +8,6 @@ install_build_dependencies_libcxx() {
     git
     python3
     python3-pip
-    cmake
     curl
     file # Needed for wllvm
   )
diff --git a/scripts/build/p-llvm-linux-ubuntu.inc b/scripts/build/p-llvm-linux-ubuntu.inc
index f066592b..421fe8cd 100644
--- a/scripts/build/p-llvm-linux-ubuntu.inc
+++ b/scripts/build/p-llvm-linux-ubuntu.inc
@@ -2,28 +2,6 @@
 install_build_dependencies_llvm() {
   source "${DIR}/common-functions"
 
-  # Check if the Ubuntu version is an LTS version - otherwise no cmake version available
-  if grep -q LTS /etc/os-release; then
-      with_sudo apt update -y
-      # Add Kitware's certificate for CMake
-      dependencies=(
-        apt-transport-https
-        ca-certificates
-        gnupg
-        lsb-release
-        software-properties-common
-        wget
-      )
-
-      with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
-      wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
-          | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null
-
-      # Add CMake repository
-      codename="$(lsb_release --codename --short)"
-      with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main"
-  fi
-
   with_sudo apt update -y
 
   dependencies=(
@@ -39,7 +17,6 @@ install_build_dependencies_llvm() {
     make
     git # To check out code
     zlib1g-dev
-    cmake
     git
   )
   
diff --git a/scripts/build/v-clang.inc b/scripts/build/v-clang.inc
index c6a2cf58..7d919a4d 100644
--- a/scripts/build/v-clang.inc
+++ b/scripts/build/v-clang.inc
@@ -2,7 +2,7 @@ required_variables_clang=(
   "LLVM_VERSION"
 )
 
-artifact_dependency_clang=("")
+artifact_dependency_clang=("cmake")
 
 setup_variables_clang() {
   local v_a
diff --git a/scripts/build/v-cmake.inc b/scripts/build/v-cmake.inc
new file mode 100644
index 00000000..a69c90b9
--- /dev/null
+++ b/scripts/build/v-cmake.inc
@@ -0,0 +1,7 @@
+artifact_dependency_cmake=("")
+
+required_variables_cmake=("")
+
+get_docker_config_id_cmake() {
+  return 0
+}
\ No newline at end of file
diff --git a/scripts/build/v-klee.inc b/scripts/build/v-klee.inc
index 60b4a498..78c4e1d1 100644
--- a/scripts/build/v-klee.inc
+++ b/scripts/build/v-klee.inc
@@ -16,7 +16,7 @@ required_variables_check_klee() {
 
 # On which artifacts does KLEE depend on
 artifact_dependency_klee(){
-  local dependencies=("llvm" "solvers" "gtest" "sqlite")
+  local dependencies=("llvm" "solvers" "gtest" "sqlite" "cmake")
   if [[ "${OS}" != "osx" ]]; then
     dependencies+=(uclibc)
   fi
diff --git a/scripts/build/v-libcxx.inc b/scripts/build/v-libcxx.inc
index 147b4db4..4a60d69e 100644
--- a/scripts/build/v-libcxx.inc
+++ b/scripts/build/v-libcxx.inc
@@ -8,4 +8,5 @@ required_variables_check_libcxx() {
 
 artifact_dependency_libcxx(){
   echo "clang"
+  echo "cmake"
 }
diff --git a/scripts/build/v-llvm.inc b/scripts/build/v-llvm.inc
index 7c3ade0a..795146f3 100644
--- a/scripts/build/v-llvm.inc
+++ b/scripts/build/v-llvm.inc
@@ -19,7 +19,10 @@ export_variables_llvm=(
   "BITCODE_CXX"
 )
 
-artifact_dependency_llvm=("sanitizer")
+artifact_dependency_llvm=(
+"sanitizer"
+"cmake"
+)
 
 setup_variables_llvm() {
   local v_a