Replies: 5 comments 29 replies
-
One of the thoughts I had, also because your build dependencies have different build system usage on Windows, is whether you actually want/need to support this on Windows? In general you need it because of folks building from source when running There is anyway a second Windows issue: if you do
Other build systems: the most robust option is having upstream support for building with Meson, or a WrapDB file to do so. However, Meson also understands CMake - unless the CMake files from the upstream repo do really exotic things, Meson can parse those upstream Other build systems are harder, I believe that cannot be done as part of a subproject build. So
This is the second time in two days I've come across the need for determining whether the interpreter is PyPy. The one-liner from numpy/numpy#25531 to implement this is: if not py.get_variable('SOABI').startswith('pypy') but it looks like it would be nice to add a
There is no need for the explicit if-else at this point. You'll simply use a Instead, I think you do it in the discovery phase, something like: libzmq_dep = dependency('zmq',
fallback : ['zmq', 'libzmq_dep'],
default_options: ['default_library=static']
) as documented at https://mesonbuild.com/Subprojects.html#toggling-between-system-libraries-and-embedded-sources.
We should indeed add something like this to the docs, going into a bit more detail about what is specific to distributing wheels on PyPI (since that's the hard part and not covered by the Meson docs). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tips. Unfortunately, I do indeed need to support this on Windows. That is in fact the most important case. I've gotten pretty far. Unfortunately, somethings that's causing me what seems like an unreasonable amount of trouble is getting one ExternalProject to depend on another one. ExternalProjects can depend on Targets, but can't depend on a Dependency, and can only get a |
Beta Was this translation helpful? Give feedback.
-
zeromq/pyzmq#1922 has working builds, at least for the simple cases of Cython on linux/mac |
Beta Was this translation helpful? Give feedback.
-
Any idea how to prevent things from running on sdists? Meson is running various library detection, etc. steps during sdists, when of course it shouldn't be looking for any dependencies just to build a tarball. But I can't find any documentation about how to specify things to be run or not run during different stages, or even how to detect what stage is being run. |
Beta Was this translation helpful? Give feedback.
-
Indeed, looks like I'd like to be one of those people! Maybe that's a feature request for meson-python - to do a more Python-friendly sdist instead of
I think that's what I was looking for, thank you, as long as I can put this in pyproject.toml so meson-python always passes it during sdists. That's firmly on meson-python's side of things, rather than meson itself. The important thing is that it isn't passed on the command-line by me, it's specified in pyproject.toml, so it happens consistently. scikit-build-core has SKBUILD_STATE, to tell the build files a bit about what's going on, if they need to act on it. A similar signal from meson-python seems quite sensible and practical to me.
Nice. I did my best to describe the use case and linked to the code itself and the builds that are failing, but to reiterate, I am trying to:
Right now, sdist is failing because ExternalProject is running configure for the second autotools project as part of setup without having built the first. Neither autotools project will be in the dist, so all of this is irrelevant anyway, which is why I want to skip it. I think perhaps a purely custom target could do the job where ExternalProject doesn't seem to have the necessary controls. |
Beta Was this translation helpful? Give feedback.
-
Split off from #410
Summary
In general, I'd like to get to a documented best practice for optionally bundling a library dependency. At a high level:
In #410, @rgommers mentioned static linking for the bundle branch, which simplifies the bundling issue, since meson doesn't need to duplicate the delvewheel/delocate step. I believe this should work for me, but figuring out the Windows version needs some work
Specific case
I'm exploring updating the build system for pyzmq, which bundles libzmq if not found. This is slightly more complex than #410 because libzmq itself has a dependency on libsodium and both should be bundled. It is further complicated by the need to support Windows, and the fact that libsodium has visual studio solutions on Windows while ZeroMQ uses CMake. So far, it seems like it should be roughly:
more info
https://github.com/oscarbenjamin/mesontest provides a useful example for using wrapfiles to set up the fallback builds. It's gotten me pretty far for the simple posix case, at least.
Beta Was this translation helpful? Give feedback.
All reactions