Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP meson #1922

Closed
wants to merge 18 commits into from
Closed

WIP meson #1922

wants to merge 18 commits into from

Conversation

minrk
Copy link
Member

@minrk minrk commented Jan 5, 2024

try switching build system to meson, which lets us bundle 'true' builds of libzmq/libsodium.

builds on #1903, because that's why we need it, since libsodium becomes a dependency of bundled libzmq due to the removal of libzmq's tweetnacl.

So far, the simple Cython + CPython on linux/mac is working

TODO:

  • add meson.build
  • preserve environment variables for picking bundled libzmq
  • statically link libzmq and libsodium when libzmq is not found
  • build Cython backend
  • build CFFI backend on PyPy
  • build static libs on Windows with msbuild, cmake
  • enable adequate configuration for the many cases we supported previously. Meson's philosophical objection to env vars makes this much harder than it needs to be.

meson discussion

@minrk minrk marked this pull request as draft January 5, 2024 12:16
@minrk
Copy link
Member Author

minrk commented Jan 5, 2024

libzmq's libsodium & cmake build steps are here and amount to:

msbuild /v:minimal /p:Configuration=%Configuration%DLL builds\msvc\%MSVCYEAR%\libsodium\libsodium.vcxproj
Copy-Item "bin\${env:Platform}\${env:Configuration}\${env:MSVCVERSION}\dynamic\libsodium.lib" -Destination "bin\${env:Platform}\${env:Configuration}\${env:MSVCVERSION}\dynamic\sodium.lib"
cmake -D CMAKE_INCLUDE_PATH="%SODIUM_INCLUDE_DIR%" -D CMAKE_LIBRARY_PATH="%SODIUM_LIBRARY_DIR%" -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D ENABLE_DRAFTS="%ENABLE_DRAFTS%" -D ENABLE_ANALYSIS="%ENABLE_ANALYSIS%" -D ENABLE_CURVE="%ENABLE_CURVE%" -D API_POLLER="%API_POLLER%" -D POLLER="%POLLER%" %EXTRA_FLAGS% -D WITH_LIBSODIUM="%WITH_LIBSODIUM%" -D LIBZMQ_WERROR="%LIBZMQ_WERROR%" -G "%CMAKE_GENERATOR%" "%LIBZMQ_SRCDIR%"
        cmake --build . --config %configuration% --target install -- -verbosity:Minimal -maxcpucount

it should be a relatively small task to switch those builds to static and run these commands as custom targets, at least for someone who understands more about meson and Windows builds than I do.

@minrk
Copy link
Member Author

minrk commented Feb 2, 2024

need to figure out how to prevent ExternalProject from running configure during sdist:

zeromq| Running command ['/home/runner/work/pyzmq/pyzmq/subprojects/zeromq-4.3.5/configure', '--prefix=/usr/local', '--libdir=/usr/local/lib/x86_64-linux-gnu', '--includedir=/usr/local/include', '--with-libsodium', '--disable-libsodium_randombytes_close', '--disable-Werror', '--disable-drafts', '--disable-shared', '--enable-static'] in directory /home/runner/work/pyzmq/pyzmq/.mesonpy-ycdea0r2/subprojects/zeromq-4.3.5/build


../subprojects/zeromq-4.3.5/meson.build:13:8: ERROR: configure step returned error code 2.

A full log can be found at /home/runner/work/pyzmq/pyzmq/.mesonpy-ycdea0r2/meson-logs/meson-log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant