WIP / DNM: build with meson on unix#205
Conversation
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
|
Seems like conda's build isolation mechanism (with the placehold_placehold_...) is breaking ninja Quite surprised about the appearance of windows-flavoured problems on unix... 🤔 |
Interestingly, this does not seem to happen for aarch64/ppc64le, which then fail with: |
|
Does meson on windows only work with mingw? Surprised that MSVC seems to be detected as not working: All things considered, I'm probably going to need a bit of help on this PR @rgommers @eli-schwartz |
|
Finally, for osx-arm, we might have to be more explicit about the fact that this should be cross-compiled: |
I don't think so, since that's not what we're using on Windows for wheels - there is no build system support for this. There's two options for 1.9.0:
It works with any compiler toolchain that has coherent support for C/C++/Fortran. Which in practice is:
Ah, that should work but I have not dealt with the specifics of cross-compiling yet (also not for the macOS arm64 wheel builds). For documentation, see https://mesonbuild.com/Cross-compilation.html. I'm guessing we'll have to figure out what the cross file for conda-forge builds should look like. |
|
From the failing logs: This log file contains debug information about the failed state including the command lines, input files, and console output for compiler checks. Not sure how easy it is to get at that underneath the mesonpy build backend (it might clean up the build directory automatically? Don't know). In general, lots of people use cl.exe instead of mingw, and the meson test matrix includes several MSVC jobs (different versions of visual studio). |
I'll need to defer to @isuruf if he considers that feasible here (i.e. why he chose MSVC as the main compiler when adding windows support).
That's obviously possible for 1.9, but not a permanent solution AFAIU - isn't non-meson support planned to be removed in 1.10?
Regarding compilers, it's perhaps worth considering if we can move everything to the LLVM stack on windows? We'd probably have to update the (classic-)flang builds a bit, but in principle that should be an option? |
|
Thanks for the input @eli-schwartz! I think Ralf pinpointed the issue regarding the consistent toolchain, or rather the lack thereof. Windows builds here currently use an unholy combination of MSVC+gfortran, which presumably meson doesn't recognize (and arguably it shouldn't). |
It was the only option and matching the way SciPy wheels were built at the time.
Yes, but that's fine. That gives us 6 months to solve the problem. And either way, switching the build away from |
|
@h-vetinari note that there's some lingering problems with wheels builds, I won't be sure that this all works as advertised until MacPython/scipy-wheels#171 is complete. |
Normally I'd say wheel builds don't concern us directly, but now I don't know if they necessarily get built as an intermediate step in the meson builds? In any case, I opened #206 for a distutils-based test of the rc, which looks fine except for highs on windows. |
They're not necessary technically (with That's not quite what I meant though. Before we have done a single release with wheels, you may run into issues here that we have not yet found (example: I just noticed that the main |
Sure, but we don't have to do anything but install them and can discard them right away (no auditwheel, etc.)
Understood. Similarly for the HiGHS compilation error on windows I presume. Do you want me to raise an issue? |
No that's fine, I think that belongs on this PR, the error is expected. |
I don't understand. It happens in #206 (not this PR), and that one's using the non-meson build path, so I'd expect a green test suite everywhere, but get a build error in the new submodule (haven't found a similar issue or PR tackling that on the upstream repo). |
Ah I missed that part. In that case, yes please. |
Done |
|
It's probably time to switch anything but the Windows builds to Meson now. SciPy released 1.9.3 and 1.10.0 wheels built with Meson, things should work. And the WDYT @h-vetinari? |
SGTM! I wanted to get 1.10 out the door (and the CI was green...), before going down the rabbit hole of how much changes will actually be necessary. |
|
I'd expect very little, leaving aside the Windows issues:
So (untested) something like: (yes this is a bit ugly, and can't use |
|
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
Good guess, this worked on unix in native compilation. I guess it's expected that cross-compilation fails? Happy to dig into this of course, but if you have some references handy of where I need to tackle this, that would be very nice. :) |
|
Relevant part of the build log: We're not telling Note: if that works, then it's likely that there will be a problem with |
No, only as specified in build/host envs. It's possible we need meson only in build... |
Yes indeed, that should be the case when we're cross-compiling. Same for other build tools and code generators, like |
|
So far, cython was in both build and host even when cross-compiling. I'll try moving meson & ninja to build-only first. Probably will take a bit of iteration, but have to drop off here for now. |
|
Mainly I'm waiting for the patch for mesonbuild/meson-python#321 to land, so we can backport it to conda-forge's meson. I think with that we'd solve things (as of c9afb89). In the meantime, trying scipy/scipy#18034 + specifying the include directories, I get even if those definitely exist. |
The |
That was my suspicion as well, but with the last debug commit, I'm using the same vanilla sed that worked before, and I'm 99% certain the content in the crossfile is correct, i.e. an absolute path. (It should work at least for python 3.9, because I had to choose one python version to replace SP_DIR with) PS. It's confusing that |
This reverts commit 7dec741.
…nda-forge-pinning 2023.03.06.17.29.54
conda-build captures stdout and replaces the values with $PREFIX. It makes the logs much easier to read, but might be confusing to new users. |
|
FYI: I opened up a cleaned up version of this PR in #231, with the intention of merging it in the near future. @isuruf, after rebasing out the later-reverted-anyway bf43134, the modifications you made in aa19c00 & c4a44be only needed to be done once each, rather than twice (because there's now one less meson-invocation). To my mind, the adaptation to this fact does not impact the faithfulness of the rebase to your changes, but please let me know if you feel otherwise. |
I don't expect this to work yet. While upstream support meson support is still maturing, we'll probably need to make the gfortan + clang hack work again. But such a fundamental build system change seemed like a good opportunity to try to see which work-arounds are still necessary.
scipy.fftdisabled on Windows scipy/scipy#16352?