Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINIFICPP-2175 Increase CMAKE requirements to 3.24 #1624

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ jobs:
path: /tmp/bin
docker_build:
name: "Docker build for integration tests"
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
lordgamez marked this conversation as resolved.
Show resolved Hide resolved
timeout-minutes: 180
steps:
- id: checkout
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

cmake_minimum_required(VERSION 3.17)
cmake_minimum_required(VERSION 3.24)
cmake_policy(SET CMP0096 NEW) # policy to preserve the leading zeros in PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}
cmake_policy(SET CMP0065 OLD) # default export policy, required for self-dlopen
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Through JNI extensions you can run NiFi processors using NARs. The JNI extension
### To build

#### Utilities
* CMake 3.17 or greater
* CMake 3.24 or greater
* gcc 11 or greater
* bison 3.0.x+ (3.2 has been shown to fail builds)
* flex 2.6 or greater
Expand Down
8 changes: 1 addition & 7 deletions centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ install_libusb() {


bootstrap_cmake(){
case "$OS_MAJOR" in
7)
install_pkgs epel-release
install_pkgs cmake3
;;
*) install_pkgs cmake ;;
esac
install_cmake_from_binary
}

bootstrap_compiler() {
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
#

ARG BASE_IMAGE="alpine:3.16"
ARG BASE_IMAGE="alpine:3.17"
lordgamez marked this conversation as resolved.
Show resolved Hide resolved

# Build image
FROM ${BASE_IMAGE} AS build
Expand Down
2 changes: 1 addition & 1 deletion docker/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ RUN cd $MINIFI_BASE_DIR && \
source /opt/rh/devtoolset-11/enable && \
export PATH=/usr/lib64/ccache${PATH:+:${PATH}} && \
export CCACHE_DIR=${MINIFI_BASE_DIR}/.ccache && \
cmake3 -DSTATIC_BUILD= -DSKIP_TESTS=${DOCKER_SKIP_TESTS} ${MINIFI_OPTIONS} -DAWS_ENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" .. && \
cmake -DSTATIC_BUILD= -DSKIP_TESTS=${DOCKER_SKIP_TESTS} ${MINIFI_OPTIONS} -DAWS_ENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" .. && \
make -j "$(nproc)" ${DOCKER_MAKE_TARGET}
4 changes: 2 additions & 2 deletions docker/rockylinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ COPY . ${MINIFI_BASE_DIR}

# Install the system dependencies needed for a build
# gpsd-devel and ccache are in EPEL
RUN dnf -y install epel-release && dnf -y install sudo git which make libarchive ccache ca-certificates cmake perl && \
RUN dnf -y install epel-release && dnf -y install sudo git which make libarchive ccache ca-certificates perl && \
if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_GPS=ON"; then dnf -y install gpsd-devel; fi && \
if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_JNI=ON"; then dnf -y install java-1.8.0-openjdk maven; fi && \
if echo "$MINIFI_OPTIONS" | grep -q "ENABLE_PCAP=ON"; then dnf -y install libpcap-devel; fi && \
Expand All @@ -66,5 +66,5 @@ RUN cd $MINIFI_BASE_DIR && \
source /opt/rh/gcc-toolset-12/enable && \
export PATH=/usr/lib64/ccache${PATH:+:${PATH}} && \
export CCACHE_DIR=${MINIFI_BASE_DIR}/.ccache && \
cmake3 -DSTATIC_BUILD= -DSKIP_TESTS=${DOCKER_SKIP_TESTS} ${MINIFI_OPTIONS} -DAWS_ENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" .. && \
cmake -DSTATIC_BUILD= -DSKIP_TESTS=${DOCKER_SKIP_TESTS} ${MINIFI_OPTIONS} -DAWS_ENABLE_UNITY_BUILD=OFF -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" .. && \
make -j "$(nproc)" ${DOCKER_MAKE_TARGET}
30 changes: 30 additions & 0 deletions linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,33 @@ verify_gcc_enable(){
#feature="$1"
[ "$COMPILER_MAJOR" -ge 11 ] && echo true || echo false
}

install_cmake_from_binary() {
CMAKE_VERSION="3.24.4"
CMAKE_URL="https://cmake.org/files/v3.24/cmake-3.24.4-linux-x86_64.tar.gz"
EXPECTED_SHA256="cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19"

TMP_DIR=$(mktemp -d)

install_pkgs wget
wget -P "$TMP_DIR" "$CMAKE_URL"

ACTUAL_SHA256=$(sha256sum "$TMP_DIR/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz" | cut -d " " -f 1)

if [ "$ACTUAL_SHA256" != "$EXPECTED_SHA256" ]; then
echo "ERROR: SHA-256 verification failed. Aborting."
rm -r "$TMP_DIR"
exit 1
fi

echo "Installing CMake $CMAKE_VERSION to /opt/cmake-$CMAKE_VERSION..."
set -x
tar -C "$TMP_DIR" -zxf "$TMP_DIR/cmake-$CMAKE_VERSION-linux-x86_64.tar.gz"
sudo mv "$TMP_DIR/cmake-$CMAKE_VERSION-linux-x86_64" /opt/cmake-$CMAKE_VERSION

sudo ln -s "/opt/cmake-$CMAKE_VERSION/bin/cmake" /usr/local/bin/cmake
set +x

echo "CMake $CMAKE_VERSION has been installed successfully."
rm -r "$TMP_DIR"
}
Loading