Add support for Fedora 36 (#787)

This commit is contained in:
Jure Bajic 2023-02-17 10:47:36 +01:00 committed by GitHub
parent beaba0fc16
commit 15c8662023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 87 additions and 11 deletions

View File

@ -176,3 +176,20 @@ jobs:
with: with:
name: debian-11-arm name: debian-11-arm
path: build/output/debian-11-arm/memgraph*.deb 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

View File

@ -26,6 +26,7 @@ TOOLCHAIN_BUILD_DEPS=(
diffutils diffutils
libipt libipt-devel # intel libipt libipt-devel # intel
patch patch
perl # for openssl
) )
TOOLCHAIN_RUN_DEPS=( TOOLCHAIN_RUN_DEPS=(
@ -36,7 +37,6 @@ TOOLCHAIN_RUN_DEPS=(
readline # for cmake and llvm readline # for cmake and llvm
libffi libxml2 # for llvm libffi libxml2 # for llvm
openssl-devel openssl-devel
perl # for openssl
) )
MEMGRAPH_BUILD_DEPS=( MEMGRAPH_BUILD_DEPS=(
@ -64,6 +64,10 @@ list() {
check() { check() {
local missing="" 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 for pkg in $1; do
if ! dnf list installed "$pkg" >/dev/null 2>/dev/null; then if ! dnf list installed "$pkg" >/dev/null 2>/dev/null; then
missing="$pkg $missing" missing="$pkg $missing"
@ -73,6 +77,7 @@ check() {
echo "MISSING PACKAGES: $missing" echo "MISSING PACKAGES: $missing"
exit 1 exit 1
fi fi
LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}
} }
install() { install() {

View File

@ -379,6 +379,34 @@ if [ ! -f $PREFIX/bin/gdb ]; then
--without-babeltrace \ --without-babeltrace \
--enable-tui \ --enable-tui \
--with-python=python3 --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 else
# https://buildd.debian.org/status/fetch.php?pkg=gdb&arch=amd64&ver=8.2.1-2&stamp=1550831554&raw=0 # https://buildd.debian.org/status/fetch.php?pkg=gdb&arch=amd64&ver=8.2.1-2&stamp=1550831554&raw=0
env \ env \
@ -651,6 +679,7 @@ export PS1="($NAME) \$PS1"
export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/lib64 export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/lib64
export CXXFLAGS=-isystem\ $PREFIX/include\ \$CXXFLAGS export CXXFLAGS=-isystem\ $PREFIX/include\ \$CXXFLAGS
export CFLAGS=-isystem\ $PREFIX/include\ \$CFLAGS export CFLAGS=-isystem\ $PREFIX/include\ \$CFLAGS
export VENV=$PREFIX
# disable root # disable root
function su () { function su () {
@ -702,7 +731,7 @@ PROXYGEN_SHA256=5360a8ccdfb2f5a6c7b3eed331ec7ab0e2c792d579c6fff499c85c516c11fe14
SNAPPY_SHA256=75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7 SNAPPY_SHA256=75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7
SNAPPY_VERSION=1.1.9 SNAPPY_VERSION=1.1.9
XZ_VERSION=5.2.5 # for LZMA XZ_VERSION=5.2.5 # for LZMA
ZLIB_VERSION=1.2.12 ZLIB_VERSION=1.2.13
ZSTD_VERSION=1.5.0 ZSTD_VERSION=1.5.0
WANGLE_SHA256=1002e9c32b6f4837f6a760016e3b3e22f3509880ef3eaad191c80dc92655f23f WANGLE_SHA256=1002e9c32b6f4837f6a760016e3b3e22f3509880ef3eaad191c80dc92655f23f
@ -1226,7 +1255,7 @@ popd
# create toolchain archive # create toolchain archive
if [ ! -f $NAME-binaries-$DISTRO.tar.gz ]; then if [ ! -f $NAME-binaries-$DISTRO.tar.gz ]; then
DISTRO_FULL_NAME=${DISTRO} DISTRO_FULL_NAME=${DISTRO}
if [[ "${DISTRO}" == centos* ]]; then if [[ "${DISTRO}" == centos* ]] || [[ "${DISTRO}" == fedora* ]]; then
if [[ "$for_arm" = "true" ]]; then if [[ "$for_arm" = "true" ]]; then
DISTRO_FULL_NAME="$DISTRO_FULL_NAME-aarch64" DISTRO_FULL_NAME="$DISTRO_FULL_NAME-aarch64"
else else

4
init
View File

@ -113,8 +113,8 @@ if [[ "$setup_libs" == "true" ]]; then
fi fi
# Fix for centos 7 during release # Fix for centos 7 during release
if [ "${ARCHITECTURE}" = "centos-7" ]; then if [ "${DISTRO}" = "centos-7" ] || [ "${DISTRO}" = "debian-11" ]; then
python3 -m pip uninstall virtualenv python3 -m pip uninstall -y virtualenv
python3 -m pip install virtualenv python3 -m pip install virtualenv
fi fi

View File

@ -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.") the next generation of applications driver by real-time connected data.")
# Add `openssl` package to dependencies list. Used to generate SSL certificates. # Add `openssl` package to dependencies list. Used to generate SSL certificates.
# We also depend on `python3` because we embed it in Memgraph. # 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. # All variables must be set before including.
include(CPack) include(CPack)

View File

@ -28,3 +28,7 @@ services:
build: build:
context: ubuntu-22.04 context: ubuntu-22.04
container_name: "mgbuild_ubuntu-22.04" container_name: "mgbuild_ubuntu-22.04"
mgbuild_fedora-36:
build:
context: fedora-36
container_name: "mgbuild_fedora-36"

View File

@ -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"]

View File

@ -3,7 +3,7 @@
set -Eeuo pipefail set -Eeuo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 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/../.." PROJECT_ROOT="$SCRIPT_DIR/../.."
TOOLCHAIN_VERSION="toolchain-v4" TOOLCHAIN_VERSION="toolchain-v4"
ACTIVATE_TOOLCHAIN="source /opt/${TOOLCHAIN_VERSION}/activate" ACTIVATE_TOOLCHAIN="source /opt/${TOOLCHAIN_VERSION}/activate"
@ -23,9 +23,9 @@ make_package () {
echo "Building Memgraph for $os on $build_container..." echo "Building Memgraph for $os on $build_container..."
package_command="" package_command=""
if [[ "$os" =~ ^"centos".* ]]; then if [[ "$os" =~ ^"centos".* ]] || [[ "$os" =~ ^"fedora".* ]]; then
docker exec "$build_container" bash -c "yum -y update" 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 fi
if [[ "$os" =~ ^"debian".* ]]; then if [[ "$os" =~ ^"debian".* ]]; then
docker exec "$build_container" bash -c "apt update" docker exec "$build_container" bash -c "apt update"

View File

@ -30,7 +30,7 @@ BuildRequires: systemd
# This is needed to prevent Python compilation errors when building the RPM # This is needed to prevent Python compilation errors when building the RPM
# package # package
# https://github.com/scylladb/scylla/issues/2235 # https://github.com/scylladb/scylla/issues/2235
%if 0%{?rhel} < 8 %if 0%{?rhel} && 0%{?rhel} < 8
%global __os_install_post \ %global __os_install_post \
/usr/lib/rpm/redhat/brp-compress \ /usr/lib/rpm/redhat/brp-compress \
%{!?__debug_package:\ %{!?__debug_package:\
@ -40,7 +40,9 @@ BuildRequires: systemd
/usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
%{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \ %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
%{nil} %{nil}
%else %endif
%if 0%{?fedora} && 0%{?fedora} < 35
%global __os_install_post \ %global __os_install_post \
/usr/lib/rpm/brp-compress \ /usr/lib/rpm/brp-compress \
%{!?__debug_package:\ %{!?__debug_package:\

4
release/rpm/rpmlintrc Normal file
View File

@ -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")