From 19ce93135a129c98a4099ce6d4cb5f44e7346a55 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Fri, 6 Oct 2023 16:41:09 +0200 Subject: [PATCH] Fix dylib in macOS wheel --- hogql_parser/.gitignore | 1 - hogql_parser/pyproject.toml | 14 +++++++++----- hogql_parser/setup.py | 5 ++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/hogql_parser/.gitignore b/hogql_parser/.gitignore index ae7a358de40b0..2a5a44e877407 100644 --- a/hogql_parser/.gitignore +++ b/hogql_parser/.gitignore @@ -2,5 +2,4 @@ build/ *.egg-info *.so -wheelhouse/ dist/ diff --git a/hogql_parser/pyproject.toml b/hogql_parser/pyproject.toml index 3864c07511e2a..ac6f6f0aa2302 100644 --- a/hogql_parser/pyproject.toml +++ b/hogql_parser/pyproject.toml @@ -12,11 +12,15 @@ build = [ # Build CPython wheels on Linux and macOS, for x86 as well as ARM build-frontend = "build" # This is successor to building with pip [tool.cibuildwheel.macos] -archs = [ +archs = [ # We could also build a universal wheel, but separate ones are lighter individually "x86_64", "arm64", -] # We could also build a universal wheel, but separate ones are lighter individually -before-all = ["brew install boost antlr antlr4-cpp-runtime"] +] +before-build = [ + "brew uninstall --force boost antlr4-cpp-runtime", + "brew fetch --force --bottle-tag=${ARCHFLAGS##'-arch '}_monterey boost antlr4-cpp-runtime", + "brew install $(brew --cache --bottle-tag=${ARCHFLAGS##'-arch '}_monterey boost antlr4-cpp-runtime)", +] [tool.cibuildwheel.linux] before-all = [ @@ -26,8 +30,8 @@ before-all = [ "unzip antlr4-source.zip -d antlr4-source && cd antlr4-source", "cmake .", "DESTDIR=out make install", - "cp -r out/usr/local/include/antlr4-runtime /usr/local/include", - "cp out/usr/local/lib64/libantlr4-runtime.so* /usr/local/lib", + "cp -r out/usr/local/include/antlr4-runtime /usr/include/", + "cp out/usr/local/lib64/libantlr4-runtime.so* /usr/lib64/", "ldconfig", ] archs = ["x86_64", "aarch64"] diff --git a/hogql_parser/setup.py b/hogql_parser/setup.py index 492fb5d5bb3ef..ca70cc2f5e0a6 100644 --- a/hogql_parser/setup.py +++ b/hogql_parser/setup.py @@ -21,11 +21,10 @@ ], include_dirs=[ f"{homebrew_location}/include/" if is_macos else "/usr/include/", - f"{homebrew_location}/include/antlr4-runtime/" if is_macos else "/usr/local/include/antlr4-runtime/", + f"{homebrew_location}/include/antlr4-runtime/" if is_macos else "/usr/include/antlr4-runtime/", ], library_dirs=[ - f"{homebrew_location}/Cellar/boost/1.82.0_1/lib/" if is_macos == "Darwin" else "/usr/lib64/", - f"{homebrew_location}/Cellar/antlr4-cpp-runtime/4.13.1/lib/" if is_macos == "Darwin" else "/usr/local/lib/", + f"{homebrew_location}/lib/" if is_macos else "/usr/lib64/", ], libraries=["antlr4-runtime"], extra_compile_args=["-std=c++20"],