Commit graph

33096 commits

Author SHA1 Message Date
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
Dr Mark C. Sinclair
33056f0ec1 chore(common/web): incomplete test case for build() ... keys still needed 2024-11-28 08:56:23 +00:00
Marc Durdin
70a32f00d7 refactor(developer): unify test action 2024-11-28 15:16:25 +07:00
Dr Mark C. Sinclair
aac97cd8b9 chore(common/web): add one test case for setString() 2024-11-28 08:02:48 +00:00
Dr Mark C. Sinclair
8d08909a1f chore(common/web): initial commit with incomplete first test case for write() 2024-11-28 07:41:17 +00:00
rc-swag
981e7d1090 feat(windows): remove sm state from insthelper
Remove the update of state from the insthelper as configure
first run will now set it back to idle.
2024-11-28 16:07:57 +10:00
Dr Mark C. Sinclair
9fd2d4a674 chore(common/web): add five test cases for fromFilename() 2024-11-28 06:07:21 +00:00
Dr Mark C. Sinclair
920b702eef chore(common/web): add five test cases for replaceExtension(), two commented out as failing 2024-11-28 05:56:22 +00:00
rc-swag
4023aca115 feat(windows): convert the klog errors to sentry
Update all the errors logged using KLog to sentry messages
2024-11-28 15:55:45 +10:00
Marc Durdin
b0e87cb85a chore(core): update assertion unit test for release builds 2024-11-28 12:24:54 +07:00
Dr Mark C. Sinclair
589698b799 chore(common/web): add three test cases for filenameIs() 2024-11-28 05:16:48 +00:00
Marc Durdin
ffae5bab1c chore(core): typo in meson 2024-11-28 11:56:50 +07:00
rc-swag
caef322cc4 feat(windows): remove retry state retry immediately
Remove the retry state as the process will retry in the same process.
Future we could consider adding a retry state that would retry on
the next time kmshell is started for any reason.
2024-11-28 14:25:42 +10:00
rc-swag
cabe8ff73a chore(windows): Merge branch 'epic/windows-updates' into feat/windows/set-sm-idle-firstrun
# Keyman Conventional Commit suggestions:
#
# - Link to a Sentry issue with git trailer:
#     Fixes: _MODULE_-_ID_
# - Give credit to co-authors:
#     Co-authored-by: _Name_ <_email_>
# - Use imperative, present tense ('attach' not 'attaches', 'attached' etc)
# - Don't include a period at the end of the title
# - Always include a blank line before trailers
# - More: https://github.com/keymanapp/keyman/wiki/Pull-Request-and-Commit-workflow-notes
2024-11-28 15:46:08 +10: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
Dr Mark C. Sinclair
5a56d0f159 chore(common/web): add four test cases for binaryTypeFromFilename() 2024-11-28 03:21:16 +00:00
Dr Mark C. Sinclair
d08b6933f4 chore(common/web): add four test cases for sourceTypeFromFilename() 2024-11-28 03:16:17 +00:00
Marc Durdin
e2b8222a6b chore(developer): ifdef variables only used in assertions 2024-11-28 10:12:28 +07:00
Dr Mark C. Sinclair
1782f8db09 chore(common/web): add four test cases for sourceOrBinaryTypeFromFilename() 2024-11-28 03:03:48 +00: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
324c57f793 chore(common/web): test Source file extension removal 2024-11-28 02:19:19 +00:00
Dr Mark C. Sinclair
3682766ff7 chore(common/web): add copyright banner 2024-11-28 02:15:46 +00:00
Dr Mark C. Sinclair
ba44fe6fcb chore(common/web): Merge branch 'test/common/web/types/9052-unit-tests-unicodeset-parser-api' into test/common/web/types/9052-unit-tests-file-types 2024-11-28 02:11:40 +00:00
Dr Mark C. Sinclair
66d0587370 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-file-types 2024-11-28 02:10:56 +00: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
Steven R. Loomis
c306147e6b
Merge branch 'master' into fix/core/12298-get-key-list 2024-11-27 08:59:59 -06: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