feature request: add options to disable the build of the tools, tests and fuzz
vtorri opened this issue · comments
adding 3 options to disable the build of tools, tests and fuzz would make the build faster when they are not wanted
i can add a PR if you want, with something like this in 'meson_options.txt':
option('tools', type: 'boolean', value: true,
description: 'Build tools')
option('tests', type: 'boolean', value: true,
description: 'Build tests')
option('fuzz', type: 'boolean', value: true,
description: 'Build fuzzing tool')
and call subdir() conditionnaly in top level meson.build
It sounds like a good idea.
If you think the meson build is too slow, feel free to open a PR and put some analysis/numbers/timings into the description (e.g. 'before' and 'after'). Then tag some of the current meson contributors as reviewers.
Just for the side of the autotools builds: Here, building everything (library, tools, tests, fuzz-tests) and executing all tests takes 4.5s overall with make clean && make check
. This is a 3yrs old desktop system.
@rockdaboot well, first, it's not just a question of speed, even though on Windows, it's far less fast than on unix. Especially the autotools and the configure script. I have cloned libpsl on Windows, using msys2 + mingw-w64, here is the time on my computer the time taken by configure
and make
(not make check
):
time ./configure
real 0m47.172s
user 0m3.609s
sys 0m11.407s
time make
real 0m20.484s
user 0m1.088s
sys 0m3.529s
With meson:
time meson setup builddir
real 0m2.820s
user 0m0.000s
sys 0m0.015s
time meson compile -C builddir
real 0m4.320s
user 0m0.000s
sys 0m0.000s
I've not tested meson without fuzz and tests, but it will of course be faster
That's why when I can choose, i prefer to avoid autotools. And i really like meson (vs cmake, but it's my opinion of course)
My main concern, though, is that i just need the DLL on Windows. And I guess that a normal user does not care about fuzz or tests.
@rockdaboot so ?
My main concern, though, is that i just need the DLL on Windows. And I guess that a normal user does not care about fuzz or tests.
Sorry, maybe I wasn't clear :-)
The autotools separate building of lib+tool and tests (incl. test with fuzzing corpora). IMO, it makes sense to do the same separation when building with meson. I think that is what you suggest.
Building the tool is very fast, so I don't think there is a good reason to separate that as well.
My suggestion would be to leave the default meson build as is and add two options, one to build lib+tool only. The second to build and run the tests.
well, maybe one option is then sufficient : lib and tool are always built, then an option to build (and run) the tests (and fuzz also in that case)
Since the linked PR was merged, this can probably be closed now.