Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: "Dependencies"
uses: ./.github/workflows/dependencies.yaml
with:
cxx_standard: cpp17
cxx_standard: cpp23

get_dependencies_cpp03:
name: "Dependencies [C++03]"
Expand All @@ -37,7 +37,7 @@ jobs:
target: "bmqbrkr bmqtool bmqstoragetool all.it"
save_build_as_artifacts: true
run_unit_tests: false
cxx_standard: cpp17
cxx_standard: cpp23

build_ubuntu_cpp03:
name: "Build [ubuntu, C++03]"
Expand All @@ -59,7 +59,7 @@ jobs:
target: "all.t"
save_build_as_artifacts: false
run_unit_tests: true
cxx_standard: cpp17
cxx_standard: cpp23

unit_tests_python:
name: UT [python]
Expand Down Expand Up @@ -339,9 +339,9 @@ jobs:
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/opt/bb/lib64/pkgconfig
run: |
cmake --preset gh-prometheus-ubuntu-latest-cpp17 -S .
cmake --preset gh-prometheus-ubuntu-latest-cpp23 -S .
echo "::add-matcher::.github/workflows/problem-matchers/cpp-prometheus.json"
cmake --build --preset gh-prometheus-ubuntu-latest-cpp17
cmake --build --preset gh-prometheus-ubuntu-latest-cpp23
echo "::remove-matcher owner=cpp-prometheus"

- name: Create prometheus dir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependencies-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
with:
cxx_standard: cpp03

build_dependencies_cpp17:
build_dependencies_cpp23:
uses: ./.github/workflows/dependencies.yaml
with:
cxx_standard: cpp17
cxx_standard: cpp23
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: "What C++ Standard to build with. [cpp03, cpp11, cpp14, cpp17, cpp20, cpp23]"
required: true
type: string
default: "cpp17"
default: "cpp23"
outputs:
cache_key:
description: "GH Actions Cache key associated with the built dependencies"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
name: "Dependencies"
uses: ./.github/workflows/dependencies.yaml
with:
cxx_standard: cpp17
cxx_standard: cpp23

build1:
name: "Build ref ${{ github.event.inputs.ref1 }}"
Expand All @@ -38,7 +38,7 @@ jobs:
target: "bmqbrkr bmqtool"
save_build_as_artifacts: true
run_unit_tests: false
cxx_standard: cpp17
cxx_standard: cpp23

build2:
name: "Build ref ${{ github.event.inputs.ref2 }}"
Expand All @@ -50,7 +50,7 @@ jobs:
target: "bmqbrkr bmqtool"
save_build_as_artifacts: true
run_unit_tests: false
cxx_standard: cpp17
cxx_standard: cpp23

integration_tests_ubuntu_upgrade_version:
name: Test 7-node cluster upgrade [${{ matrix.cluster }}/${{ matrix.mode }}/${{ matrix.consistency }}]
Expand Down
74 changes: 35 additions & 39 deletions bin/build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ INSTALL_DEPS=false
# Parse args (simple, portable long-option handling)
for arg in "$@"; do
case "$arg" in
-h|--help)
print_help
exit 0
;;
--install-deps)
INSTALL_DEPS=true
;;
*)
echo "Unknown option: $arg" >&2
echo "Try '--help' for usage." >&2
exit 2
;;
-h | --help)
print_help
exit 0
;;
--install-deps)
INSTALL_DEPS=true
;;
*)
echo "Unknown option: $arg" >&2
echo "Try '--help' for usage." >&2
exit 2
;;
esac
done

Expand Down Expand Up @@ -94,7 +94,6 @@ mkdir -p "${DIR_BUILD}"
DIR_INSTALL="${DIR_INSTALL:-${DIR_ROOT}}"
mkdir -p "${DIR_INSTALL}"


# :: Clone dependencies :::::::::::::::::::::::::::::::::::::::::::::::::::::::
if [ ! -d "${DIR_THIRDPARTY}/bde-tools" ]; then
git clone --depth 1 --branch 4.28.0.0 https://github.com/bloomberg/bde-tools "${DIR_THIRDPARTY}/bde-tools"
Expand All @@ -106,7 +105,6 @@ if [ ! -d "${DIR_THIRDPARTY}/ntf-core" ]; then
git clone --depth 1 --branch 2.6.10 https://github.com/bloomberg/ntf-core.git "${DIR_THIRDPARTY}/ntf-core"
fi


# :: Install required packages ::::::::::::::::::::::::::::::::::::::::::::::::

# Build and install BDE
Expand All @@ -120,7 +118,7 @@ if [ ! -e "${DIR_BUILD}/bde/.complete" ]; then
# shellcheck disable=SC2030
export CXXFLAGS="-w" CFLAGS="-w"
cd "${DIR_THIRDPARTY}/bde"
eval "$(bbs_build_env -p clang -u opt_64_cpp17 -b "${DIR_BUILD}/bde" -i "${DIR_INSTALL}")"
eval "$(bbs_build_env -p clang -u opt_64_cpp23 -b "${DIR_BUILD}/bde" -i "${DIR_INSTALL}")"
bbs_build configure --prefix="${DIR_INSTALL}"
bbs_build build --prefix="${DIR_INSTALL}"
bbs_build install --install_dir="/" --prefix="${DIR_INSTALL}"
Expand All @@ -136,16 +134,16 @@ if [ ! -e "${DIR_BUILD}/ntf/.complete" ]; then
# shellcheck disable=SC2031
export CXXFLAGS="-w" CFLAGS="-w"
cd "${DIR_THIRDPARTY}/ntf-core"
./configure --prefix "${DIR_INSTALL}" \
--output "${DIR_BUILD}/ntf" \
--toolchain "${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/clang-default.cmake" \
--without-warnings-as-errors \
--without-usage-examples \
--without-applications \
--with-zlib \
--without-zstd \
--without-lz4 \
--ufid opt_64_cpp17
./configure --prefix "${DIR_INSTALL}" \
--output "${DIR_BUILD}/ntf" \
--toolchain "${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/clang-default.cmake" \
--without-warnings-as-errors \
--without-usage-examples \
--without-applications \
--with-zlib \
--without-zstd \
--without-lz4 \
--ufid opt_64_cpp23
make -j 16
make install
)
Expand All @@ -155,31 +153,29 @@ fi
BREW_PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/googletest/lib/pkgconfig"
FLEX_ROOT="/opt/homebrew/opt/flex"


# :: Build the BlazingMQ repo :::::::::::::::::::::::::::::::::::::::::::::::::
CMAKE_OPTIONS=(\
-DBDE_BUILD_TARGET_64=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}" \
-DCMAKE_MODULE_PATH="${DIR_THIRDPARTY}/bde-tools/cmake;${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem" \
-DCMAKE_PREFIX_PATH="${DIR_INSTALL}" \
-DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/clang-default.cmake" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
CMAKE_OPTIONS=(
-DBDE_BUILD_TARGET_64=1
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_LIBDIR="lib"
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}"
-DCMAKE_MODULE_PATH="${DIR_THIRDPARTY}/bde-tools/cmake;${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem"
-DCMAKE_PREFIX_PATH="${DIR_INSTALL}"
-DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/clang-default.cmake"
-DCMAKE_CXX_STANDARD=23
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DFLEX_ROOT="${FLEX_ROOT}")

PKG_CONFIG_PATH="${DIR_INSTALL}/lib/pkgconfig:${BREW_PKG_CONFIG_PATH}" \
cmake -B "${DIR_BUILD}/blazingmq" -S "${DIR_ROOT}" "${CMAKE_OPTIONS[@]}"
cmake -B "${DIR_BUILD}/blazingmq" -S "${DIR_ROOT}" "${CMAKE_OPTIONS[@]}"
make -C "${DIR_BUILD}/blazingmq" -j 16

echo broker is here: "${DIR_BUILD}/blazingmq/src/applications/bmqbrkr/bmqbrkr.tsk"
echo to run the broker: "${DIR_BUILD}/blazingmq/src/applications/bmqbrkr/run"
echo tool is here: "${DIR_BUILD}/blazingmq/src/applications/bmqtool/bmqtool.tsk"

SELF_HOST_ADDRESS="127.0.0.1 $(hostname)"
if ! (grep -q "$SELF_HOST_ADDRESS" /etc/hosts > /dev/null);
then
if ! (grep -q "$SELF_HOST_ADDRESS" /etc/hosts >/dev/null); then
echo "Warning: self hostname $(hostname) not found in /etc/hosts"
echo "It might be necessary to add it manually to launch bmqbrkr:"
echo "sudo bash -c \"echo \\\"$SELF_HOST_ADDRESS\\\" >> /etc/hosts\""
Expand Down
87 changes: 43 additions & 44 deletions bin/build-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@
# This script builds BlazingMQ and all of its dependencies.

echo -e "Before running this script, install the following prerequisites, if not present yet," \
"by executing the following commands:\n" \
"sudo apt update && sudo apt -y install ca-certificates\n" \
"sudo apt install -y --no-install-recommends" \
"autoconf automake build-essential gdb cmake ninja-build pkg-config bison libfl-dev libbenchmark-dev libgmock-dev libtool libz-dev"
"by executing the following commands:\n" \
"sudo apt update && sudo apt -y install ca-certificates\n" \
"sudo apt install -y --no-install-recommends" \
"autoconf automake build-essential gdb cmake ninja-build pkg-config bison libfl-dev libbenchmark-dev libgmock-dev libtool libz-dev"

# :: Parse and validate arguments :::::::::::::::::::::::::::::::::::::::::::::
print_usage_and_exit_with_error() {
echo "Usage: $0 [--plugins list,of,plugins]"
echo " -p|--plugins list,of,plugins Specify plugins you would like to build."
echo " Available plugins: prometheus"
exit 1;
exit 1
}
VALID_ARGS=$(getopt -o p: --long plugins: -- "$@") || print_usage_and_exit_with_error
eval "set -- $VALID_ARGS"

BUILD_PROMETHEUS=false
while [ "$#" -gt 0 ]; do
case "$1" in
case "$1" in
-p | --plugins)
for i in ${2//,/ }
do
for i in ${2//,/ }; do
if [ "$i" == "prometheus" ]; then
BUILD_PROMETHEUS=true
else
echo "Invalid plugin name '$i' provided"
print_usage_and_exit_with_error;
print_usage_and_exit_with_error
fi
done
shift 2
;;
--) shift;
--)
shift
break
;;
esac
esac
done

set -e
Expand Down Expand Up @@ -91,7 +91,7 @@ PATH="${DIR_THIRDPARTY}/bde-tools/bin:$PATH"

if [ ! -e "${DIR_BUILD}/bde/.complete" ]; then
pushd "${DIR_THIRDPARTY}/bde"
eval "$(bbs_build_env -u opt_64_cpp17 -b "${DIR_BUILD}/bde" -i "${DIR_INSTALL}")"
eval "$(bbs_build_env -u opt_64_cpp23 -b "${DIR_BUILD}/bde" -i "${DIR_INSTALL}")"
bbs_build configure --prefix="${DIR_INSTALL}"
bbs_build build --prefix="${DIR_INSTALL}"
bbs_build install --install_dir="/" --prefix="${DIR_INSTALL}"
Expand All @@ -103,15 +103,15 @@ fi
if [ ! -e "${DIR_BUILD}/ntf/.complete" ]; then
# Build and install NTF
pushd "${DIR_THIRDPARTY}/ntf-core"
./configure --prefix "${DIR_INSTALL}" \
--output "${DIR_BUILD}/ntf" \
--without-warnings-as-errors \
--without-usage-examples \
--without-applications \
--with-zlib \
--without-zstd \
--without-lz4 \
--ufid opt_64_cpp17
./configure --prefix "${DIR_INSTALL}" \
--output "${DIR_BUILD}/ntf" \
--without-warnings-as-errors \
--without-usage-examples \
--without-applications \
--with-zlib \
--without-zstd \
--without-lz4 \
--ufid opt_64_cpp23
make -j 16
make install
popd
Expand All @@ -133,8 +133,7 @@ if [ "${BUILD_PROMETHEUS}" == true ]; then
--disable-telnet --disable-tftp --disable-pop3 --disable-imap \
--disable-smb --disable-smtp --disable-gopher --disable-manual \
--disable-ipv6 --disable-sspi --disable-crypto-auth \
--disable-ntlm-wb --disable-tls-srp --with-pic --without-nghttp2\
--without-libidn2 --without-libssh2 --without-brotli \
--disable-ntlm-wb --disable-tls-srp --with-pic --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli \
--without-ssl --without-zlib --prefix="${DIR_INSTALL}"
make curl_LDFLAGS=-all-static
make curl_LDFLAGS=-all-static install
Expand All @@ -150,14 +149,14 @@ if [ "${BUILD_PROMETHEUS}" == true ]; then
git submodule update
# Build and install prometheus-cpp
PKG_CONFIG_PATH="${DIR_INSTALL}/lib/pkgconfig:$(pkg-config --variable pc_path pkg-config)" \
cmake -DBUILD_SHARED_LIBS=OFF \
-DENABLE_PUSH=ON \
-DENABLE_COMPRESSION=OFF \
-DENABLE_TESTING=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DGENERATE_PKGCONFIG=ON \
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}" \
-B "${DIR_BUILD}/prometheus-cpp"
cmake -DBUILD_SHARED_LIBS=OFF \
-DENABLE_PUSH=ON \
-DENABLE_COMPRESSION=OFF \
-DENABLE_TESTING=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DGENERATE_PKGCONFIG=ON \
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}" \
-B "${DIR_BUILD}/prometheus-cpp"
cmake --build "${DIR_BUILD}/prometheus-cpp" --parallel 16
cmake --install "${DIR_BUILD}/prometheus-cpp" --prefix "${DIR_INSTALL}"
touch "${DIR_BUILD}/prometheus-cpp/.complete"
Expand All @@ -166,26 +165,26 @@ if [ "${BUILD_PROMETHEUS}" == true ]; then
fi

# :: Build the BlazingMQ repo :::::::::::::::::::::::::::::::::::::::::::::::::
CMAKE_OPTIONS=(\
-DBDE_BUILD_TARGET_64=1 \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}" \
-DCMAKE_MODULE_PATH="${DIR_THIRDPARTY}/bde-tools/cmake;${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem" \
-DCMAKE_PREFIX_PATH="${DIR_INSTALL}" \
-DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
CMAKE_OPTIONS=(
-DBDE_BUILD_TARGET_64=1
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_LIBDIR="lib"
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}"
-DCMAKE_MODULE_PATH="${DIR_THIRDPARTY}/bde-tools/cmake;${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem"
-DCMAKE_PREFIX_PATH="${DIR_INSTALL}"
-DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/linux/gcc-default.cmake"
-DCMAKE_CXX_STANDARD=23
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DFLEX_ROOT=/usr/lib/x86_64-linux-gnu)

if [ "${BUILD_PROMETHEUS}" == true ]; then
CMAKE_OPTIONS+=(-DINSTALL_TARGETS=prometheus);
CMAKE_OPTIONS+=(-DINSTALL_TARGETS=prometheus)
else
CMAKE_OPTIONS+=(-UINSTALL_TARGETS);
CMAKE_OPTIONS+=(-UINSTALL_TARGETS)
fi

PKG_CONFIG_PATH="${DIR_INSTALL}/lib64/pkgconfig:${DIR_INSTALL}/lib/pkgconfig:$(pkg-config --variable pc_path pkg-config)" \
cmake -B "${DIR_BUILD}/blazingmq" -S "${DIR_ROOT}" "${CMAKE_OPTIONS[@]}"
cmake -B "${DIR_BUILD}/blazingmq" -S "${DIR_ROOT}" "${CMAKE_OPTIONS[@]}"
make -C "${DIR_BUILD}/blazingmq" -j 16

echo broker is here: "${DIR_BUILD}/blazingmq/src/applications/bmqbrkr/bmqbrkr.tsk"
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN bin/build_deps.sh \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBDE_BUILD_TARGET_SAFE=ON \
-DBDE_BUILD_TARGET_64=ON \
-DBDE_BUILD_TARGET_CPP17=ON \
-DBDE_BUILD_TARGET_CPP23=ON \
-DCMAKE_PREFIX_PATH=/workspace/srcs/bde-tools/BdeBuildSystem \
-DCMAKE_INSTALL_LIBDIR=lib64 \
&& cmake --build cmake.bld/Linux --parallel 8 --target bmqbrkr bmqtool \
Expand Down
Loading
Loading