-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Port build system to Meson #26621
Port build system to Meson #26621
Conversation
And looking back at #23829, I forgot about adding the |
1ba714f
to
ee25941
Compare
|
||
|
||
if len(sys.argv) < 4: | ||
raise SystemExit('usage: {sys.argv[0]} <input> <output> <backend>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have an if __name__ == '__main__':
guard
86b2d7b
to
7f5d3a9
Compare
9eaf930
to
cb71290
Compare
OK, I think we're at a good point now. A couple of issues had to be cleared up:
There are also a couple followups that need to be considered eventually:
There isn't a huge change for developers, and you might be able to glean that from the CI changes (though most changes are extraneous for local work.) There may be a bit more change for distributions, but they might be used to that from NumPy/SciPy's existing change. I will write up some docs for that next week. |
OK, there is actually one stall on the macOS arm64 builds, which I've reported upstream at mesonbuild/meson-python#468 |
I have found a solution that appears to work regarding getting stubtest running with editable install, though not sure its actually a good solution... If you add the As far as I can tell it does not affect the special handling set up by mesonpy in All that said, while it may be good enough for a controlled CI environment, I don't like that as a solution for developers who may wish to run stubtest on their machine (note that Perhaps this is a safe enough change and we should lobby/PR upstream to include it to support the mypy usecase. The other option which seems to also be broken right now, but I don't think should be a problem, is to do a non-editable install... this is not great for the developer machine use case either, but at least does not involve editing generated files... Currently I'm getting:
Which is a weird error on a couple fronts, firstly being why is version needed for importing in the first place?, secondly being why is that an invalid version? Investigation has revealed that stubtest is doing (the In summary:
|
Cherry-picked out of matplotlib#26800; also unpin setuptools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be OK now? To some extent it may be better to try and get this in so that there is ample time before the 3.9-release to find any issues, but I am still a bit worried to merge it myself...
Well, what is the worst that can happen?
I would not be worried. You had another approving review and merged it as the maintainer's workflow says. As you say, this will give a good opportunity to see if anything does crop up rather than waiting until the last minute. |
This removes special casing for AIX and IBM i OS, but the FreeType build is using an included Meson system instead of their own old autotools-based build. @ayappanec @zheddie can you confirm whether the |
@KamathForAIX Can you confirm whether the main branch builds fine in AIX ? |
Hi @QuLogic , So in AIX gcc with LTO option is not supported. So in meson.build file we should not use it as a default option if the target is AIX. If we can write a logic like that it would be great. Secondly, in the matplotlib/tools/generate_matplotlibrc.py I had to change !/usr/bin/env python to /usr/bin/env python3.9.. With the two changes mentioned above we are able to build in AIX. Kindly let me know what we can do regarding the same. |
Does |
@tacaswell Yes it works |
If that is not supported, then this should be handled upstream in Meson. If they silently ignore |
Hi @QuLogic , Sure. We will work this out with the meson community members. No worries. Thank you for connecting with AIX for the meson build system test for Matplotlib. If there is anything update or help needed we will get back to you. Is there anything else we can do for Matplotlib community from AIX? Kindly let us know. Have a nice day ahead. Regards, |
@KamathForAIX I do not know of any CI service that offer AIX workers so we are a bit blind to if we accidentally break anything. If you could have a monthly cron-job that tries to build Matplotlib and run the tests and report any failures up to us that would be super helpful! |
Hi @tacaswell Sure, we will set a CI for matplotlib and run the tests. |
PR summary
Now that NumPy and SciPy have spent some time on Meson, it's not too bad to move our build system over to Meson as well. This PR also implements the move to
pyproject.toml
from #23829. I have added some documentation with some key points for migration, though most are edge cases that most developers shouldn't have to worry about.The main change is that editable installs should disable build isolation:
This is because
pyproject.toml
-based install would normally isolate builds and extensions are built in the isolated environment, which goes against the idea of an editable install. (You will also need to install build requirements in your target environment, but I think that's not new anyway.)The other downside is that all files need to be listed manually in most
meson.build
. However, this also has a side benefit of not accidentally installing extra files (e.g., I get several temporary*.gcno
files and the wholenode_modules
directory if they happen to exist onmain
.)The upside is that compilation is written in a very standard way. Both FreeType and Qhull are subprojects using manually written
meson.build
but those are just the same as the files in the main source. Qhull's build is a simple port of what we did insetupext.py
tomeson.build
. FreeType's build is based on the 2.9.1 version in Meson's wrapdb, but dropping some of the extra install bits we won't use and rolled back to 2.6.1. For 2.11.1, we use the Meson build system already part of FreeType. When we move forward on FreeType versions, we can drop the patched-in build and use the upstream build system.The other upside of Meson+meson-python builds is that compilation is a) faster with better parallelism since the entire set of files can be seen by the build system, and b) can be done at import time in an editable install. The latter means that you will no longer need to re-install when editing C(++) files (unless you switch to an older commit.)
Closes #23829
PR checklist