From 649fe66a7ce5a743ada6f02b13e0ebb6737857e9 Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Tue, 16 Jul 2024 17:13:02 +0800 Subject: [PATCH] Use installed ragel instead of building from source --- .github/workflows/macos.yml | 2 +- .github/workflows/scheduled.yml | 6 +++ .../hyperscan.cmake | 48 ------------------- scripts/setup-centos9.sh | 2 +- scripts/setup-macos.sh | 2 +- scripts/setup-ubuntu.sh | 3 +- 6 files changed, 11 insertions(+), 52 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b5f074ea3d52..8e8cabaca33b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -65,7 +65,7 @@ jobs: bison boost ccache double-conversion flex fmt gflags glog \ icu4c libevent libsodium lz4 lzo ninja openssl protobuf@21 \ range-v3 simdjson snappy thrift xz xsimd zstd libtool automake \ - autoconf + autoconf ragel echo "NJOBS=`sysctl -n hw.ncpu`" >> $GITHUB_ENV brew unlink protobuf || echo "protobuf not installed" diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 4c538a349dee..5e6f549548cf 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -196,6 +196,12 @@ jobs: run: | ccache -sz + - name: Setup dependencies + run: | + # Install dependencies required by PR. They have not been installed in docker. + yum update -y + yum install -y ragel + - name: Build env: EXTRA_CMAKE_FLAGS: "-DVELOX_ENABLE_ARROW=ON -DVELOX_BUILD_PYTHON_PACKAGE=ON ${{ inputs.extraCMakeFlags }}" diff --git a/CMake/resolve_dependency_modules/hyperscan.cmake b/CMake/resolve_dependency_modules/hyperscan.cmake index 578a6c386dbc..92fd6f63a748 100644 --- a/CMake/resolve_dependency_modules/hyperscan.cmake +++ b/CMake/resolve_dependency_modules/hyperscan.cmake @@ -13,54 +13,6 @@ # limitations under the License. include_guard(GLOBAL) -find_program(RAGEL ragel) -if(${RAGEL} STREQUAL "RAGEL-NOTFOUND") - message(STATUS "Building colm from source") - # Install colm, required by ragel build. - FetchContent_Declare( - colm - URL https://github.com/adrian-thurston/colm/archive/refs/tags/0.14.7.tar.gz - URL_HASH - SHA256=06c8296cab3c660dcb0b150d5b58c10707278d34a35fe664f8ed05f4606fc079) - FetchContent_GetProperties(colm) - if(NOT colm_POPULATED) - FetchContent_Populate(colm) - endif() - execute_process( - COMMAND - bash -c - "./autogen.sh && ./configure --prefix=/usr/local/ && make && make install" - WORKING_DIRECTORY ${colm_SOURCE_DIR} - RESULT_VARIABLE result - OUTPUT_VARIABLE output - ERROR_VARIABLE output) - - message(STATUS "Building ragel from source") - # Install ragel, required by hyperscan build. - FetchContent_Declare( - ragel - URL https://github.com/adrian-thurston/ragel/archive/refs/tags/7.0.4.tar.gz - URL_HASH - SHA256=0f7c3866f82ba2552f1ae1f03b94170121a0ff8bac92c8e22c531d732fd20581) - FetchContent_GetProperties(ragel) - if(NOT ragel_POPULATED) - FetchContent_Populate(ragel) - endif() - execute_process( - COMMAND - bash -c - "./autogen.sh && ./configure --with-colm=/usr/local/ --disable-manual && make && make install" - WORKING_DIRECTORY ${ragel_SOURCE_DIR} - RESULT_VARIABLE result - OUTPUT_VARIABLE output - ERROR_VARIABLE output) - if(result) - message(FATAL_ERROR "Failed to build and install ragel: ${output}") - endif() -else() - message(STATUS "Using existing ragel for building hyperscan.") -endif() - if(DEFINED ENV{VELOX_HYPERSCAN_URL}) set(VELOX_HYPERSCAN_SOURCE_URL "$ENV{VELOX_HYPERSCAN_URL}") else() diff --git a/scripts/setup-centos9.sh b/scripts/setup-centos9.sh index 81a9f4f23497..134ef57fb9e5 100755 --- a/scripts/setup-centos9.sh +++ b/scripts/setup-centos9.sh @@ -50,7 +50,7 @@ function install_build_prerequisites { dnf config-manager --set-enabled crb dnf update -y dnf_install ninja-build cmake ccache gcc-toolset-12 git wget which - dnf_install autoconf automake python3-devel pip libtool + dnf_install autoconf automake python3-devel pip libtool ragel pip install cmake==3.28.3 } diff --git a/scripts/setup-macos.sh b/scripts/setup-macos.sh index 41a444922a2c..b42de60467fc 100755 --- a/scripts/setup-macos.sh +++ b/scripts/setup-macos.sh @@ -34,7 +34,7 @@ source $SCRIPTDIR/setup-helper-functions.sh NPROC=$(getconf _NPROCESSORS_ONLN) DEPENDENCY_DIR=${DEPENDENCY_DIR:-$(pwd)} -MACOS_VELOX_DEPS="flex bison protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium libtool automake autoconf" +MACOS_VELOX_DEPS="flex bison protobuf@21 icu4c boost gflags glog libevent lz4 lzo snappy xz zstd openssl libsodium libtool automake autoconf ragel" MACOS_BUILD_DEPS="ninja cmake ccache" FB_OS_VERSION="v2024.05.20.00" diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index 8c39f79eaa75..061b9d1e8fd0 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -88,7 +88,8 @@ function install_velox_deps_from_apt { bison \ flex \ libfl-dev \ - tzdata + tzdata \ + ragel } function install_fmt {