Skip to content

Commit

Permalink
Use installed ragel instead of building from source
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Jul 16, 2024
1 parent 925e8cc commit 8e3921a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
yum install -y ragel
- name: Build
env:
EXTRA_CMAKE_FLAGS: "-DVELOX_ENABLE_ARROW=ON -DVELOX_BUILD_PYTHON_PACKAGE=ON ${{ inputs.extraCMakeFlags }}"
Expand Down
48 changes: 0 additions & 48 deletions CMake/resolve_dependency_modules/hyperscan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function install_velox_deps_from_apt {
bison \
flex \
libfl-dev \
tzdata
tzdata \
ragel
}

function install_fmt {
Expand Down

0 comments on commit 8e3921a

Please sign in to comment.