From 9ddceac4ae394367ff31e8bd0f63971dc980f497 Mon Sep 17 00:00:00 2001 From: David Gidwani Date: Tue, 2 Dec 2025 01:47:10 -0500 Subject: [PATCH] chore: remove legacy build_tools directory - Remove build_tools/macos, build_tools/wheels, build_tools/windows - These scripts were superseded by CMake + cibuildwheel + pyproject.toml - Update .gitignore to remove build_tools references - Update CLAUDE.md files to remove build_tools from file structure - Update CI workflows to stop watching build_tools for changes - Remove commented out test-command referencing build_tools --- .claude/CLAUDE.md | 1 - .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- .gitignore | 6 - CLAUDE.md | 1 - build_tools/macos/build_hyperscan.sh | 57 -------- build_tools/wheels/before_test.sh | 9 -- build_tools/wheels/build_wheels.sh | 11 -- build_tools/wheels/test_wheels.sh | 10 -- build_tools/windows/Dockerfile | 10 -- build_tools/windows/build.sh | 123 ------------------ .../windows/windows_install_instructions.md | 73 ----------- pyproject.toml | 1 - 13 files changed, 2 insertions(+), 304 deletions(-) delete mode 100755 build_tools/macos/build_hyperscan.sh delete mode 100644 build_tools/wheels/before_test.sh delete mode 100644 build_tools/wheels/build_wheels.sh delete mode 100644 build_tools/wheels/test_wheels.sh delete mode 100644 build_tools/windows/Dockerfile delete mode 100755 build_tools/windows/build.sh delete mode 100755 build_tools/windows/windows_install_instructions.md diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 7b4228c..624627e 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -178,7 +178,6 @@ src/hyperscan/ tests/ # pytest test suite examples/ # Usage examples & benchmarks -build_tools/ # Cross-platform build scripts cmake/ # CMake configuration ``` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c62ea5b..42cc3f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,7 +148,7 @@ jobs: fi RESULT=1 - echo "$CHANGED_FILES" | grep -q -E '^(src/hyperscan/|README.md|CMakeLists.txt|pyproject.toml|MANIFEST.in|cmake/|build_tools/)' || RESULT=$? + echo "$CHANGED_FILES" | grep -q -E '^(src/hyperscan/|README.md|CMakeLists.txt|pyproject.toml|MANIFEST.in|cmake/)' || RESULT=$? if [[ "$RESULT" -eq 0 ]]; then echo "should_build=true" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed65770..d369d43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: echo "${CHANGED_FILES}" CHANGES=0 - echo "${CHANGED_FILES}" | grep -c -E '^(src/hyperscan/|README.md|CMakeLists.txt|pyproject.toml|MANIFEST.in|cmake/|build_tools/)' || CHANGES=$? + echo "${CHANGED_FILES}" | grep -c -E '^(src/hyperscan/|README.md|CMakeLists.txt|pyproject.toml|MANIFEST.in|cmake/)' || CHANGES=$? if [[ "$CHANGES" -gt 0 ]]; then # The last commit already triggered a build, no need to force diff --git a/.gitignore b/.gitignore index 9d6e475..35b8a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,6 @@ parts/ sdist/ var/ wheels/ -!build_tools/wheels share/python-wheels/ *.egg-info/ .installed.cfg @@ -171,9 +170,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ -# Windows build artifacts that should not be version controlled. -/build_tools/windows/*.zip -/build_tools/windows/*.tar.* -/build_tools/windows/hyperscan - github_ci_* diff --git a/CLAUDE.md b/CLAUDE.md index b7c614a..64558f5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -74,7 +74,6 @@ src/hyperscan/ tests/ # pytest test suite examples/ # Usage examples & benchmarks -build_tools/ # Cross-platform build scripts cmake/ # CMake configuration ``` diff --git a/build_tools/macos/build_hyperscan.sh b/build_tools/macos/build_hyperscan.sh deleted file mode 100755 index dc325ba..0000000 --- a/build_tools/macos/build_hyperscan.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -HYPERSCAN_GIT_SOURCE=${HYPERSCAN_GIT_SOURCE:-https://github.com/VectorCamp/vectorscan} -# HYPERSCAN_GIT_REF=${HYPERSCAN_GIT_REF:-vectorscan/5.4.11} -HYPERSCAN_BUILD_TYPE=${HYPERSCAN_BUILD_TYPE:-MinSizeRel} -PCRE_VERSION=${PCRE_VERSION:-8.45} - -if pkg-config --validate libhs; then - echo "✅ libhs found, nothing to do" - exit 0 -fi - -# if [ -z "$HYPERSCAN_GIT_REF" ]; then -# echo >&2 "HYPERSCAN_GIT_REF must be set" -# exit 1 -# fi - -cd /tmp -# git clone -b "${HYPERSCAN_GIT_REF}" ${HYPERSCAN_GIT_SOURCE} -git clone ${HYPERSCAN_GIT_SOURCE} -brew install boost cmake git pkg-config ragel wget gnu-tar -cd $(basename ${HYPERSCAN_GIT_SOURCE}) -# git checkout "24786ae" - -git checkout 5145b6d - -export CFLAGS="-fPIC -Wno-error" -export CPPFLAGS="-fPIC -I/usr/local/opt/binutils/include" -export PATH="$(brew --prefix gnu-tar)/bin:$PATH" -nproc=$(sysctl -n hw.logicalcpu) - -# build and install PCRE (static required for Chimera) -wget -qO- https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VERSION}/pcre-${PCRE_VERSION}.tar.gz/download | tar xvz -mv "pcre-${PCRE_VERSION}" pcre -cd pcre -./configure --prefix=/opt/pcre --enable-unicode-properties --enable-utf -make -j${nproc} && sudo make install -cd .. -sed -i -e 's/-Wall -Werror/-Wno-error/g' cmake/*.cmake - -# build and install Hyperscan/Vectorscan -cmake \ - -B build \ - -S . \ - -DEXTRA_C_FLAGS=-Wno-error \ - -DEXTRA_CXX_FLAGS=-Wno-error \ - -DCMAKE_INSTALL_PREFIX=/opt/vectorscan \ - -DBUILD_STATIC_LIBS=ON \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_BUILD_TYPE=${HYPERSCAN_BUILD_TYPE} \ - -DFAT_RUNTIME=OFF \ - -DPCRE_SOURCE="${PWD}/pcre" \ - -DCMAKE_C_FLAGS="$CFLAGS" \ - -DCMAKE_CXX_FLAGS="$CPPFLAGS -D_GLIBCXX_USE_CXX11_ABI=0" -cmake --build build --parallel ${nproc} -sudo cmake --install build diff --git a/build_tools/wheels/before_test.sh b/build_tools/wheels/before_test.sh deleted file mode 100644 index e86fc7f..0000000 --- a/build_tools/wheels/before_test.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -export PDM_HOME=${PDM_HOME:-/tmp/pdm} -export PDM_SKIP_ADD_TO_PATH=${PDM_SKIP_ADD_TO_PATH:-true} -export PATH="${PDM_HOME}/bin:${PATH}" -curl -sSL https://pdm.fming.dev/install-pdm.py | python - -pdm export -G test -f requirements -o test_requirements.txt -pip install -r test_requirements.txt diff --git a/build_tools/wheels/build_wheels.sh b/build_tools/wheels/build_wheels.sh deleted file mode 100644 index af1ae5f..0000000 --- a/build_tools/wheels/build_wheels.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -if [[ $(uname) == "Darwin" ]]; then - export MACOSX_DEPLOYMENT_TARGET="10.14" - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-/usr/local/lib}" - export PCRE_PATH="${PCRE_PATH:-/tmp/hyperscan/pcre-${PCRE_VERSION}/.libs}" -fi - -cd "${GITHUB_WORKSPACE}" -pdm run cibuildwheel --output-dir wheelhouse diff --git a/build_tools/wheels/test_wheels.sh b/build_tools/wheels/test_wheels.sh deleted file mode 100644 index 2a02721..0000000 --- a/build_tools/wheels/test_wheels.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -# Tests in cibuildwheel are NOT run in the project directory by default -PROJECT_DIR=${1:-/project} - -XDIST_WORKERS=$(python -c "import joblib; print(joblib.cpu_count(only_physical_cores=True))") -echo "👷 Number of workers: $XDIST_WORKERS" -pip show hyperscan -pytest --pyargs "${PROJECT_DIR}/tests" -n $XDIST_WORKERS -vvv diff --git a/build_tools/windows/Dockerfile b/build_tools/windows/Dockerfile deleted file mode 100644 index d876b1d..0000000 --- a/build_tools/windows/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -ARG PYTHON_VERSION -FROM winamd64/python:$PYTHON_VERSION-windowsservercore - -ARG WHEEL_NAME -ARG CONFTEST_NAME -ARG CIBW_TEST_REQUIRES - -COPY $WHEEL_NAME $WHEEL_NAME -RUN pip install $env:WHEEL_NAME -RUN pip install $env:CIBW_TEST_REQUIRES.split(" ") diff --git a/build_tools/windows/build.sh b/build_tools/windows/build.sh deleted file mode 100755 index df474b8..0000000 --- a/build_tools/windows/build.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/sh - -set -e - -# Default Visual Studio version and year -DEFAULT_VS_VERSION=17 -DEFAULT_VS_YEAR=2022 - -# Parse arguments for MSBuild path, Visual Studio version, and year -if [ -z "$1" ]; then - read -p "Enter the full path to MSBuild.exe: " msbuildpath -else - msbuildpath=$1 -fi - -vs_version=${2:-$DEFAULT_VS_VERSION} -vs_year=${3:-$DEFAULT_VS_YEAR} - -# Set MSBuild path -export MSBUILD_PATH="${msbuildpath}" -echo -e "\nMSBUILD_PATH has been set to: [${MSBUILD_PATH}]" -echo "" - -# Configuration -export CPU_ARCH=x64 -export PLATFORM="Visual Studio ${vs_version} ${vs_year}" - -# Third-party libraries -export BOOST_VER=1_78_0 -export BOOST_VER2=1.78.0 -export RAGEL_VER=6.10 -export PCRE_VER=8.41 -export HYPERSCAN_VER=5.4.0 -export HYPERSCAN_ZIP="v${HYPERSCAN_VER}.zip" - -# Download URLs -BOOST_DOWNLOAD_URL="https://archives.boost.io/release/${BOOST_VER2}/source/boost_${BOOST_VER}.zip" -RAGEL_DOWNLOAD_URL="http://www.colm.net/files/ragel/ragel-${RAGEL_VER}.tar.gz" -PCRE_DOWNLOAD_URL="https://sourceforge.net/projects/pcre/files/pcre/${PCRE_VER}/pcre-${PCRE_VER}.tar.bz2" -CMAKE_DOWNLOAD_URL="https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0-windows-x86_64.zip" -SQLITE_DOWNLOAD_URL="https://www.sqlite.org/2018/sqlite-amalgamation-3260000.zip" -HYPERSCAN_DOWNLOAD_URL="https://github.com/intel/hyperscan/archive/refs/tags/${HYPERSCAN_ZIP}" - -# Verify MSBuild path -if [ ! -f "${MSBUILD_PATH}/MSBuild.exe" ]; then - echo "[${MSBUILD_PATH}] is not a valid path to MSBuild.exe. Please set the correct path." - exit 1 -fi -export PATH=$PATH:"${MSBUILD_PATH}" - -# Check required utilities -echo -e "\nVerifying required utilities..." -for util in python curl git unzip tar make gcc; do - echo "Checking $util..." - if ! which "$util" > /dev/null 2>&1; then - echo "Error: $util is not installed. Please install it and try again." - exit 1 - fi -done - -# Download helper function -download() { - if [ ! -e "$(basename "$1")" ]; then - echo "Downloading: $1" - curl -L -O "$1" - fi -} - -# Download third-party libraries -echo -e "\nDownloading third-party libraries..." -download "${HYPERSCAN_DOWNLOAD_URL}" -unzip -q "${HYPERSCAN_ZIP}" -mv hyperscan-${HYPERSCAN_VER} hyperscan - -download "${BOOST_DOWNLOAD_URL}" -download "${RAGEL_DOWNLOAD_URL}" -download "${PCRE_DOWNLOAD_URL}" -download "${CMAKE_DOWNLOAD_URL}" -download "${SQLITE_DOWNLOAD_URL}" - -# Extract libraries -echo -e "\nExtracting third-party libraries..." -tar zxf ragel-${RAGEL_VER}.tar.gz -mv ragel-${RAGEL_VER} hyperscan/ - -unzip -q cmake-3.21.0-windows-x86_64.zip -mv cmake-3.21.0-windows-x86_64 hyperscan/ - -unzip -q sqlite-amalgamation-3260000.zip -mv sqlite-amalgamation-3260000 hyperscan/sqlite3 - -tar jxf pcre-${PCRE_VER}.tar.bz2 -mv pcre-${PCRE_VER} hyperscan/ - -unzip boost_${BOOST_VER}.zip -mv boost_${BOOST_VER} hyperscan/ - -# Build process -cd hyperscan -echo -e "\nBuilding and installing Ragel..." -pushd ragel-${RAGEL_VER} -./configure -make -make install -popd - -echo -e "\nBuilding Hyperscan..." -mkdir -p build -cd build -CXXFLAGS="/MP /FS" CFLAGS="/MP /FS" ../cmake-3.21.0-windows-x86_64/bin/cmake -G "$PLATFORM" -DBOOST_ROOT=boost_${BOOST_VER} ../ - -echo -e "\nRelease Build..." -MsBuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Release -mkdir -p lib/${CPU_ARCH}.Release -mv lib/*.lib lib/${CPU_ARCH}.Release/ - -echo -e "\nDebug Build..." -MsBuild.exe ALL_BUILD.vcxproj /t:build /p:Configuration=Debug -mkdir -p lib/${CPU_ARCH}.Debug -mv lib/*.lib lib/${CPU_ARCH}.Debug/ -mv lib/*.pdb lib/${CPU_ARCH}.Debug/ - -echo -e "\nBuild completed. Current directory: $(pwd)" diff --git a/build_tools/windows/windows_install_instructions.md b/build_tools/windows/windows_install_instructions.md deleted file mode 100755 index 4445106..0000000 --- a/build_tools/windows/windows_install_instructions.md +++ /dev/null @@ -1,73 +0,0 @@ -# Build and Setup Script for Hyperscan and Dependencies - -This script automates the process of downloading, extracting, and building the Hyperscan library and its dependencies for a Windows environment using MSBuild. - -## Features -- Configurable Visual Studio version and year (defaults to VS 17 and 2022). -- Downloads required third-party libraries (Boost, Ragel, PCRE, CMake, SQLite, Hyperscan). -- Builds and installs Ragel as a separate dependency. -- Compiles Hyperscan in both Debug and Release configurations. - -## Prerequisites -Ensure the following utilities are installed and available in your environment: -- Python -- Curl -- Git -- Unzip -- Tar -- Make -- GCC - -## Usage - -1. **Run the Script** - - Execute the script with the following optional arguments: - - `MSBuild Path`: Full path to the MSBuild executable. - - `Visual Studio Version`: Version of Visual Studio (default: `17`). - - `Visual Studio Year`: Year of Visual Studio (default: `2022`). - - Example: - ``` - ./build_hyperscan.sh "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/15.0/Bin" 17 2022 - ``` - - If no arguments are provided, the script will prompt for the `MSBuild Path` and use default values for Visual Studio version and year. - -2. **Verify MSBuild Path** - - Ensure the specified or entered path to `MSBuild.exe` is valid. - -3. **Script Execution** - - The script performs the following steps: - - Sets up the environment variables for the target platform and dependencies. - - Downloads third-party libraries if they are not already present. - - Extracts the downloaded archives. - - Builds and installs the required dependencies. - - Compiles Hyperscan for both Debug and Release configurations. - -## Configuration -The script allows customization of the following: -- **Visual Studio Configuration**: Modify `DEFAULT_VS_VERSION` and `DEFAULT_VS_YEAR` variables to change the default Visual Studio settings. -- **Third-Party Library Versions**: Update the respective variables in the script (`BOOST_VER`, `RAGEL_VER`, etc.) to use different library versions. - -## Output -- **Release Build**: Located in `lib/x64.Release/`. -- **Debug Build**: Located in `lib/x64.Debug/`. - -## Example - -To build Hyperscan with Visual Studio 2019 and a specific MSBuild path: -``` -./build.sh "/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/15.0/Bin" 16 2019 -``` - -## Notes -- This script is designed for use in a Cygwin environment on Windows. -- Ensure that all required tools are properly installed and accessible in the environment path. - -## Troubleshooting -- If the script fails to find `MSBuild.exe`, verify the provided path. -- For missing utilities, install the required tools and rerun the script. -- Ensure network access for downloading third-party libraries. diff --git a/pyproject.toml b/pyproject.toml index f21bb58..b0f77c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,6 @@ version = ">=3.31" [tool.cibuildwheel] build-frontend = "build[uv]" test-command = "pytest --pyargs {package}/tests -vvv" -# test-command = "bash {project}/build_tools/wheels/test_wheels.sh {project}" test-requires = ["pytest>=7.0", "pytest-mock"] # Will avoid testing on emulated architectures and macOS Apple silicon test-skip = "*-*linux_{ppc64le,s390x} *-macosx_arm64"