Build scikit-image 0.21 with meson#3874
Conversation
|
I managed to add some debug to have the explicit command used and it looks like |
|
Adding the lazy_loader package, CI is green (except codecov), I guess this is good enough to mark it as ready for feed-back. What needs still to be figured out/done:
|
|
@henryiii if you have any advice about this it would be appreciated. |
The one change I see is rth/meson-python@115683f, which disables the native file and hardcodes the cross file location. The cross file location can be given directly instead, this should be equivalent: I'm unclear why it would be needed to disable the native file. Its only purpose is to ensure that the Python interpreter used by Meson is the one from the environment in which meson-python is installed. It should not matter, assuming meson and meson-python are indeed installed in the active build env. |
|
Thanks a lot for your feed-back! This change actually comes from the original attempt at using meson for scipy #3037 from end August 2022. Maybe things have improved since then. I'll try to have a closer look based on your suggestion. |
|
Ah yes, things did improve, with the latest |
|
Looks like that is pretty happy:) It'd be even nicer if there were a |
|
Config-settings is supported in cibuildwheel, so pyodide-build must be able to handle it too? (Can't check currently, but can soon). |
Yep 🎉
Indeed, this is the first thing I could think of to specify a cross-file without a meson-python fork. I am hoping that someone more knowledgeable than me about the Pyodide tooling will have a better suggestion about how to do this in a nicer way! |
|
By the way, there is a huge benefit if this is possible via meson(-python) environment variable (like CMAKE_TOOLCHAIN for CMake). Then cibuildwheel could set the variable and meson-python would support producing pyodide wheels out of the box, like it does with setuptools and scikit-build, rather than requiring custom config added to every project. |
That does not sound too appealing. Every packaging tool has its own environment variables, and silently handling all those inside Example: conda-forge uses a It's a little more work, but the linked Meson policy is correct in my experience - once you have it set up, it's much nicer to have CLI args than env vars, because you can more easily see what is going on in a build. |
|
The problem is Another option, avoiding cross-compiling variables, would be to ask sysconfig, since A third option, which I'd like to avoid, but is already sadly being done for |
|
Using backend-flags in |
Thanks, I understand the use case better now. I do think it can be solved fairly easily, since you're not actually flying blind in In general I think doing that will be helpful; the amount of standardized behavior is always going to be limited and lag way behind the actual state of the tools. It may also allow you to get rid of at least some of the undesirable |
|
You absolutely should not parse I'm willing to add a meson-python specific environment variable to cibuildwheel, I am not willing to parse the pyproject.toml and try to customize behavior based on assumed backends. (As in, I'm a -1, other cibuildwheel devs would weigh in too if it's proposed) I think the best case would be for meson-python to check sysconfig, and if it's set to cross compile to emscripten and there's no cross-compile file already specified, it should add the cross-compile file. This doesn't require a special environment variable added, and is similar to the already agreed upon and added support for other cross compiles, like macOS ARM. And second best would be for an meson-python specific environment variable that we could add to cibuildwheel. |
|
Remaining things that needs to be looked at:
Somehow later down the line the which fails:
|
Agreed, also -1 for this. |
This reverts commit c431fb1.
ce83b4f to
f8918ec
Compare
|
I have cleaned things up a bit. I believe the CI errors are not related to this PR. Any feed-back let me know! |
| c = 'emcc' | ||
| cpp = 'em++' | ||
| ar = 'emar' | ||
| fortran = '/usr/bin/gfortran' |
There was a problem hiding this comment.
It doesn't work if you just pass gfortran?
Also, scikit-image doesn't have any Fortran as far as I'm aware. So maybe leave it commented for now?
There was a problem hiding this comment.
I took the cross file from previous attempts, I can probably remove/comment the fortran line if you think this is really important.
There was a problem hiding this comment.
Not important, OK to keep it as is.
| preferred_plugins = { | ||
| # Default plugins for all types (overridden by specific types below). | ||
| - 'all': ['imageio', 'pil', 'matplotlib', 'qt'], | ||
| + 'all': ['imageio', 'pil', 'matplotlib'], |
There was a problem hiding this comment.
Did they change the default plugins, or is this now auto-detected my meson?
There was a problem hiding this comment.
The patch is not necessary any more due to a scikit-image change:
https://github.com/scikit-image/scikit-image/blob/f38bc6e511cb0605dcae4c31a17ba27f0de82b33/skimage/io/manage_plugins.py#L39-L44
|
I'll go ahead and merge. I'm also seeing the same unrelated test failure on other PRs, though main is green. I don't know if it's some CI caching issue. |
| build: | ||
| script: | | ||
| export CFLAGS=${SIDE_MODULE_CFLAGS} | ||
| export LDFLAGS=${SIDE_MODULE_LDFLAGS} |
There was a problem hiding this comment.
Following off line discussion, maybe there is indeed some better way of doing this.
Description
An attempt at trying meson with scikit-image 0.20 since it is probably simpler than for scipy, following #3649 (comment)
For now it does build the wheel but the compiler flags don't seem to be correct, suggestions more than welcome ...
During the build I get this kind of warnings:
And when importing:
Checklists