diff --git a/.github/workflows/package_all.yaml b/.github/workflows/package_all.yaml index 0a7cd891a..6e1196e32 100644 --- a/.github/workflows/package_all.yaml +++ b/.github/workflows/package_all.yaml @@ -176,3 +176,20 @@ jobs: with: name: debian-11-arm path: build/output/debian-11-arm/memgraph*.deb + + fedora-36: + runs-on: [self-hosted, DockerMgBuild, X64] + timeout-minutes: 60 + steps: + - name: "Set up repository" + uses: actions/checkout@v3 + with: + fetch-depth: 0 # Required because of release/get_version.py + - name: "Build package" + run: | + ./release/package/run.sh package fedora-36 + - name: "Upload package" + uses: actions/upload-artifact@v3 + with: + name: fedora-36 + path: build/output/fedora-36/memgraph*.rpm diff --git a/environment/os/fedora-36.sh b/environment/os/fedora-36.sh index 8161e8e52..c59881f65 100755 --- a/environment/os/fedora-36.sh +++ b/environment/os/fedora-36.sh @@ -26,6 +26,7 @@ TOOLCHAIN_BUILD_DEPS=( diffutils libipt libipt-devel # intel patch + perl # for openssl ) TOOLCHAIN_RUN_DEPS=( @@ -36,7 +37,6 @@ TOOLCHAIN_RUN_DEPS=( readline # for cmake and llvm libffi libxml2 # for llvm openssl-devel - perl # for openssl ) MEMGRAPH_BUILD_DEPS=( @@ -64,6 +64,10 @@ list() { check() { local missing="" + # On Fedora yum/dnf and python10 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="" for pkg in $1; do if ! dnf list installed "$pkg" >/dev/null 2>/dev/null; then missing="$pkg $missing" @@ -73,6 +77,7 @@ check() { echo "MISSING PACKAGES: $missing" exit 1 fi + LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH} } install() { diff --git a/environment/toolchain/v4.sh b/environment/toolchain/v4.sh index 259804fa9..9dd997ad4 100755 --- a/environment/toolchain/v4.sh +++ b/environment/toolchain/v4.sh @@ -379,6 +379,34 @@ if [ ! -f $PREFIX/bin/gdb ]; then --without-babeltrace \ --enable-tui \ --with-python=python3 + elif [[ "${DISTRO}" == fedora* ]]; then + # Remove readline, gdb does not compile + env \ + CC=gcc \ + CXX=g++ \ + CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \ + CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security" \ + CPPFLAGS="-Wdate-time -D_FORTIFY_SOURCE=2 -fPIC" \ + LDFLAGS="-Wl,-z,relro" \ + PYTHON="" \ + ../configure \ + --build=x86_64-linux-gnu \ + --host=x86_64-linux-gnu \ + --prefix=$PREFIX \ + --disable-maintainer-mode \ + --disable-dependency-tracking \ + --disable-silent-rules \ + --disable-gdbtk \ + --disable-shared \ + --without-guile \ + --with-system-gdbinit=$PREFIX/etc/gdb/gdbinit \ + --with-expat \ + --with-system-zlib \ + --with-lzma \ + --with-babeltrace \ + --with-intel-pt \ + --enable-tui \ + --with-python=python3 else # https://buildd.debian.org/status/fetch.php?pkg=gdb&arch=amd64&ver=8.2.1-2&stamp=1550831554&raw=0 env \ @@ -651,6 +679,7 @@ export PS1="($NAME) \$PS1" export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/lib64 export CXXFLAGS=-isystem\ $PREFIX/include\ \$CXXFLAGS export CFLAGS=-isystem\ $PREFIX/include\ \$CFLAGS +export VENV=$PREFIX # disable root function su () { @@ -702,7 +731,7 @@ PROXYGEN_SHA256=5360a8ccdfb2f5a6c7b3eed331ec7ab0e2c792d579c6fff499c85c516c11fe14 SNAPPY_SHA256=75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7 SNAPPY_VERSION=1.1.9 XZ_VERSION=5.2.5 # for LZMA -ZLIB_VERSION=1.2.12 +ZLIB_VERSION=1.2.13 ZSTD_VERSION=1.5.0 WANGLE_SHA256=1002e9c32b6f4837f6a760016e3b3e22f3509880ef3eaad191c80dc92655f23f @@ -1226,7 +1255,7 @@ popd # create toolchain archive if [ ! -f $NAME-binaries-$DISTRO.tar.gz ]; then DISTRO_FULL_NAME=${DISTRO} - if [[ "${DISTRO}" == centos* ]]; then + if [[ "${DISTRO}" == centos* ]] || [[ "${DISTRO}" == fedora* ]]; then if [[ "$for_arm" = "true" ]]; then DISTRO_FULL_NAME="$DISTRO_FULL_NAME-aarch64" else diff --git a/init b/init index adaafdeff..a4754fb3e 100755 --- a/init +++ b/init @@ -113,8 +113,8 @@ if [[ "$setup_libs" == "true" ]]; then fi # Fix for centos 7 during release -if [ "${ARCHITECTURE}" = "centos-7" ]; then - python3 -m pip uninstall virtualenv +if [ "${DISTRO}" = "centos-7" ] || [ "${DISTRO}" = "debian-11" ]; then + python3 -m pip uninstall -y virtualenv python3 -m pip install virtualenv fi diff --git a/release/CMakeLists.txt b/release/CMakeLists.txt index 2715d39c3..489aea989 100644 --- a/release/CMakeLists.txt +++ b/release/CMakeLists.txt @@ -67,7 +67,7 @@ It aims to deliver developers the speed, simplicity and scale required to build the next generation of applications driver by real-time connected data.") # Add `openssl` package to dependencies list. Used to generate SSL certificates. # We also depend on `python3` because we embed it in Memgraph. -set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.0.0, curl >= 7.29.0, python3 >= 3.5.0, libstdc >= 6, logrotate") +set(CPACK_RPM_PACKAGE_REQUIRES "openssl >= 1.0.0, curl >= 7.29.0, python3 >= 3.5.0, libstdc++ >= 6, logrotate") # All variables must be set before including. include(CPack) diff --git a/release/package/docker-compose.yml b/release/package/docker-compose.yml index 2f073267e..1f285bf84 100644 --- a/release/package/docker-compose.yml +++ b/release/package/docker-compose.yml @@ -28,3 +28,7 @@ services: build: context: ubuntu-22.04 container_name: "mgbuild_ubuntu-22.04" + mgbuild_fedora-36: + build: + context: fedora-36 + container_name: "mgbuild_fedora-36" diff --git a/release/package/fedora-36/Dockerfile b/release/package/fedora-36/Dockerfile new file mode 100644 index 000000000..8e2f8a6fe --- /dev/null +++ b/release/package/fedora-36/Dockerfile @@ -0,0 +1,15 @@ +FROM fedora:36 + +ARG TOOLCHAIN_VERSION + +# Stops tzdata interactive configuration. +RUN yum -y update \ + && yum install -y wget git +# Do NOT be smart here and clean the cache because the container is used in the +# stateful context. + +RUN wget -q https://s3-eu-west-1.amazonaws.com/deps.memgraph.io/${TOOLCHAIN_VERSION}/${TOOLCHAIN_VERSION}-binaries-fedora-36-x86_64.tar.gz \ + -O ${TOOLCHAIN_VERSION}-binaries-fedora-36-x86_64.tar.gz \ + && tar xzvf ${TOOLCHAIN_VERSION}-binaries-fedora-36-x86_64.tar.gz -C /opt + +ENTRYPOINT ["sleep", "infinity"] diff --git a/release/package/run.sh b/release/package/run.sh index 7d0b9848c..680e7a4db 100755 --- a/release/package/run.sh +++ b/release/package/run.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -SUPPORTED_OS=(centos-7 centos-9 debian-10 debian-11 ubuntu-18.04 ubuntu-20.04 ubuntu-22.04 debian-11-arm) +SUPPORTED_OS=(centos-7 centos-9 debian-10 debian-11 ubuntu-18.04 ubuntu-20.04 ubuntu-22.04 debian-11-arm fedora-36) PROJECT_ROOT="$SCRIPT_DIR/../.." TOOLCHAIN_VERSION="toolchain-v4" ACTIVATE_TOOLCHAIN="source /opt/${TOOLCHAIN_VERSION}/activate" @@ -23,9 +23,9 @@ make_package () { echo "Building Memgraph for $os on $build_container..." package_command="" - if [[ "$os" =~ ^"centos".* ]]; then + if [[ "$os" =~ ^"centos".* ]] || [[ "$os" =~ ^"fedora".* ]]; then docker exec "$build_container" bash -c "yum -y update" - package_command=" cpack -G RPM --config ../CPackConfig.cmake && rpmlint memgraph*.rpm " + package_command=" cpack -G RPM --config ../CPackConfig.cmake && rpmlint --file='../../release/rpm/rpmlintrc' memgraph*.rpm " fi if [[ "$os" =~ ^"debian".* ]]; then docker exec "$build_container" bash -c "apt update" diff --git a/release/rpm/memgraph.spec.in b/release/rpm/memgraph.spec.in index 448f884ac..d663ce953 100644 --- a/release/rpm/memgraph.spec.in +++ b/release/rpm/memgraph.spec.in @@ -30,7 +30,7 @@ BuildRequires: systemd # This is needed to prevent Python compilation errors when building the RPM # package # https://github.com/scylladb/scylla/issues/2235 -%if 0%{?rhel} < 8 +%if 0%{?rhel} && 0%{?rhel} < 8 %global __os_install_post \ /usr/lib/rpm/redhat/brp-compress \ %{!?__debug_package:\ @@ -40,7 +40,9 @@ BuildRequires: systemd /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ %{nil} -%else +%endif + +%if 0%{?fedora} && 0%{?fedora} < 35 %global __os_install_post \ /usr/lib/rpm/brp-compress \ %{!?__debug_package:\ diff --git a/release/rpm/rpmlintrc b/release/rpm/rpmlintrc new file mode 100644 index 000000000..1de91a77b --- /dev/null +++ b/release/rpm/rpmlintrc @@ -0,0 +1,4 @@ +# from https://github.com/google/earthenterprise/blob/master/earth_enterprise/rpmlintrc + +# We are not packaging log dir +addFilter("E: logrotate-log-dir-not-packaged")