-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
test executable always built even when build_by_default is false #2518
Comments
This makes sense, we should not build executables that are explicitly not build-by-default till the test is run. |
Any hope of this getting fixed? |
I thought it was a conscious design choice in Meson to make sure any test executables get built as part of the build stage and not "on demand" later? |
There's actually a fixme about doing this in the ninja backend. |
I can give it a go if you'll point me to it |
The fixme is here; it's in the generic backend code rather than the ninja-specific backend module. |
The fixme implies that "sometime in the future, these (assuming test executables) are only built right before running tests." That might solve the issue, but the build by default setting for the test executable would be redundant. Suggestion on this expected functionality might be
|
Ideally download and test would be split into two separate build rules, but currently that would cause cases to be downloaded during a normal build: mesonbuild/meson#2518
Is there any chance of getting this issued fixed? I am using meson 1.3.1, and if I set In the current state, it appears that "build_by_default" does nothing, so if this issue isn't resolved, perhaps it would be best to simply remove this option. |
I've done some cleanup work on the backend in the past to make it easier to implement this, although I've never gotten around to the final step. I think it's valuable to do, indeed. Note that the option does do something for targets that aren't used by tests, for example, it's common to have example programs that are only built if you do The issue is purely, while You can get the same "problem" if you mark a library as That (non test related example) could be a simple documentation issue. |
This way they get built before the tests are run if not already We mark these binary as not build by default, but that does nothing because mesonbuild/meson#2518 which has been open for only 6+ years now [face-palm.gif] Signed-off-by: Simo Sorce <[email protected]>
This way they get built before the tests are run if not already We mark these binary as not build by default, but that does nothing because mesonbuild/meson#2518 which has been open for only 6+ years now [face-palm.gif] Signed-off-by: Simo Sorce <[email protected]>
This way they get built before the tests are run if not already We mark these binary as not build by default, but that does nothing because mesonbuild/meson#2518 which has been open for only 6+ years now [face-palm.gif] Signed-off-by: Simo Sorce <[email protected]>
This way they get built before the tests are run if not already We mark these binary as not build by default, but that does nothing because mesonbuild/meson#2518 which has been open for only 6+ years now [face-palm.gif] Signed-off-by: Simo Sorce <[email protected]>
Fwiw I would love to see this tackled and I'm happy to help testing. I won't be able to hack on meson itself though. On a meson port that I'm working on, apart from the 3-4x longer build times, extra space required, etc the tests have additional dependencies missing on the average person's (or maintainer) setup. I'd really love to avoid having the extra "build-tests" meson toggle, especially since everything is properly annotated as Is there another way to work around this bug? |
It does not make sense to tell users to build the main target (j4-dmenu-desktop) specifically when `meson install` will build everything anyway. I would prefer j4-dmenu-tests **not** being built during install, but that's how Meson works for now. See mesonbuild/meson#2518
I have an executable used for testing that has build_by_default set to false because the sources for the test executable are three times the size of the rest of the code and most of the time I don't need it built.
If I create a test() that uses the executable it is always built. I would expect it to only get built if I run ninja test.
The text was updated successfully, but these errors were encountered: