chore(core): cleanup meson build#8279
Conversation
This updates our meson min version on Windows to 1.0, which means that we can avoid having Visual Studio on the path, as meson can find it anyway. With this change, we can eliminate the batch-wrapper for the build, significantly improving build performance and simplifying the scripts. This also adds a change to disable tests for dependency builds of core, along with the `--no-tests` command line option for doing builds without tests. Minor cleanup includes eliminating various warnings from meson.build files, and standardizing WASM cross-platform build options for Windows.
User Test ResultsTest specification and instructions User tests are not required |
|
Turns out meson doesn't support building x86 targets with this model. Seriously: So we'll have to roll back to using our disgusting .bat wrapper around the meson build, but at least we can ensure that we remove other Visual Studio versions from the path for a more stable build. |
I've opened mesonbuild/meson#11435 on the meson project to hopefully get this sorted -- not entirely sure of the appropriate way to do it there so will see if the meson maintainers respond first. |
| # meson forces us to configure tests, including building compilers, even | ||
| # if we don't plan to run them, for example when doing a dependency build | ||
| # in CI |
There was a problem hiding this comment.
including building compilers
If installing a compiler for this is undesirable in CI, maybe you'd prefer to conditionally add the language with have_somelang = add_languages('somelang', required: tests_mandatory) and then only configure the tests if the language is available.
There was a problem hiding this comment.
Thanks for the review!
Sadly, we kinda need to jump through some hoops here anyway: we don't want to build the test dependencies when building, for example, Keyman for Windows, for performance reasons; these dependencies are TypeScript and not built with meson.
I guess the comment in build.sh is a bit misleading in that regard.
The approach we took in the end was to declare a "no tests" option, because it was more explicit, as opposed to previously where we tested for the presence of nodejs, and implicitly disabled certain tests. This means that the default behaviour is to build tests, and fail if something is missing, which is better than silently passing.
| "references": [ | ||
| { "path": "../../../../common/web/keyman-version/tsconfig.esm.json" }, | ||
| { "path": "../../../../common/web/types/" }, | ||
| { "path": "../../../../common/tools/hextobin/" }, |
There was a problem hiding this comment.
This is needed to fix a build failure that arises due to order of compilation, otherwise.
jahorton
left a comment
There was a problem hiding this comment.
I'm not too familiar with the Core build, but I think this is LGTM-worthy?
Fixes #8272.
This updates our meson min version on Windows to 1.0, which means that we can avoid having Visual Studio on the path, as meson can find it anyway. With this change, we can eliminate the batch-wrapper for the build, significantly improving build performance and simplifying the scripts.This also adds a change to disable tests for dependency builds of core, along with the
--no-testscommand line option for doing builds without tests.Minor cleanup includes eliminating various warnings from meson.build files, and standardizing WASM cross-platform build options for Windows.
I have also specified
--no-testsin all dependent builds.@keymanapp-test-bot skip