Skip to content

Commit

Permalink
HPCC-33205 Re-enable CentOS-7 builds
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jan 14, 2025
1 parent 4a8ecb4 commit 077df01
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
name: LN
cmake_options_extra: ""
ln: true
- os: centos-7
name: LN
ln: true
fail-fast: false

steps:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'ubuntu-22.04'
- 'ubuntu-20.04'
- 'rockylinux-8'
- 'centos-7'
description: 'Operating System'
required: false
default: 'ubuntu-22.04'
Expand Down Expand Up @@ -168,6 +169,14 @@ jobs:
os: rockylinux-8
secrets: inherit

build-docker-centos-7:
if: ${{ contains('pull_request,push', github.event_name) }}
uses: ./.github/workflows/build-docker.yml
with:
os: centos-7
cmake-configuration-ex: "-DVCPKG_TARGET_TRIPLET=x64-centos-7-dynamic -DVCPKG_HOST_TRIPLET=x64-centos-7-dynamic"
secrets: inherit

build-gh_runner-ubuntu-22_04:
if: ${{ contains('schedule,push', github.event_name) }}
uses: ./.github/workflows/build-gh_runner.yml
Expand Down
11 changes: 2 additions & 9 deletions dockerfiles/vcpkg/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function doBuild() {
# docker pull "hpccsystems/platform-build-$1:$VCPKG_REF" || true
# docker pull "hpccsystems/platform-build-$1:$GITHUB_BRANCH" || true

docker build --progress plain --rm -f "$SCRIPT_DIR/$1.dockerfile" \
docker buildx build --rm -f "$SCRIPT_DIR/$1.dockerfile" \
--build-arg DOCKER_NAMESPACE=$DOCKER_USERNAME \
--build-arg VCPKG_REF=$VCPKG_REF \
--cache-from hpccsystems/platform-build-$1:$VCPKG_REF \
Expand All @@ -49,11 +49,6 @@ function doBuild() {
# docker push hpccsystems/platform-build-$1:$GITHUB_BRANCH

CMAKE_OPTIONS_EXTRA=""
if [ "$1" == "centos-7*" ]; then
CMAKE_OPTIONS_EXTRA="-DVCPKG_TARGET_TRIPLET=x64-centos-7-dynamic"
elif [ "$1" == "amazonlinux" ]; then
CMAKE_OPTIONS_EXTRA="-DVCPKG_TARGET_TRIPLET=x64-amazonlinux-dynamic"
fi
mkdir -p $HOME/.ccache
docker run --rm \
--mount source="$(pwd)",target=/hpcc-dev/HPCC-Platform,type=bind,consistency=cached \
Expand All @@ -75,14 +70,12 @@ trap 'kill $(jobs -p)' EXIT
mkdir -p ./vcpkg-logs

if [ "$1" != "" ]; then
doBuild $1 &
doBuild $1
else
doBuild ubuntu-24.04 &> vcpkg-logs/ubuntu-24.04.log &
doBuild ubuntu-22.04 &> vcpkg-logs/ubuntu-22.04.log &
doBuild ubuntu-20.04 &> vcpkg-logs/ubuntu-20.04.log &
doBuild rockylinux-8 &> vcpkg-logs/rockylinux-8.log &
doBuild centos-8 &> vcpkg-logs/centos-8.log &
doBuild amazonlinux &> vcpkg-logs/amazonlinux.log &
doBuild centos-7-rh-python38 &> vcpkg-logs/centos-7-rh-python38.log &
doBuild centos-7 &> vcpkg-logs/centos-7.log &
fi
Expand Down
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 4316 files
2 changes: 1 addition & 1 deletion vcpkg.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@
"name": "openssl",
"platform": "@VCPKG_OPENSSL@"
},
"pcre2",
{
"name": "opentelemetry-cpp",
"default-features": false,
Expand All @@ -175,6 +174,7 @@
"otlp-grpc"
]
},
"pcre2",
{
"name": "python3",
"platform": "@VCPKG_PYTHON3@ & windows"
Expand Down
15 changes: 15 additions & 0 deletions vcpkg_overlays/thrift/correct-paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/build/cmake/GenerateConfigModule.cmake b/build/cmake/GenerateConfigModule.cmake
index 9533c82..d074a1b 100644
--- a/build/cmake/GenerateConfigModule.cmake
+++ b/build/cmake/GenerateConfigModule.cmake
@@ -19,8 +19,8 @@

include(CMakePackageConfigHelpers)
set(PACKAGE_INCLUDE_INSTALL_DIR "${includedir}/thrift")
-set(PACKAGE_CMAKE_INSTALL_DIR "${cmakedir}/thrift")
-set(PACKAGE_BIN_INSTALL_DIR "${exec_prefix}")
+set(PACKAGE_CMAKE_INSTALL_DIR "${prefix}/share/thrift")
+set(PACKAGE_BIN_INSTALL_DIR "${prefix}/tools/thrift")

# In CYGWIN enviroment below commands does not work properly
if (NOT CYGWIN)
44 changes: 44 additions & 0 deletions vcpkg_overlays/thrift/pc-suffix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/lib/cpp/thrift-nb.pc.in b/lib/cpp/thrift-nb.pc.in
index 2c6a96973..e99eff2bc 100644
--- a/lib/cpp/thrift-nb.pc.in
+++ b/lib/cpp/thrift-nb.pc.in
@@ -26,5 +26,5 @@ Name: Thrift
Description: Thrift Nonblocking API
Version: @VERSION@
Requires: thrift = @VERSION@
-Libs: -L${libdir} -lthriftnb
+Libs: -L${libdir} -lthriftnb@THRIFT_RUNTIME_POSTFIX@
Cflags: -I${includedir}
diff --git a/lib/cpp/thrift-qt5.pc.in b/lib/cpp/thrift-qt5.pc.in
index a8b16663e..2720bea79 100644
--- a/lib/cpp/thrift-qt5.pc.in
+++ b/lib/cpp/thrift-qt5.pc.in
@@ -26,5 +26,5 @@ Name: Thrift
Description: Thrift Qt5 API
Version: @VERSION@
Requires: thrift = @VERSION@
-Libs: -L${libdir} -lthriftqt5
+Libs: -L${libdir} -lthriftqt5@THRIFT_RUNTIME_POSTFIX@
Cflags: -I${includedir}
diff --git a/lib/cpp/thrift-z.pc.in b/lib/cpp/thrift-z.pc.in
index 467d2e11c..cde44158a 100644
--- a/lib/cpp/thrift-z.pc.in
+++ b/lib/cpp/thrift-z.pc.in
@@ -26,5 +26,5 @@ Name: Thrift
Description: Thrift Zlib API
Version: @VERSION@
Requires: thrift = @VERSION@
-Libs: -L${libdir} -lthriftz
+Libs: -L${libdir} -lthriftz@THRIFT_RUNTIME_POSTFIX@
Cflags: -I${includedir}
diff --git a/lib/cpp/thrift.pc.in b/lib/cpp/thrift.pc.in
index d11e6db29..77da61c3e 100644
--- a/lib/cpp/thrift.pc.in
+++ b/lib/cpp/thrift.pc.in
@@ -25,5 +25,5 @@ includedir=@includedir@
Name: Thrift
Description: Thrift C++ API
Version: @VERSION@
-Libs: -L${libdir} -lthrift
+Libs: -L${libdir} -lthrift@THRIFT_RUNTIME_POSTFIX@
Cflags: -I${includedir}
93 changes: 93 additions & 0 deletions vcpkg_overlays/thrift/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# We currently insist on static only because:
# - Thrift doesn't yet support building as a DLL on Windows,
# - x64-linux only builds static anyway.
# From https://github.com/apache/thrift/blob/master/CHANGES.md
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(BISON)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/thrift
REF "${VERSION}"
SHA512 f9bfaf149dde4da1f5353e540b862c2088465115564d981bf02cd89e8c1f84ca53143ca0091b63d24f8f515425d9163af52ec6122245b59810a2b98292a71650
HEAD_REF master
PATCHES
"correct-paths.patch"
"pc-suffix.patch"
)

if (VCPKG_TARGET_IS_OSX)
message(WARNING "${PORT} requires bison version greater than 2.5,\n\
please use command \`brew install bison\` to install bison")
endif()

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" shared_lib)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" static_lib)

# note we specify values for WITH_STATIC_LIB and WITH_SHARED_LIB because even though
# they're marked as deprecated, Thrift incorrectly hard-codes a value for BUILD_SHARED_LIBS.
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
NO_CHARSET_FLAG
OPTIONS
--trace-expand
-DLIB_INSTALL_DIR:PATH=lib
-DWITH_SHARED_LIB=${shared_lib}
-DWITH_STATIC_LIB=${static_lib}
-DBUILD_TESTING=OFF
-DBUILD_JAVA=OFF
-DWITH_C_GLIB=OFF
-DBUILD_C_GLIB=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_GLIB=TRUE
-DBUILD_PYTHON=OFF
-DBUILD_CPP=ON
-DWITH_CPP=ON
-DWITH_ZLIB=ON
-DCMAKE_REQUIRE_FIND_PACKAGE_ZLIB=TRUE
-DWITH_LIBEVENT=ON
-DCMAKE_REQUIRE_FIND_PACKAGE_Libevent=TRUE
-DWITH_OPENSSL=ON
-DCMAKE_REQUIRE_FIND_PACKAGE_OpenSSL=TRUE
-DBUILD_TUTORIALS=OFF
-DFLEX_EXECUTABLE=${FLEX}
-DWITH_QT5=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Qt5=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_Gradle=TRUE
-DCMAKE_DISABLE_FIND_PACKAGE_Java=TRUE
-DBUILD_JAVASCRIPT=OFF
-DBUILD_NODEJS=OFF
-DBISON_EXECUTABLE=${BISON}
MAYBE_UNUSED_VARIABLES
CMAKE_DISABLE_FIND_PACKAGE_GLIB
CMAKE_DISABLE_FIND_PACKAGE_Gradle
CMAKE_REQUIRE_FIND_PACKAGE_Libevent
CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL
CMAKE_REQUIRE_FIND_PACKAGE_ZLIB

)

vcpkg_cmake_install()

vcpkg_copy_pdbs()

# Move CMake config files to the right place
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
vcpkg_fixup_pkgconfig()

file(GLOB COMPILER "${CURRENT_PACKAGES_DIR}/bin/thrift" "${CURRENT_PACKAGES_DIR}/bin/thrift.exe")
if(COMPILER)
vcpkg_copy_tools(TOOL_NAMES thrift AUTO_CLEAN)
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")

if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
endif()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
25 changes: 25 additions & 0 deletions vcpkg_overlays/thrift/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "thrift",
"version": "0.19.0",
"description": "Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible.",
"homepage": "https://github.com/apache/thrift",
"license": "Apache-2.0",
"dependencies": [
"boost-date-time",
"boost-locale",
"boost-range",
"boost-scope-exit",
"boost-smart-ptr",
"libevent",
"openssl",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}

0 comments on commit 077df01

Please sign in to comment.