Commit graph

28476 commits

Author SHA1 Message Date
Marc Durdin
9a01ac166d chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-12-01 16:17:21 +07:00
Marc Durdin
cd8825d504
Merge pull request #12736 from keymanapp/refactor/developer/unify_test_action
refactor(developer): unify test action
2024-12-01 00:14:11 +01:00
Keyman Server
a4b6ce7c78
Merge pull request #12747 from keymanapp/auto/version-master-18.0.149
auto: increment master version to 18.0.149
2024-11-29 10:02:12 -08:00
Keyman Build Agent
e50e46a226 auto: increment master version to 18.0.149 2024-11-29 13:01:39 -05:00
Eberhard Beilharz
48339ee41e
Merge pull request #12740 from keymanapp/chore/common/emsdk-offline
chore(common): add offline support for emscripten
2024-11-29 12:41:07 +01:00
Eberhard Beilharz
b8c120dd5c
Merge pull request #12721 from keymanapp/chore/core/cherry-pick/load-from-blob-api
feat(core,linux,developer,windows): implement loading KMX from blob 🍒
2024-11-29 12:40:51 +01:00
Eberhard Beilharz
5e839b7681
Merge pull request #12707 from keymanapp/chore/developer/rename-tests
chore(developer): rename test files
2024-11-29 12:38:41 +01:00
Dr Mark C. Sinclair
9c848160de
Merge pull request #12714 from keymanapp/test/common/web/types/9052-unit-tests-unicodeset-parser-api
test(common/web/types): unit tests for unicodeset-parser-api
2024-11-29 03:32:05 +00:00
Dr Mark C. Sinclair
eccc7edeba chore(common/web): add blank line at end of file 2024-11-29 03:30:08 +00:00
Dr Mark C. Sinclair
1d0dddb11e chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-unicodeset-parser-api 2024-11-29 03:27:39 +00:00
Dr Mark C. Sinclair
3de4f997e1 chore(common/web): remove MockUnicodeSet as unnecessary 2024-11-29 01:56:38 +00:00
Marc Durdin
5d06465388
docs(common): add builder_do_typescript_tests docs 2024-11-29 02:46:05 +01:00
Keyman Server
80f0ec7907
Merge pull request #12742 from keymanapp/auto/version-master-18.0.148
auto: increment master version to 18.0.148
2024-11-28 10:02:59 -08:00
Keyman Build Agent
d3d9ab3a9b auto: increment master version to 18.0.148 2024-11-28 13:02:29 -05:00
Eberhard Beilharz
a842d41829
Merge pull request #12739 from keymanapp/chore/common/nvm-offline
chore(common): improve offline builds
2024-11-28 14:36:35 +01:00
Eberhard Beilharz
66404f9503
chore(developer): rename test files
This change rename the test files for Developer according to the
discussion at the Keyman conference in November 2024.
2024-11-28 14:32:09 +01:00
rc-swag
0ff0deaf6a
feat(windows): load keyboard file to memory blob
Fixes: #12500
Cherry-pick: #12684
2024-11-28 14:28:10 +01:00
Eberhard Beilharz
ef4f829737
chore(common): add offline support for emscripten
This change allows to build with emscripten if offline (when
passing the `--offline` parameter). Previously this failed because
as part of locating emscripten we try to pull the latest repo
version and install the desired emscripten version. With this change
when `--offline` is specified we try to use the currently installed
version of emsdk. If it isn't installed or if the wrong version
is installed we will fail the build.
2024-11-28 14:21:17 +01:00
Eberhard Beilharz
49650d6742
Merge pull request #12725 from keymanapp/fix/linux/asserts
fix(linux): disable assertions in release builds of ibus-keyman
2024-11-28 13:48:35 +01:00
Eberhard Beilharz
b423e8193f
Merge pull request #12724 from keymanapp/fix/core/cherry-pick/12661_logging
fix(core): permanently disable logging 🍒
2024-11-28 13:48:11 +01:00
Eberhard Beilharz
c7fef4770a
Merge pull request #12720 from keymanapp/chore/web/rename-tests
chore(web): rename file missed in #12704
2024-11-28 19:41:41 +07:00
Eberhard Beilharz
c7773f9e9c
Merge pull request #12719 from keymanapp/refactor/common/tc_tests
refactor(common): output number of tests when running on TC
2024-11-28 19:41:16 +07:00
Eberhard Beilharz
badb23a6ab
Merge pull request #12710 from keymanapp/refactor/developer/tc_tests
refactor(developer): output number of tests when running on TC
2024-11-28 19:40:52 +07:00
Eberhard Beilharz
ddb6631d2a
chore(common): improve offline builds
`nvm install` will fail if trying to build while offline. This
change tries to use the required node version first and if that
fails installs and then uses it.
2024-11-28 11:45:26 +01:00
Marc Durdin
70a32f00d7 refactor(developer): unify test action 2024-11-28 15:16:25 +07:00
Marc Durdin
b0e87cb85a chore(core): update assertion unit test for release builds 2024-11-28 12:24:54 +07:00
Marc Durdin
ffae5bab1c chore(core): typo in meson 2024-11-28 11:56:50 +07:00
Marc Durdin
36ddd793a5 chore(core): ifdef variables only used in assertions 2024-11-28 10:58:51 +07:00
Marc Durdin
faf479c105 chore(linux): include common test source files 2024-11-28 10:54:01 +07:00
Marc Durdin
bcecedcb04 chore(developer): ifdef variables only used in assertions 2024-11-28 10:36:13 +07:00
Marc Durdin
b9b4ad4996 chore(developer): ifdef variables only used in assertions 2024-11-28 10:27:40 +07:00
Marc Durdin
e2b8222a6b chore(developer): ifdef variables only used in assertions 2024-11-28 10:12:28 +07:00
Marc Durdin
e640caaa9c chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-11-28 09:53:45 +07:00
Marc Durdin
d71cb56ca7 fix(core): rename assert() to test_assert() in unit tests
Had a real yak shave this morning with disabling assertions in release
builds in our C/C++ code. It turns out that our unit tests use
`assert()` which we intended to use from `test_assert.h`, but in some
cases `cassert` or `assert.h` had been #included after `test_assert.h`,
overriding our special `assert()` macro. The chain of includes is
somewhat hard to puzzle out -- it's often buried several levels deep.
This meant that a release build would drop all test assertions, meaning
most tests passed, unsurprisingly, as there were no assertions left to
fail ... but some tests failed with crashes because we optimized out
important lines such as `assert(some_important_function())`.

I was quite unhappy with this fragility, so I have opted to rename
`assert()` to `test_assert()` in all of our home-grown C/C++ unit tests,
which further highlighted unit tests which were only using the C/C++
`assert()` and not ours, so then had to figure out which unit test
executables needed to have `test_assert` added, and then ... then ...
discovered a bug in `test_color.h`, where we were #including
`io.h`/`unistd.h` inside a `namespace console_color {}` block, which
just happened to be the first ref to those beautiful headers, and thus
(because `#pragma once`) meant that useful little functions like
`access()` were no longer accessible to us in the global namespace.

I have also audited Every Single Call to `assert()` to verify that we do
not do Important Work inside the parentheses, and, apart from those
offending unit tests, now resolved with `test_assert()`, it looks like
all is good.

I would like to present one very well-shaved yak in this commit.

Fixes: #12619
2024-11-28 09:46:01 +07:00
Marc Durdin
8c4a835354 chore(common): define NDEBUG for release builds to disable assertions on all platforms 2024-11-28 09:41:14 +07:00
rc-swag
38aa5c8269
Merge pull request #12701 from keymanapp/docs/linux-macos-emscripten-setup
docs(common): linux and macOS emscripten setup
2024-11-28 12:25:19 +10:00
Dr Mark C. Sinclair
a2cb00aa81 chore(common/web): add copyright banner 2024-11-28 02:01:45 +00:00
Dr Mark C. Sinclair
6bc46b030f chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-unicodeset-parser-api 2024-11-28 01:54:50 +00:00
Dr Mark C. Sinclair
8e0207406b
Merge pull request #12702 from keymanapp/test/common/web/types/9052-unit-tests-string-list
test(common/web/types): unit tests for string-list
2024-11-28 01:49:46 +00:00
Dr Mark C. Sinclair
1837529765 chore(common/web): add braces to for loop in initListItem() 2024-11-28 01:48:16 +00:00
Dr Mark C. Sinclair
4dbb33eac4 chore(common/web): add copyright banner 2024-11-28 01:43:37 +00:00
Darcy Wong
2c2466880c
Merge pull request #12717 from keymanapp/chore/android/docs-internal
docs(android): Add android/docs/internal/README
2024-11-28 07:09:44 +07:00
Keyman Server
f3a0bec2e9
Merge pull request #12726 from keymanapp/auto/version-master-18.0.147
auto: increment master version to 18.0.147
2024-11-27 10:02:30 -08:00
Keyman Build Agent
060c80463e auto: increment master version to 18.0.147 2024-11-27 13:01:55 -05:00
Eberhard Beilharz
767d7c65be
fix(linux): disable assertions in release builds
This change uses the G_DISABLE_ASSERT flag to disable assertions
for release builds.

See https://docs.gtk.org/glib/func.assert.html
2024-11-27 18:04:35 +01:00
Eberhard Beilharz
0958a2da23
fix(core): permanently disable logging
This change disables logging at compile time to work around #12661.
Logging can be enabled in the debugger, or by re-compiling with
`g_debug_KeymanLog` set to TRUE.

Related: #12661
Cherry-pick: #12674
2024-11-27 16:36:25 +01:00
Marc Durdin
249428db7b
refactor(developer): km_core_keyboard_load_from_blob in debugger
Replaces `km_core_keyboard_load` with `km_core_keyboard_load_from_blob`.

Fixes: #12690
Cherry-pick: #12711
2024-11-27 16:17:48 +01:00
Eberhard Beilharz
8492b12fdb
feat(linux): use new km_core_keyboard_load_from_blob API method
Fixes: #12498
Cherry-pick: #12683
2024-11-27 16:16:36 +01:00
Eberhard Beilharz
3dc3f040de
feat(core): implement loading KMX from blob
- split keyboard loading into loading KMX file into blob and then
  loading the keyboard processor from the blob.
- deprecate `km_core_keyboard_load`
- move file access next to deprecated method. This is now the only place
  that loads a file in Core; unit tests have some more places that
  load files.
- introduce GTest and add unit tests for loading from blob

Cherry-picked from `epic/web-core` branch.

Cherry-Pick-Commit: 1deaa323ad
Cherry-Pick-Commit: 59019cc8b7
Cherry-Pick-Commit: bc46458368
Cherry-Pick-Commit: d06aa29956
Cherry-Pick-Commit: 1c88166f6e
Cherry-Pick-Commit: 069cd21ecd
Cherry-Pick-Commit: 052ae2ec35
Cherry-Pick-Commit: 11a2a3ba3a

Part-of: #11293
Part-of: #8093
2024-11-27 15:30:05 +01:00
Eberhard Beilharz
6731cc44ab
chore(web): rename file missed in #12704 2024-11-27 12:13:57 +01:00