-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[RFC] common/build-helper/meson.sh: new build helper, used by meson build style #46117
Conversation
An idea to consider: adding a hook in |
Please see my proof of concept in #46109, which seems to be working for |
27a2988
to
7b9d283
Compare
Alright, it turns out that meson respects As for re-using I've updated |
Looks nice. I will try it on Random thoughts:
|
Well I didn't build all of them, but I built a large subset and have no reason to believe this breaks any cross builds. |
I think adding this argument to the PEP517 style is reasonable. It shouldn't be "too much magic" because it confines its manipulations to the actual build functions where this kind of thing is expected.
This would probably better in the numpy build helper, which can check if the meson helper is also enabled and write a second cross file. We can then add another check in the PEP517 helper to automatically add the second file to the build arguments.
I thought about this and decided to follow the precedent of the qmake helper, but we could also add a check to avoid writing the file if it already exists. I'm not sure it matters. While I'm inclined to adopt the numpy and pep517 improvements, let's consider those in a separate PR after this more general change is merged. |
The
python3-scipy
package now builds withpython3-meson-python
, with some more coming down the pike. The Python build process is necessary to include Python package metadata. For SciPy, this is accomplished by using themeson
build style to configure a build directory, then overridingdo_build
anddo_install
to build things the PEP517 way (using the pre-configured build directory).It might be helpful to define a
meson
build helper that can write out the standard cross file for builds, allowing packages like SciPy to use thepython3-pep517
build style with themeson
helper. There are some issues to be worked out:xbps_meson.cross
is written beforeCFLAGS
, et al. are properly defined, so this cross file is actually broken. (This is the process by which theqmake
helper writes its configurations, and they referenceCFLAGS
and others; is theqmake
helper writing broken configs?)python3-pep517
plus ameson
helper) still includes a lot of magic that would have to be brought over to templates. This isn't really easier than the current practice of overriding the one-linedo_build
anddo_install
.A possible solution would be to define a special-purpose function in the helper, called
vmesoncross
or somesuch, that will only write the configured when called---from a build function where these are properly defined (e.g.,pre_configure
,do_configure
). We could also define a specialdo_configure
-like function in the helper that can be used by themeson
style to actually do the configuration. This might be a bit ugly, but avoids repetition or violating the typical practice that the actual build functions are only defined in templates or build styles.A third option is just defining a new
python3-meson
build style that mashes the mesondo_configure
bits from themeson
style with thedo_build
anddo_install
bits from thepython3-pep517
style.All of these options are sub-optimal, but I'm not sure which one is least offsensive.