Commit graph

53 commits

Author SHA1 Message Date
Steven R. Loomis
2913ba45a8 fix(common): dx: don't call exit(0) on failure 🙀
- always use std::exit(EXIT_FAILURE) if there is an error.
- use --print-errorlogs with meson to show errors to the log

Fixes: #10004
2023-11-14 07:16:32 -06:00
Marc Durdin
0e44cfdcaf
Merge pull request #9820 from keymanapp/fix/core/9816-build-test-params
fix(core): build: support -t parameter correctly
2023-10-28 17:50:05 +11:00
Marc Durdin
835e29363e fix(core): build: support -t parameter correctly
Now allows any of the following. Quote marks are significant for
multiple tests with `-t`:

```bash
core/build.sh test:wasm --no-deps -- state-api debug-api
core/build.sh test:wasm --no-deps -- "state-api debug-api"
core/build.sh test:wasm --no-deps -t "state-api debug-api"
core/build.sh test:wasm --no-deps --test "state-api debug-api"
```

The `-t` / `--test` option takes a single string parameter which is
passed on to `meson test`, whereas the `--` "end of parameters" marker
allows arbitrary remaining parameters to be passed on to `meson test`.
2023-10-22 07:16:52 +07:00
Eberhard Beilharz
52bb859817
chore(linux): Rename (lib)kmnkbp to (lib)keymancore 2023-10-19 10:35:09 +02:00
Marc Durdin
062b947363 chore: Merge branch 'feature-kmcompx' into chore/merge-master-into-feature-kmcompx-a17s9 2023-03-23 10:08:59 +07:00
Marc Durdin
549a8e009e chore(common): define BUILDER_CONFIGURATION env var 2023-03-23 09:21:55 +07:00
Marc Durdin
d1c8061b5f chore: Merge branch 'feature-kmcompx' into chore/merge-master-into-kmcompx 2023-03-16 12:29:17 +07:00
Marc Durdin
92ed99c4d6 chore(common): build script performance improvements
Improves build script performance by:
* using built-ins wherever possible (e.g. string splitting)
* eliminating redundant code
* using absolute (to $KEYMAN_ROOT) rather than relative paths to avoid realpath
* removing unnecessary `npm run` calls

BEFORE                         | AFTER
-------------------------------|----------------------
time ./core/build.sh --help    |
real    0m2.116s               | real    0m0.874s
user    0m0.578s               | user    0m0.198s
sys     0m0.984s               | sys     0m0.289s
-------------------------------|----------------------
time ./web/build.sh --help     |
real    0m3.523s               | real    0m0.757s
user    0m1.166s               | user    0m0.320s
sys     0m2.273s               | sys     0m0.455s
-------------------------------|----------------------
time ./web/build.sh -d         |
real    1m34.750s              | real    0m59.974s
user    0m9.721s               | user    0m6.284s
sys     0m19.652s              | sys     0m13.202s

@keymanapp-test-bot skip
2023-03-13 07:18:09 +07:00
Marc Durdin
732e622b3f
Merge branch 'master' into chore/core/8395-breadth-first-build 2023-03-10 09:22:09 +11:00
Eberhard Beilharz
d0ec73825a
Merge pull request #8376 from keymanapp/chore/core/obsoleteOption
chore(core): Remove obsolete `--target-path` option
2023-03-09 16:27:23 +01:00
Marc Durdin
d7111eeaa1 chore(core): breadth-first build
Fixes #8395 for core.
2023-03-09 12:50:12 +07:00
Marc Durdin
691dc8e618 chore(core): split flags into standard.meson.build 2023-03-09 11:34:54 +07:00
Marc Durdin
8251ec861a chore: cleanup additional --debug references 2023-03-08 05:46:32 +07:00
Marc Durdin
00017350d3 chore(common): clean up --debug usage in build scripts
Fixes #8373.

Note that the core functionality requested in #8373 is already in place;
this commit just does some cleanup to make this easier to maintain in
the future:

* Uses `builder_is_debug_build` function to test for debug build
  (instead of `builder_has_option --debug`, which would also work but
  using the other function avoids typo issues with the option name).

* Renames `$_builder_debug` to `$_builder_debug_internal` to reduce
  naming confusion

* Documents `$builder_debug`, `builder_is_debug_build`, and clarifies
  usage of `--debug` option.

* Logs command line for dep builds (we could hide this in the future,
  but it certainly doesn't hurt for now!)
2023-03-08 05:40:40 +07:00
Eberhard Beilharz
794557f7d5
chore(core): Remove obsolete --target-path option
Linux package builds no longer require a different target path, so
we can remove the `--target-path` parameter.
2023-03-07 13:38:31 +01:00
Marc Durdin
3c175bfc63 feat(core): run tests for current arch 2023-03-01 13:41:23 +07:00
Marc Durdin
e85bbaa069 feat(core): build both archs for mac 2023-03-01 13:02:48 +07:00
Marc Durdin
78f18c38ee feat(core): mac fat library -- testing 2023-03-01 11:00:15 +07:00
Marc Durdin
38603e8421
Merge pull request #8279 from keymanapp/chore/core/cleanup-meson-build
chore(core): cleanup meson build
2023-02-23 13:28:02 +11:00
Marc Durdin
9eb472579c chore: Merge branch 'feature-ldml' into chore/merge-master-to-feature-ldml-A17S7-2 2023-02-23 08:05:31 +07:00
Marc Durdin
b968bcfdfd
Merge branch 'feature-ldml' into chore/core/cleanup-meson-build 2023-02-23 08:49:56 +11:00
Marc Durdin
ce864ea923 chore: update standard script prolog to use builtin instead of dirname 2023-02-22 11:04:15 +07:00
Marc Durdin
463c7ff907 chore: remove greadlink from standard script prolog 2023-02-22 10:43:06 +07:00
Marc Durdin
84d1446cb7 chore(core): update os_id to BUILDER_OS 2023-02-22 09:08:15 +07:00
Marc Durdin
e645b8665f chore: Merge branch 'feature-ldml' into chore/A17S7-master-to-feature-ldml
* core/build.sh -- accept feature-ldml changes (remove call to get_builder_OS)
* developer/src/kmlmc/build.sh -- delete file
*	linux/debian/rules -- accept master changes, fixup call to core/build.sh
*	linux/ibus-keyman/tests/Makefile.am -- accept master changes, fixup call to core/build.sh
*	linux/scripts/build.sh -- accept master changes, fixup call to core/build.sh
*	linux/scripts/reconf.sh -- accept master changes
2023-02-22 08:00:08 +07:00
Marc Durdin
21af2c1234 chore(core): restore bat wrapper for vc++ build 2023-02-21 21:49:19 +07:00
Marc Durdin
29ddeeb67b chore(core): remove cl from path before build, build static lib 2023-02-21 13:11:31 +07:00
Marc Durdin
d74b08f37c chore(core): handle meson version 0.53.2 2023-02-21 12:41:44 +07:00
Marc Durdin
19101c6a2a chore(core): cleanup meson build
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.
2023-02-21 12:12:28 +07:00
Eberhard Beilharz
33ed91e970
chore(linux): Merge branch 'master' into chore/linux/5981_addBuild.sh 2023-02-20 09:54:05 +01:00
Marc Durdin
a004978863 chore: use builder_heading, remove echo_heading 2023-02-20 09:17:51 +07:00
Marc Durdin
4d53a277f3 chore: use builder_die, remove fail 2023-02-20 09:15:38 +07:00
Marc Durdin
8f5997a3e6 chore: rename os_id to BUILDER_OS 2023-02-20 08:44:03 +07:00
Eberhard Beilharz
3dbdef651d
chore(linux): Add build.sh to ibus-keyman 2023-02-01 08:49:26 +01:00
Marc Durdin
cbb15b2cb9 chore(core): tweak scripts 2022-10-14 16:32:57 +11:00
Marc Durdin
2cf6bf3f60 chore(common): update build.sh dependencies for epic-ldml 2022-10-14 10:45:00 +11:00
Marc Durdin
3828eddf4f fix(core): add hyphen to d parameter
I could add a trap for this to build-utils.sh but that's more work for
little benefit for an internal tool.
2022-09-21 05:46:21 +10:00
Marc Durdin
736db7179c feat(common): support -- for build scripts
Allows use of `./build.sh configure -- --param-one=foo ...`.

Updates Core build to support `--` (including build.bat wrapper for
Windows builds). Fixes Linux debian rules to pass additional
parameters in with this format again, and adds `:arch` to only build
current architecture, not wasm as well...

Note that when using `--` you should typically avoid multiple actions in
a single command, as each action may interpret the additional parameters
differently!
2022-09-20 09:51:31 +10:00
Marc Durdin
6987a170c0 chore(core): fixup paths for linux build 2022-09-12 17:22:21 +10:00
Marc Durdin
91d375ac81 chore(core): use builder_ for build.sh
Refactoring of build.sh to use the builder_ functions. The script should
now be a lot cleaner. Usage is available with `core/build.sh --help`

Targets are :x86, :x64, :wasm, :arch (linux/mac).

Supports additional requirements of Linux build (--target-path,
--configure).

By default will attempt to build all available targets.

Actions are: clean, configure, build, test, install, uninstall.

The install and uninstall actions only work for linux and mac targets at
present.
2022-09-12 09:56:32 +10:00
Marc Durdin
670229937a chore: move hextobin to common 2022-08-29 15:07:43 +10:00
Marc Durdin
3d08348256 feat(core): hextobin tool
The hextobin tool is used to help us construct invalid .kmx files
without having to either hack these into the compiler, or write them
with a hex editor. It feels a little bit of overkill, but this makes it
easy to (a) work with our intended file structures, and (b) review any
changes to these invalid keyboard tests.

Note: I did do a cursory search for a hex2bin or hextobin that we could
easily use but did not find a good simple cross-platform tool that we
could consume (`xxd -r` would work but AFAICT constrains our format to a
dump which is much harder to work with and read -- I wanted to be able
to annotate with file structures.)

For an example, see ik_000_null_invalid.txt.

This means that building the invalid keyboards for tests requires node,
but that should be fine given we need node to build the valid keyboards
anyway.

I've put hextobin under core/tools but it could just as well live under
common/tools in the future, if we find it useful for other project unit
tests.
2022-08-29 06:21:16 +10:00
Marc Durdin
bc02ba984a chore(core): skip ldml keyboard tests if node not available 2022-08-27 08:47:34 +10:00
Marc Durdin
44d7d5ca88 chore(core): always build deps 2022-08-27 06:23:33 +10:00
Marc Durdin
4820f99503 chore(core): also build keyman-version as a prereq 2022-08-26 15:41:44 +10:00
Marc Durdin
daf6a7970e feat(core): use kmldmlc to build test keyboards
Removes .kmx from repo and builds them from the source .xml files using
kmldmlc (building that if necessary also with a poor fella's dependency
check for now), and generally a lot of cleanup of the meson.build files
for the ldml tests.

Moves keyboards to a subfolder of the ldml unit test folder to keep them
neat and tidy and avoid embedding huge files into ldml.js for test of
WASM.

Note: 000_null_keyboard and 002_null_invalid do build successfully, but
the core ldml keyboardprocessor currently fails on them, because they
are missing keys and vkey sections.
2022-08-26 15:12:38 +10:00
Marc Durdin
0a22acd0e4
Merge pull request #7018 from keymanapp/chore/common/builder-tweaks
chore(common): build-utils.sh minor tweaks
2022-08-03 20:19:42 +10:00
Marc Durdin
f762776d5c chore(core): get wasm core building again
Updates search for emscripten if not on path, and fixes up unit test
infrastructure for wasm builds for new tests.
2022-08-01 14:15:52 +10:00
Marc Durdin
45b25adecd chore(common): use standard VERSION and TIER
build-utils.sh is responsible for filling these variables.

Note: getversion.sh and getversion.bat are still currently used by
meson. gettier is no longer used with these changes.
2022-07-31 07:15:11 +10:00
Marc Durdin
fd7401fb15 chore(core): reset build.sh to use standard build-utils.sh include 2022-07-30 06:02:07 +10:00