-
Notifications
You must be signed in to change notification settings - Fork 352
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
meson: add support for testsuite #701
Conversation
Motivation for the PR: I'd like to add these tests to the https://wrapdb.mesonbuild.com/ release integration for CLI11. Currently meson is not directly tested in this project's own CI, but The tests pass locally (with the optional boost dependency installed). Building succeeds with warnings (I did not check the cmake build to see if there are warnings there too):
|
Great, thanks for working on the Meson code. I've been meaning to do a bit more with Meson. Would it be possible to add a single test to the GHA CI running on Meson? I guess I could try it... |
I tried: $ pipx run meson setup build-meson .
$ pipx run meson configure build-meson -Dtests=true
$ pipx run meson compile build-meson (removed mistakes and lots of help calls) and I got: Traceback (most recent call last):
File "/Users/henryschreiner/.local/pipx/.cache/0bca3ad613ead43/lib/python3.10/site-packages/mesonbuild/mesonmain.py", line 146, in run
return options.run_func(options)
File "/Users/henryschreiner/.local/pipx/.cache/0bca3ad613ead43/lib/python3.10/site-packages/mesonbuild/mcompile.py", line 325, in run
cdata = coredata.load(options.wd)
File "/Users/henryschreiner/.local/pipx/.cache/0bca3ad613ead43/lib/python3.10/site-packages/mesonbuild/coredata.py", line 1033, in load
with open(filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/henryschreiner/git/software/CLI11/meson-private/coredata.dat'
ERROR: Unhandled python exception
This is a Meson bug and should be reported! 🤦 |
Oh, maybe the compile command doesn't take a build directory like everything else, and forces me to switch to the build directly manually like an animal. Fine, will try that. $ cd build-meson
$ pipx run meson compile
[0/1] Regenerating build files.
The Meson build system
Version: 0.61.1
...
../tests/meson.build:57:18: ERROR: Expecting rbracket got comma.
['link_test_2', {'link_with': link_test_lib}]
^ |
Okay, now at:
Guessing this doesn't download catch2 like CMake does? Did a |
This is enabled by default if you are building this as the main project. It's only off by default if this is not the main project. I found |
Actually, like
That can be made available, just a second...
Huh, I did not get any warnings... this was on Linux with Boost 1.78.0 |
…code This would implicitly default to false, so if something bizarre happened and the command errored out, meson would consider that fine. Now meson emits a warning about this deprecated legacy behavior, suggests that it will eventually change, and, most importantly, prevents a warning-free build. Suppress the warning by manually specifying the sensible behavior, which is to fail on errors.
a27a2d2
to
3e37502
Compare
Produced by running `meson wrap install catch2` and checking the results into git. No modifications to the build files are expected; this makes use of https://mesonbuild.com/Wrap-dependency-system-manual.html#provide-section
21ad472
to
961f100
Compare
From the bug report linked, sounds like it's specific to brew + macOS (which is what I'm on). If you can get the download working, I can add the CI (basically have it added). |
The catch2 download is now working. |
I'd have expected consistency across meson commands, rather than consistency with one (of three) build backends or a program that's not even a build backend for meson. ;) I'd also expect |
The terrible error message was a regression and got fixed by mesonbuild/meson@88f8a8e, it's on the milestone for the next bugfix. :D (As expected, "This is a Meson bug" deserved reporting, got reported, and got fixed.) |
@@ -0,0 +1,78 @@ | |||
catch2 = dependency('catch2') |
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.
Just for my understanding, this will download catch only if not found? And any version can be found, but 2.13.7 will be downloaded, correct?
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.
Yes. Based on the setting of --wrap-mode=default
(you can set it to =forcefallback
if you'd prefer to download it no matter what) it will:
- try to find any version using pkg-config
- try to find any version using cmake (by running a crafted CMakeLists.txt, seeing if find_package() works, and extracting that info using the trace parser)
- download the pinned version available as a meson wrap
Yeah, we set this up in pybind11, but I don't think it's ever been set up here. I need to move more CI to GHA before that happens, probably (you can see Appveyor is a bottleneck). |
Well, there are worse bottlenecks. :) Your PRs to meson, for example, will take roughly 2 hours to complete the slow Azure runs and GHA+Cygwin. |
If we are having a battle of bottlenecks, CMake takes nearly 3.5 hours to cross-compile the various PyPI packages on GHA. But this one I can workaround eventually - I haven't been very convincing in getting credits from Travis for the CMake one. :) Thanks for the contribution! I'll try to look into that warning soon too (especially to see why it's passing our current CI), and I see a bit of CI cleanup I can do (we don't have submodules anymore). But this is good. @phlptp going to assume you are also fine with this, shout out if not! |
CLI11-2.2.0/tests/meson.build:71:4: ERROR: Invalid use of addition: can only concatenate list (not "DependencyHolder") to list |
As with CMakeLists.txt, this is disabled by default.
@VARNAME@
that can be replaced (breaking usage without first running cmake or meson) or for me to stop being lazy and finally implement doxygen in a meson module. :DCLI11_SINGLE_FILE
doesn't seem very useful, because it should behave exactly the same anyway, modulo speed of e.g. deduplicated includes-Db_sanitize=
, possible values includeaddress
,thread
,undefined
,memory
,address,undefined
. AFAIK this functionality is not tested for cmake in CI anyway.clang-tidy
program is installed.-Db_coverage=true