diff --git a/environment/os/amzn-2.sh b/environment/os/amzn-2.sh index 15ff29106..a9cc3e4b2 100755 --- a/environment/os/amzn-2.sh +++ b/environment/os/amzn-2.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -9,7 +7,7 @@ check_operating_system "amzn-2" check_architecture "x86_64" TOOLCHAIN_BUILD_DEPS=( - gcc gcc-c++ make # generic build tools + git gcc gcc-c++ make # generic build tools wget # used for archive download gnupg2 # used for archive signature verification tar gzip bzip2 xz unzip # used for archive unpacking @@ -63,6 +61,8 @@ MEMGRAPH_BUILD_DEPS=( cyrus-sasl-devel ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp ) diff --git a/environment/os/centos-7.sh b/environment/os/centos-7.sh index df16fbc73..d9fc93912 100755 --- a/environment/os/centos-7.sh +++ b/environment/os/centos-7.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -63,6 +61,8 @@ MEMGRAPH_BUILD_DEPS=( cyrus-sasl-devel ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp ) diff --git a/environment/os/centos-9.sh b/environment/os/centos-9.sh index 8a431807e..8177c9223 100755 --- a/environment/os/centos-9.sh +++ b/environment/os/centos-9.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -9,8 +7,10 @@ check_operating_system "centos-9" check_architecture "x86_64" TOOLCHAIN_BUILD_DEPS=( - coreutils-common gcc gcc-c++ make # generic build tools wget # used for archive download + coreutils-common gcc gcc-c++ make # generic build tools + # NOTE: Pure libcurl conflicts with libcurl-minimal + libcurl-devel # cmake build requires it gnupg2 # used for archive signature verification tar gzip bzip2 xz unzip # used for archive unpacking zlib-devel # zlib library used for all builds @@ -64,6 +64,8 @@ MEMGRAPH_BUILD_DEPS=( cyrus-sasl-devel ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp ) @@ -123,7 +125,9 @@ install() { else echo "NOTE: export LANG=en_US.utf8" fi - yum update -y + # --nobest is used because of libipt because we install custom versions + # because libipt-devel is not available on CentOS 9 Stream + yum update -y --nobest yum install -y wget git python3 python3-pip for pkg in $1; do diff --git a/environment/os/debian-10.sh b/environment/os/debian-10.sh index 4c1deda42..9a64854de 100755 --- a/environment/os/debian-10.sh +++ b/environment/os/debian-10.sh @@ -1,10 +1,10 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" +# IMPORTANT: Deprecated since memgraph v2.12.0. + check_operating_system "debian-10" check_architecture "x86_64" diff --git a/environment/os/debian-11-arm.sh b/environment/os/debian-11-arm.sh index c8a3cca1c..8e17a8fdd 100755 --- a/environment/os/debian-11-arm.sh +++ b/environment/os/debian-11-arm.sh @@ -1,10 +1,10 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" +# IMPORTANT: Deprecated since memgraph v2.12.0. + check_operating_system "debian-11" check_architecture "arm64" "aarch64" diff --git a/environment/os/debian-11.sh b/environment/os/debian-11.sh index c7e82b52c..ac05f6ba6 100755 --- a/environment/os/debian-11.sh +++ b/environment/os/debian-11.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -61,6 +59,8 @@ MEMGRAPH_BUILD_DEPS=( libsasl2-dev ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp ) diff --git a/environment/os/debian-12-arm.sh b/environment/os/debian-12-arm.sh new file mode 100755 index 000000000..15d3f7473 --- /dev/null +++ b/environment/os/debian-12-arm.sh @@ -0,0 +1,134 @@ +#!/bin/bash +set -Eeuo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source "$DIR/../util.sh" + +check_operating_system "debian-12" +check_architecture "arm64" "aarch64" + +TOOLCHAIN_BUILD_DEPS=( + coreutils gcc g++ build-essential make # generic build tools + wget # used for archive download + gnupg # used for archive signature verification + tar gzip bzip2 xz-utils unzip # used for archive unpacking + zlib1g-dev # zlib library used for all builds + libexpat1-dev liblzma-dev python3-dev texinfo # for gdb + libcurl4-openssl-dev # for cmake + libreadline-dev # for cmake and llvm + libffi-dev libxml2-dev # for llvm + libedit-dev libpcre2-dev libpcre3-dev automake bison # for swig + curl # snappy + file # for libunwind + libssl-dev # for libevent + libgmp-dev + gperf # for proxygen + git # for fbthrift +) + +TOOLCHAIN_RUN_DEPS=( + make # generic build tools + tar gzip bzip2 xz-utils # used for archive unpacking + zlib1g # zlib library used for all builds + libexpat1 liblzma5 python3 # for gdb + libcurl4 # for cmake + file # for CPack + libreadline8 # for cmake and llvm + libffi8 libxml2 # for llvm + libssl-dev # for libevent +) + +MEMGRAPH_BUILD_DEPS=( + git # source code control + make pkg-config # build system + curl wget # for downloading libs + uuid-dev default-jre-headless # required by antlr + libreadline-dev # for memgraph console + libpython3-dev python3-dev # for query modules + libssl-dev + libseccomp-dev + netcat # tests are using nc to wait for memgraph + python3 virtualenv python3-virtualenv python3-pip # for qa, macro_benchmark and stress tests + python3-yaml # for the configuration generator + libcurl4-openssl-dev # mg-requests + sbcl # for custom Lisp C++ preprocessing + doxygen graphviz # source documentation generators + mono-runtime mono-mcs zip unzip default-jdk-headless custom-maven3.9.3 # for driver tests + dotnet-sdk-7.0 golang custom-golang1.18.9 nodejs npm + autoconf # for jemalloc code generation + libtool # for protobuf code generation + libsasl2-dev +) + +MEMGRAPH_RUN_DEPS=( + logrotate openssl python3 libseccomp +) + +NEW_DEPS=( + wget curl tar gzip +) + +list() { + echo "$1" +} + +check() { + local missing="" + for pkg in $1; do + if [ "$pkg" == custom-maven3.9.3 ]; then + if [ ! -f "/opt/apache-maven-3.9.3/bin/mvn" ]; then + missing="$pkg $missing" + fi + continue + fi + if [ "$pkg" == custom-golang1.18.9 ]; then + if [ ! -f "/opt/go1.18.9/go/bin/go" ]; then + missing="$pkg $missing" + fi + continue + fi + if ! dpkg -s "$pkg" >/dev/null 2>/dev/null; then + missing="$pkg $missing" + fi + done + if [ "$missing" != "" ]; then + echo "MISSING PACKAGES: $missing" + exit 1 + fi +} + +install() { + cd "$DIR" + apt update + # If GitHub Actions runner is installed, append LANG to the environment. + # Python related tests doesn't work the LANG export. + if [ -d "/home/gh/actions-runner" ]; then + echo "LANG=en_US.utf8" >> /home/gh/actions-runner/.env + else + echo "NOTE: export LANG=en_US.utf8" + fi + apt install -y wget + + for pkg in $1; do + if [ "$pkg" == custom-maven3.9.3 ]; then + install_custom_maven "3.9.3" + continue + fi + if [ "$pkg" == custom-golang1.18.9 ]; then + install_custom_golang "1.18.9" + continue + fi + if [ "$pkg" == dotnet-sdk-7.0 ]; then + if ! dpkg -s "$pkg" 2>/dev/null >/dev/null; then + wget -nv https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb + dpkg -i packages-microsoft-prod.deb + apt-get update + apt-get install -y apt-transport-https dotnet-sdk-7.0 + fi + continue + fi + apt install -y "$pkg" + done +} + +deps=$2"[*]" +"$1" "${!deps}" diff --git a/environment/os/debian-12.sh b/environment/os/debian-12.sh new file mode 100755 index 000000000..1709230ad --- /dev/null +++ b/environment/os/debian-12.sh @@ -0,0 +1,136 @@ +#!/bin/bash +set -Eeuo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source "$DIR/../util.sh" + +check_operating_system "debian-12" +check_architecture "x86_64" + +TOOLCHAIN_BUILD_DEPS=( + coreutils gcc g++ build-essential make # generic build tools + wget # used for archive download + gnupg # used for archive signature verification + tar gzip bzip2 xz-utils unzip # used for archive unpacking + zlib1g-dev # zlib library used for all builds + libexpat1-dev libipt-dev libbabeltrace-dev liblzma-dev python3-dev texinfo # for gdb + libcurl4-openssl-dev # for cmake + libreadline-dev # for cmake and llvm + libffi-dev libxml2-dev # for llvm + libedit-dev libpcre2-dev libpcre3-dev automake bison # for swig + curl # snappy + file # for libunwind + libssl-dev # for libevent + libgmp-dev + gperf # for proxygen + git # for fbthrift +) + +TOOLCHAIN_RUN_DEPS=( + make # generic build tools + tar gzip bzip2 xz-utils # used for archive unpacking + zlib1g # zlib library used for all builds + libexpat1 libipt2 libbabeltrace1 liblzma5 python3 # for gdb + libcurl4 # for cmake + file # for CPack + libreadline8 # for cmake and llvm + libffi8 libxml2 # for llvm + libssl-dev # for libevent +) + +MEMGRAPH_BUILD_DEPS=( + git # source code control + make cmake pkg-config # build system + curl wget # for downloading libs + uuid-dev default-jre-headless # required by antlr + libreadline-dev # for memgraph console + libpython3-dev python3-dev # for query modules + libssl-dev + libseccomp-dev + netcat-traditional # tests are using nc to wait for memgraph + python3 virtualenv python3-virtualenv python3-pip # for qa, macro_benchmark and stress tests + python3-yaml # for the configuration generator + libcurl4-openssl-dev # mg-requests + sbcl # for custom Lisp C++ preprocessing + doxygen graphviz # source documentation generators + mono-runtime mono-mcs zip unzip default-jdk-headless custom-maven3.9.3 # for driver tests + dotnet-sdk-7.0 golang custom-golang1.18.9 nodejs npm + autoconf # for jemalloc code generation + libtool # for protobuf code generation + libsasl2-dev +) + +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + +MEMGRAPH_RUN_DEPS=( + logrotate openssl python3 libseccomp +) + +NEW_DEPS=( + wget curl tar gzip +) + +list() { + echo "$1" +} + +check() { + local missing="" + for pkg in $1; do + if [ "$pkg" == custom-maven3.9.3 ]; then + if [ ! -f "/opt/apache-maven-3.9.3/bin/mvn" ]; then + missing="$pkg $missing" + fi + continue + fi + if [ "$pkg" == custom-golang1.18.9 ]; then + if [ ! -f "/opt/go1.18.9/go/bin/go" ]; then + missing="$pkg $missing" + fi + continue + fi + if ! dpkg -s "$pkg" >/dev/null 2>/dev/null; then + missing="$pkg $missing" + fi + done + if [ "$missing" != "" ]; then + echo "MISSING PACKAGES: $missing" + exit 1 + fi +} + +install() { + cd "$DIR" + apt update + # If GitHub Actions runner is installed, append LANG to the environment. + # Python related tests doesn't work the LANG export. + if [ -d "/home/gh/actions-runner" ]; then + echo "LANG=en_US.utf8" >> /home/gh/actions-runner/.env + else + echo "NOTE: export LANG=en_US.utf8" + fi + apt install -y wget + + for pkg in $1; do + if [ "$pkg" == custom-maven3.9.3 ]; then + install_custom_maven "3.9.3" + continue + fi + if [ "$pkg" == custom-golang1.18.9 ]; then + install_custom_golang "1.18.9" + continue + fi + if [ "$pkg" == dotnet-sdk-7.0 ]; then + if ! dpkg -s "$pkg" 2>/dev/null >/dev/null; then + wget -nv https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb + dpkg -i packages-microsoft-prod.deb + apt-get update + apt-get install -y apt-transport-https dotnet-sdk-7.0 + fi + continue + fi + apt install -y "$pkg" + done +} + +deps=$2"[*]" +"$1" "${!deps}" diff --git a/environment/os/fedora-36.sh b/environment/os/fedora-36.sh index f7bd0c53a..f8b8995d9 100755 --- a/environment/os/fedora-36.sh +++ b/environment/os/fedora-36.sh @@ -1,10 +1,10 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" +# IMPORTANT: Deprecated since memgraph v2.12.0. + check_operating_system "fedora-36" check_architecture "x86_64" @@ -27,6 +27,7 @@ TOOLCHAIN_BUILD_DEPS=( libipt libipt-devel # intel patch perl # for openssl + git ) TOOLCHAIN_RUN_DEPS=( diff --git a/environment/os/fedora-38.sh b/environment/os/fedora-38.sh index 7837f018b..951bec46f 100755 --- a/environment/os/fedora-38.sh +++ b/environment/os/fedora-38.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -27,6 +25,7 @@ TOOLCHAIN_BUILD_DEPS=( libipt libipt-devel # intel patch perl # for openssl + git ) TOOLCHAIN_RUN_DEPS=( @@ -58,6 +57,16 @@ MEMGRAPH_BUILD_DEPS=( libtool # for protobuf code generation ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + +MEMGRAPH_RUN_DEPS=( + logrotate openssl python3 libseccomp +) + +NEW_DEPS=( + wget curl tar gzip +) + list() { echo "$1" } diff --git a/environment/os/fedora-39.sh b/environment/os/fedora-39.sh new file mode 100755 index 000000000..4b0e82992 --- /dev/null +++ b/environment/os/fedora-39.sh @@ -0,0 +1,117 @@ +#!/bin/bash +set -Eeuo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source "$DIR/../util.sh" + +check_operating_system "fedora-39" +check_architecture "x86_64" + +TOOLCHAIN_BUILD_DEPS=( + coreutils-common gcc gcc-c++ make # generic build tools + wget # used for archive download + gnupg2 # used for archive signature verification + tar gzip bzip2 xz unzip # used for archive unpacking + zlib-devel # zlib library used for all builds + expat-devel xz-devel python3-devel texinfo libbabeltrace-devel # for gdb + curl libcurl-devel # for cmake + readline-devel # for cmake and llvm + libffi-devel libxml2-devel # for llvm + libedit-devel pcre-devel pcre2-devel automake bison # for swig + file + openssl-devel + gmp-devel + gperf + diffutils + libipt libipt-devel # intel + patch + perl # for openssl + git +) + +TOOLCHAIN_RUN_DEPS=( + make # generic build tools + tar gzip bzip2 xz # used for archive unpacking + zlib # zlib library used for all builds + expat xz-libs python3 # for gdb + readline # for cmake and llvm + libffi libxml2 # for llvm + openssl-devel +) + +MEMGRAPH_BUILD_DEPS=( + git # source code control + make pkgconf-pkg-config # build system + wget # for downloading libs + libuuid-devel java-11-openjdk # required by antlr + readline-devel # for memgraph console + python3-devel # for query modules + openssl-devel + libseccomp-devel + python3 python3-pip python3-virtualenv python3-virtualenvwrapper python3-pyyaml nmap-ncat # for tests + libcurl-devel # mg-requests + rpm-build rpmlint # for RPM package building + doxygen graphviz # source documentation generators + which nodejs golang zip unzip java-11-openjdk-devel # for driver tests + sbcl # for custom Lisp C++ preprocessing + autoconf # for jemalloc code generation + libtool # for protobuf code generation +) + +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + +MEMGRAPH_RUN_DEPS=( + logrotate openssl python3 libseccomp +) + +NEW_DEPS=( + wget curl tar gzip +) + +list() { + echo "$1" +} + +check() { + if [ -v LD_LIBRARY_PATH ]; then + # On Fedora 38 yum/dnf and python11 use newer glibc which is not compatible + # with ours, so we need to momentarely disable env + local OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH} + LD_LIBRARY_PATH="" + fi + local missing="" + for pkg in $1; do + if ! dnf list installed "$pkg" >/dev/null 2>/dev/null; then + missing="$pkg $missing" + fi + done + if [ "$missing" != "" ]; then + echo "MISSING PACKAGES: $missing" + exit 1 + fi + if [ -v OLD_LD_LIBRARY_PATH ]; then + echo "Restoring LD_LIBRARY_PATH..." + LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH} + fi +} + +install() { + cd "$DIR" + if [ "$EUID" -ne 0 ]; then + echo "Please run as root." + exit 1 + fi + # If GitHub Actions runner is installed, append LANG to the environment. + # Python related tests don't work without the LANG export. + if [ -d "/home/gh/actions-runner" ]; then + echo "LANG=en_US.utf8" >> /home/gh/actions-runner/.env + else + echo "NOTE: export LANG=en_US.utf8" + fi + dnf update -y + for pkg in $1; do + dnf install -y "$pkg" + done +} + +deps=$2"[*]" +"$1" "${!deps}" diff --git a/environment/os/rocky-9.3.sh b/environment/os/rocky-9.3.sh new file mode 100755 index 000000000..571278654 --- /dev/null +++ b/environment/os/rocky-9.3.sh @@ -0,0 +1,188 @@ +#!/bin/bash +set -Eeuo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +source "$DIR/../util.sh" + +# TODO(gitbuda): Rocky gets automatically updates -> figure out how to handle it. +check_operating_system "rocky-9.3" +check_architecture "x86_64" + +TOOLCHAIN_BUILD_DEPS=( + wget # used for archive download + coreutils-common gcc gcc-c++ make # generic build tools + # NOTE: Pure libcurl conflicts with libcurl-minimal + libcurl-devel # cmake build requires it + gnupg2 # used for archive signature verification + tar gzip bzip2 xz unzip # used for archive unpacking + zlib-devel # zlib library used for all builds + expat-devel xz-devel python3-devel perl-Unicode-EastAsianWidth texinfo libbabeltrace-devel # for gdb + readline-devel # for cmake and llvm + libffi-devel libxml2-devel # for llvm + libedit-devel pcre-devel pcre2-devel automake bison # for swig + file + openssl-devel + gmp-devel + gperf + diffutils + libipt libipt-devel # intel + patch +) + +TOOLCHAIN_RUN_DEPS=( + make # generic build tools + tar gzip bzip2 xz # used for archive unpacking + zlib # zlib library used for all builds + expat xz-libs python3 # for gdb + readline # for cmake and llvm + libffi libxml2 # for llvm + openssl-devel + perl # for openssl +) + +MEMGRAPH_BUILD_DEPS=( + git # source code control + make cmake pkgconf-pkg-config # build system + wget # for downloading libs + libuuid-devel java-11-openjdk # required by antlr + readline-devel # for memgraph console + python3-devel # for query modules + openssl-devel + libseccomp-devel + python3 python3-pip python3-virtualenv nmap-ncat # for qa, macro_benchmark and stress tests + # + # IMPORTANT: python3-yaml does NOT exist on CentOS + # Install it manually using `pip3 install PyYAML` + # + PyYAML # Package name here does not correspond to the yum package! + libcurl-devel # mg-requests + rpm-build rpmlint # for RPM package building + doxygen graphviz # source documentation generators + which nodejs golang custom-golang1.18.9 # for driver tests + zip unzip java-11-openjdk-devel java-17-openjdk java-17-openjdk-devel custom-maven3.9.3 # for driver tests + sbcl # for custom Lisp C++ preprocessing + autoconf # for jemalloc code generation + libtool # for protobuf code generation + cyrus-sasl-devel +) + +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + +MEMGRAPH_RUN_DEPS=( + logrotate openssl python3 libseccomp +) + +NEW_DEPS=( + wget curl tar gzip +) + +list() { + echo "$1" +} + +check() { + local missing="" + for pkg in $1; do + if [ "$pkg" == custom-maven3.9.3 ]; then + if [ ! -f "/opt/apache-maven-3.9.3/bin/mvn" ]; then + missing="$pkg $missing" + fi + continue + fi + if [ "$pkg" == custom-golang1.18.9 ]; then + if [ ! -f "/opt/go1.18.9/go/bin/go" ]; then + missing="$pkg $missing" + fi + continue + fi + if [ "$pkg" == "PyYAML" ]; then + if ! python3 -c "import yaml" >/dev/null 2>/dev/null; then + missing="$pkg $missing" + fi + continue + fi + if [ "$pkg" == "python3-virtualenv" ]; then + continue + fi + if ! yum list installed "$pkg" >/dev/null 2>/dev/null; then + missing="$pkg $missing" + fi + done + if [ "$missing" != "" ]; then + echo "MISSING PACKAGES: $missing" + exit 1 + fi +} + +install() { + cd "$DIR" + if [ "$EUID" -ne 0 ]; then + echo "Please run as root." + exit 1 + fi + # If GitHub Actions runner is installed, append LANG to the environment. + # Python related tests doesn't work the LANG export. + if [ -d "/home/gh/actions-runner" ]; then + echo "LANG=en_US.utf8" >> /home/gh/actions-runner/.env + else + echo "NOTE: export LANG=en_US.utf8" + fi + yum update -y + yum install -y wget git python3 python3-pip + + for pkg in $1; do + if [ "$pkg" == custom-maven3.9.3 ]; then + install_custom_maven "3.9.3" + continue + fi + if [ "$pkg" == custom-golang1.18.9 ]; then + install_custom_golang "1.18.9" + continue + fi + if [ "$pkg" == perl-Unicode-EastAsianWidth ]; then + if ! dnf list installed perl-Unicode-EastAsianWidth >/dev/null 2>/dev/null; then + dnf install -y https://dl.rockylinux.org/pub/rocky/9/CRB/x86_64/os/Packages/p/perl-Unicode-EastAsianWidth-12.0-7.el9.noarch.rpm + fi + continue + fi + if [ "$pkg" == texinfo ]; then + if ! dnf list installed texinfo >/dev/null 2>/dev/null; then + dnf install -y https://dl.rockylinux.org/pub/rocky/9/CRB/x86_64/os/Packages/t/texinfo-6.7-15.el9.x86_64.rpm + fi + continue + fi + if [ "$pkg" == libbabeltrace-devel ]; then + if ! dnf list installed libbabeltrace-devel >/dev/null 2>/dev/null; then + dnf install -y https://dl.rockylinux.org/pub/rocky/9/devel/x86_64/os/Packages/l/libbabeltrace-devel-1.5.8-10.el9.x86_64.rpm + fi + continue + fi + if [ "$pkg" == libipt-devel ]; then + if ! dnf list installed libipt-devel >/dev/null 2>/dev/null; then + dnf install -y https://dl.rockylinux.org/pub/rocky/9/devel/x86_64/os/Packages/l/libipt-devel-2.0.4-5.el9.x86_64.rpm + fi + continue + fi + if [ "$pkg" == PyYAML ]; then + if [ -z ${SUDO_USER+x} ]; then # Running as root (e.g. Docker). + pip3 install --user PyYAML + else # Running using sudo. + sudo -H -u "$SUDO_USER" bash -c "pip3 install --user PyYAML" + fi + continue + fi + if [ "$pkg" == python3-virtualenv ]; then + if [ -z ${SUDO_USER+x} ]; then # Running as root (e.g. Docker). + pip3 install virtualenv + pip3 install virtualenvwrapper + else # Running using sudo. + sudo -H -u "$SUDO_USER" bash -c "pip3 install virtualenv" + sudo -H -u "$SUDO_USER" bash -c "pip3 install virtualenvwrapper" + fi + continue + fi + yum install -y "$pkg" + done +} + +deps=$2"[*]" +"$1" "${!deps}" diff --git a/environment/os/template.sh b/environment/os/template.sh index b1f2f8fe4..692926efb 100755 --- a/environment/os/template.sh +++ b/environment/os/template.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -20,6 +18,10 @@ MEMGRAPH_BUILD_DEPS=( pkg ) +MEMGRAPH_TEST_DEPS=( + pkg +) + MEMGRAPH_RUN_DEPS=( pkg ) diff --git a/environment/os/ubuntu-18.04.sh b/environment/os/ubuntu-18.04.sh index 27d876e4f..451d5e69c 100755 --- a/environment/os/ubuntu-18.04.sh +++ b/environment/os/ubuntu-18.04.sh @@ -1,10 +1,10 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" +# IMPORTANT: Deprecated since memgraph v2.12.0. + check_operating_system "ubuntu-18.04" check_architecture "x86_64" diff --git a/environment/os/ubuntu-20.04.sh b/environment/os/ubuntu-20.04.sh index 8a308406e..7739b49d1 100755 --- a/environment/os/ubuntu-20.04.sh +++ b/environment/os/ubuntu-20.04.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -60,6 +58,8 @@ MEMGRAPH_BUILD_DEPS=( libsasl2-dev ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp2 ) diff --git a/environment/os/ubuntu-22.04-arm.sh b/environment/os/ubuntu-22.04-arm.sh index 45a4f3d4c..9326e52e9 100755 --- a/environment/os/ubuntu-22.04-arm.sh +++ b/environment/os/ubuntu-22.04-arm.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -60,6 +58,8 @@ MEMGRAPH_BUILD_DEPS=( libsasl2-dev ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp2 ) diff --git a/environment/os/ubuntu-22.04.sh b/environment/os/ubuntu-22.04.sh index 59361dd81..649338e53 100755 --- a/environment/os/ubuntu-22.04.sh +++ b/environment/os/ubuntu-22.04.sh @@ -1,7 +1,5 @@ #!/bin/bash - set -Eeuo pipefail - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source "$DIR/../util.sh" @@ -60,6 +58,8 @@ MEMGRAPH_BUILD_DEPS=( libsasl2-dev ) +MEMGRAPH_TEST_DEPS="${MEMGRAPH_BUILD_DEPS[*]}" + MEMGRAPH_RUN_DEPS=( logrotate openssl python3 libseccomp2 ) diff --git a/environment/toolchain/.gitignore b/environment/toolchain/.gitignore index e75f93b12..6ba5f327d 100644 --- a/environment/toolchain/.gitignore +++ b/environment/toolchain/.gitignore @@ -2,3 +2,4 @@ archives build output *.tar.gz +tmp_build.sh diff --git a/environment/toolchain/template_build.sh b/environment/toolchain/template_build.sh new file mode 100644 index 000000000..b01902ab9 --- /dev/null +++ b/environment/toolchain/template_build.sh @@ -0,0 +1,48 @@ +#!/bin/bash -e + +# NOTE: Copy this under memgraph/environment/toolchain/vN/tmp_build.sh, edit and test. + +pushd () { command pushd "$@" > /dev/null; } +popd () { command popd "$@" > /dev/null; } +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +CPUS=$( grep -c processor < /proc/cpuinfo ) +cd "$DIR" +source "$DIR/../../util.sh" +DISTRO="$(operating_system)" +TOOLCHAIN_VERSION=5 +NAME=toolchain-v$TOOLCHAIN_VERSION +PREFIX=/opt/$NAME +function log_tool_name () { + echo "" + echo "" + echo "#### $1 ####" + echo "" + echo "" +} + +# HERE: Remove/clear dependencies from a given toolchain. + +mkdir -p archives && pushd archives +# HERE: Download dependencies here. +popd + +mkdir -p build +pushd build +source $PREFIX/activate +export CC=$PREFIX/bin/clang +export CXX=$PREFIX/bin/clang++ +export CFLAGS="$CFLAGS -fPIC" +export PATH=$PREFIX/bin:$PATH +export LD_LIBRARY_PATH=$PREFIX/lib64 +COMMON_CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$PREFIX + -DCMAKE_PREFIX_PATH=$PREFIX + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_C_COMPILER=$CC + -DCMAKE_CXX_COMPILER=$CXX + -DBUILD_SHARED_LIBS=OFF + -DCMAKE_CXX_STANDARD=20 + -DBUILD_TESTING=OFF + -DCMAKE_REQUIRED_INCLUDES=$PREFIX/include + -DCMAKE_POSITION_INDEPENDENT_CODE=ON" + +# HERE: Add dependencies to test below. diff --git a/environment/toolchain/v5/build.sh b/environment/toolchain/v5/build.sh index b6c1ff6d8..aade6f9c5 100755 --- a/environment/toolchain/v5/build.sh +++ b/environment/toolchain/v5/build.sh @@ -307,7 +307,7 @@ if [ ! -f $PREFIX/bin/ld.gold ]; then fi log_tool_name "GDB $GDB_VERSION" -if [ ! -f $PREFIX/bin/gdb ]; then +if [[ ! -f "$PREFIX/bin/gdb" && "$DISTRO" -ne "amzn-2" ]]; then if [ -d gdb-$GDB_VERSION ]; then rm -rf gdb-$GDB_VERSION fi @@ -671,7 +671,6 @@ PROXYGEN_SHA256=5360a8ccdfb2f5a6c7b3eed331ec7ab0e2c792d579c6fff499c85c516c11fe14 WANGLE_SHA256=1002e9c32b6f4837f6a760016e3b3e22f3509880ef3eaad191c80dc92655f23f # WANGLE_SHA256=0e493c03572bb27fe9ca03a9da5023e52fde99c95abdcaa919bb6190e7e69532 -FLEX_VERSION=2.6.4 FMT_SHA256=78b8c0a72b1c35e4443a7e308df52498252d1cefc2b08c9a97bc9ee6cfe61f8b FMT_VERSION=10.1.1 # NOTE: spdlog depends on exact fmt versions -> UPGRADE fmt and spdlog TOGETHER. @@ -690,8 +689,8 @@ LZ4_VERSION=1.9.4 SNAPPY_SHA256=75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7 SNAPPY_VERSION=1.1.9 XZ_VERSION=5.2.5 # for LZMA -ZLIB_VERSION=1.3 -ZSTD_VERSION=1.5.0 +ZLIB_VERSION=1.3.1 +ZSTD_VERSION=1.5.5 pushd archives if [ ! -f boost_$BOOST_VERSION_UNDERSCORES.tar.gz ]; then @@ -700,7 +699,7 @@ if [ ! -f boost_$BOOST_VERSION_UNDERSCORES.tar.gz ]; then wget https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VERSION/source/boost_$BOOST_VERSION_UNDERSCORES.tar.gz -O boost_$BOOST_VERSION_UNDERSCORES.tar.gz fi if [ ! -f bzip2-$BZIP2_VERSION.tar.gz ]; then - wget https://sourceforge.net/projects/bzip2/files/bzip2-$BZIP2_VERSION.tar.gz -O bzip2-$BZIP2_VERSION.tar.gz + wget https://sourceware.org/pub/bzip2/bzip2-$BZIP2_VERSION.tar.gz -O bzip2-$BZIP2_VERSION.tar.gz fi if [ ! -f double-conversion-$DOUBLE_CONVERSION_VERSION.tar.gz ]; then wget https://github.com/google/double-conversion/archive/refs/tags/v$DOUBLE_CONVERSION_VERSION.tar.gz -O double-conversion-$DOUBLE_CONVERSION_VERSION.tar.gz @@ -708,9 +707,7 @@ fi if [ ! -f fizz-$FBLIBS_VERSION.tar.gz ]; then wget https://github.com/facebookincubator/fizz/releases/download/v$FBLIBS_VERSION/fizz-v$FBLIBS_VERSION.tar.gz -O fizz-$FBLIBS_VERSION.tar.gz fi -if [ ! -f flex-$FLEX_VERSION.tar.gz ]; then - wget https://github.com/westes/flex/releases/download/v$FLEX_VERSION/flex-$FLEX_VERSION.tar.gz -O flex-$FLEX_VERSION.tar.gz -fi + if [ ! -f fmt-$FMT_VERSION.tar.gz ]; then wget https://github.com/fmtlib/fmt/archive/refs/tags/$FMT_VERSION.tar.gz -O fmt-$FMT_VERSION.tar.gz fi @@ -765,14 +762,6 @@ echo "$BZIP2_SHA256 bzip2-$BZIP2_VERSION.tar.gz" | sha256sum -c echo "$DOUBLE_CONVERSION_SHA256 double-conversion-$DOUBLE_CONVERSION_VERSION.tar.gz" | sha256sum -c # verify fizz echo "$FIZZ_SHA256 fizz-$FBLIBS_VERSION.tar.gz" | sha256sum -c -# verify flex -if [ ! -f flex-$FLEX_VERSION.tar.gz.sig ]; then - wget https://github.com/westes/flex/releases/download/v$FLEX_VERSION/flex-$FLEX_VERSION.tar.gz.sig -fi -if false; then - $GPG --keyserver $KEYSERVER --recv-keys 0xE4B29C8D64885307 - $GPG --verify flex-$FLEX_VERSION.tar.gz.sig flex-$FLEX_VERSION.tar.gz -fi # verify fmt echo "$FMT_SHA256 fmt-$FMT_VERSION.tar.gz" | sha256sum -c # verify spdlog @@ -1025,7 +1014,6 @@ if [ ! -d $PREFIX/include/gflags ]; then if [ -d gflags ]; then rm -rf gflags fi - git clone https://github.com/memgraph/gflags.git gflags pushd gflags git checkout $GFLAGS_COMMIT_HASH @@ -1034,7 +1022,7 @@ if [ ! -d $PREFIX/include/gflags ]; then cmake .. $COMMON_CMAKE_FLAGS \ -DREGISTER_INSTALL_PREFIX=OFF \ -DBUILD_gflags_nothreads_LIB=OFF \ - -DGFLAGS_NO_FILENAMES=0 + -DGFLAGS_NO_FILENAMES=1 make -j$CPUS install popd && popd fi @@ -1232,18 +1220,6 @@ if false; then fi fi -log_tool_name "flex $FLEX_VERSION" -if [ ! -f $PREFIX/include/FlexLexer.h ]; then - if [ -d flex-$FLEX_VERSION ]; then - rm -rf flex-$FLEX_VERSION - fi - tar -xzf ../archives/flex-$FLEX_VERSION.tar.gz - pushd flex-$FLEX_VERSION - ./configure $COMMON_CONFIGURE_FLAGS - make -j$CPUS install - popd -fi - popd # NOTE: It's important/clean (e.g., easier upload to S3) to have a separated # folder to the output archive.