Conversation
stephanlachnit
left a comment
There was a problem hiding this comment.
This doesn't make any sense here - simply set the corresponding setting in your meson.build files:
magic_enum_dep = dependency('magic_enum', default_options: ['test=false'])|
I have made that change to my I'm open to the idea that this doesn't make sense, but would it be possible to explain a bit further? Is it normal to run the test suites of your dependencies while building? This is what seems to happen at the moment. I'm thinking this is probably not intentional. Don't the various patches in this repository exist to make things "just work" when adding other projects as dependencies or have I misunderstood the purpose of WrapDB? Looks like I need to fix up this PR if it turns out it is wanted, but I'll wait for your reply. |
This is a very personal sort of decision. It is definitely normal for me to run the test suites of my dependencies. The rationale is that I want to know I've correctly built my dependencies, and that my dependencies aren't incompatible, whether explicitly at compile time or subtly at runtime due to buggy assumptions, with either my CPU, or my operating system, or my compiler, etc. If it was actually correct to never run test suites "when used as a dependency of another project", then we could rewrite that belief into "it is correct to never run test suites more than once. Only upstream should ever run test suites, and then only on code changes". And yes! There are a lot of people who do believe this. There are entire programming language ecosystems (I'm looking at you, python) where the culture is heavily into "testsuite files should be deleted from source code archives to make them a few kilobytes smaller to download, and if anyone says they wanted to run the testsuite, simply shame them into retracting their request". I do believe very strongly that running tests should be a user choice. I'm strongly supportive of offering build options to permit successfully configuring without tests, which is especially important when tests have third-party dependencies such as catch2. :) But I'm not convinced it makes sense to change the default (especially if it introduces a brand new requirement to patch the build files). I would also like to note that meson itself has fundamental behaviors that enable this choice of whether or not to run tests of dependencies:
Not necessarily. The WrapDB curently exists for two reasons:
If upstream does have meson.build files but they aren't suitable for use at all, then the WrapDB can also make them usable. This is for example the case with zstd, which maintains the files upstream but only in a subdirectory, which means zstd cannot be registered as a subproject at all unless a patch is applied to create a root-level meson.build file |
| 'test', | ||
| type : 'boolean', | ||
| value : false, | ||
| description : 'Build and run tests' |
There was a problem hiding this comment.
From a purely practical perspective, it is very intentional that the WrapDB itself runs the upstream project tests when adding/updating/modifying a wrap.
So if a wrap does disable tests "by default" regardless of why it disables them, it should be using ci_config.json to pass the correct build options to re-enable them inside of the WrapDB itself.
|
Thanks a lot for the explanation. As you touched upon, I am much more familiar with standard practices in Python-land but it does make sense that you might want to run tests for dependencies in C++ since environments can vary so wildly. I think maybe this should/could be tackled in |
Nope. :) I've fought with sometimes great pain and expense to run tests for python code too, including python code that doesn't use any C extensions. It does catch bugs. The two major reasons for bugs are:
Unfortunately pip doesn't know how to run tests for installed packages, even when building from sdists, because testing in python land is completely non-standardized. In Linux distros we simply don't care whether it is standardized -- we have our own standard hook for running tests so we write out the relevant testing command for each package individually. It is trivial and works great. It remains an eternal disappointment to me that some python developers go to extra lengths to
;) |
I think usually anything using this as a dependency won't want these. Additionally, currently the tests bundle a version of catch2 that has problems with Windows.