From f18bba2781a17af9ace107a048ac1d0eea805fe1 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:20:43 +1000 Subject: [PATCH 01/11] docs(linux): update emscripten bash setup Update the linux and macos bash setup to documents. --- docs/build/linux-ubuntu.md | 13 +++++++++++++ docs/build/macos.md | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/docs/build/linux-ubuntu.md b/docs/build/linux-ubuntu.md index a45d9390ba..a7f15a29e0 100644 --- a/docs/build/linux-ubuntu.md +++ b/docs/build/linux-ubuntu.md @@ -70,10 +70,23 @@ git clone https://github.com/emscripten-core/emsdk.git cd emsdk ./emsdk install 3.1.58 ./emsdk activate 3.1.58 +cd upstream/emscripten +npm install export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` +If you are updating an existing install of Emscripten: + +```bash +cd emsdk +git pull +./emsdk install 3.1.58 +./emsdk activate 3.1.58 +cd upstream/emscripten +npm install +``` + > ![WARNING] > Don't put EMSDK on the path, i.e. don't source `emsdk_env.sh`. > diff --git a/docs/build/macos.md b/docs/build/macos.md index 25b0c1f82a..2baf0d5831 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -101,10 +101,23 @@ git clone https://github.com/emscripten-core/emsdk cd emsdk emsdk install 3.1.58 emsdk activate 3.1.58 +cd upstream/emscripten +npm install export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` +If you are updating an existing install of Emscripten: + +```bash +cd emsdk +git pull +emsdk install 3.1.58 +emsdk activate 3.1.58 +cd upstream/emscripten +npm install +``` + You will want to add `EMSCRIPTEN_BASE` to your .bashrc. > ![WARNING] From d86e499f9c81cff862ff2b15ffcc983e0bb356d9 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:47:44 +1000 Subject: [PATCH 02/11] docs(common): apply review comments Co-authored-by: Eberhard Beilharz Co-authored-by: Marc Durdin --- docs/build/linux-ubuntu.md | 2 +- docs/build/macos.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build/linux-ubuntu.md b/docs/build/linux-ubuntu.md index a7f15a29e0..37b2aafa1a 100644 --- a/docs/build/linux-ubuntu.md +++ b/docs/build/linux-ubuntu.md @@ -72,7 +72,7 @@ cd emsdk ./emsdk activate 3.1.58 cd upstream/emscripten npm install -export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" +export EMSCRIPTEN_BASE="$(pwd)" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` diff --git a/docs/build/macos.md b/docs/build/macos.md index 2baf0d5831..f961942070 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -103,7 +103,7 @@ emsdk install 3.1.58 emsdk activate 3.1.58 cd upstream/emscripten npm install -export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" +export EMSCRIPTEN_BASE="$(pwd)" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` From d151d0999f1e5308a69fb3eac58a65561d4680ad Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 27 Nov 2024 11:15:43 +0100 Subject: [PATCH 03/11] refactor(common): output number of tests when running on TC This change adds the mocha-teamcity-reporter which outputs the running tests in a special format that TeamCity can interpret. This allows TC to show which tests run as well as the number of tests run. --- common/web/types/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/web/types/build.sh b/common/web/types/build.sh index b2ada0ecbc..75273aaa2c 100755 --- a/common/web/types/build.sh +++ b/common/web/types/build.sh @@ -80,13 +80,20 @@ function do_configure() { } function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + eslint . tsc --build test readonly C8_THRESHOLD=60 # Excludes are defined in .c8rc.json - c8 -skip-full --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha "${builder_extra_params[@]}" + c8 -skip-full --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha ${MOCHA_FLAGS} "${builder_extra_params[@]}" builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." builder_echo warning "Please increase threshold in build.sh as test coverage improves." } From 21736d881759c1e880f3e177401dd15c25103beb Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 26 Nov 2024 21:57:54 +0100 Subject: [PATCH 04/11] refactor(developer): output number of tests when running on TC This change adds the mocha-teamcity-reporter which outputs the running tests in a special format that TeamCity can interpret. This allows TC to show which tests run as well as the number of tests run. Also refactor some of the build scripts to use functions. Note that we had to explicitly add `--check-coverage=false` (which is the default) to get successful builds when we run on TC. --- developer/src/common/web/utils/build.sh | 22 +++++++---- developer/src/kmc-analyze/build.sh | 9 ++++- developer/src/kmc-copy/build.sh | 9 ++++- developer/src/kmc-generate/build.sh | 9 ++++- developer/src/kmc-keyboard-info/build.sh | 25 +++++++----- developer/src/kmc-kmn/build.sh | 22 ++++++----- developer/src/kmc-ldml/build.sh | 50 +++++++++++------------- developer/src/kmc-model-info/build.sh | 15 +++++-- developer/src/kmc-model/build.sh | 16 +++++++- developer/src/kmc-model/package.json | 2 +- developer/src/kmc-package/build.sh | 25 +++++++----- developer/src/kmc/build.sh | 9 ++++- 12 files changed, 139 insertions(+), 74 deletions(-) diff --git a/developer/src/common/web/utils/build.sh b/developer/src/common/web/utils/build.sh index ddc6654993..b813761987 100755 --- a/developer/src/common/web/utils/build.sh +++ b/developer/src/common/web/utils/build.sh @@ -46,18 +46,24 @@ function do_build() { tsc --build } -builder_run_action clean rm -rf ./build/ -builder_run_action configure verify_npm_setup -builder_run_action build do_build +function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi -if builder_start_action test; then eslint . tsc --build test readonly C8_THRESHOLD=50 - c8 --reporter=lcov --reporter=text --exclude-after-remap --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha + c8 --reporter=lcov --reporter=text --exclude-after-remap --check-coverage=false --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha ${MOCHA_FLAGS} builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." builder_echo warning "Please increase threshold in build.sh as test coverage improves." - builder_finish_action success test -fi +} -builder_run_action publish builder_publish_npm +builder_run_action clean rm -rf ./build/ +builder_run_action configure verify_npm_setup +builder_run_action build do_build +builder_run_action test do_test +builder_run_action publish builder_publish_npm diff --git a/developer/src/kmc-analyze/build.sh b/developer/src/kmc-analyze/build.sh index a4844c6afc..d78bd146cd 100755 --- a/developer/src/kmc-analyze/build.sh +++ b/developer/src/kmc-analyze/build.sh @@ -26,12 +26,19 @@ builder_parse "$@" #------------------------------------------------------------------------------------------------------------------- function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + eslint . cd test tsc --build cd .. readonly C8_THRESHOLD=70 - c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha + c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha ${MOCHA_FLAGS} } builder_run_action clean rm -rf ./build/ diff --git a/developer/src/kmc-copy/build.sh b/developer/src/kmc-copy/build.sh index 023f0c73bf..f916bec556 100755 --- a/developer/src/kmc-copy/build.sh +++ b/developer/src/kmc-copy/build.sh @@ -32,12 +32,19 @@ builder_parse "$@" do_test() { # note: `export TEST_SAVE_ARTIFACTS=1` to save a copy of artifacts to temp path # note: `export TEST_SAVE_FIXTURES=1` to get a copy of cloud-based fixtures saved to online/ + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + eslint . cd test tsc --build cd .. readonly C8_THRESHOLD=70 - c8 -skip-full --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha "${builder_extra_params[@]}" + c8 -skip-full --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha ${MOCHA_FLAGS} "${builder_extra_params[@]}" builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." builder_echo warning "Please increase threshold in build.sh as test coverage improves." } diff --git a/developer/src/kmc-generate/build.sh b/developer/src/kmc-generate/build.sh index 6a86a9339f..5380ee3eb2 100755 --- a/developer/src/kmc-generate/build.sh +++ b/developer/src/kmc-generate/build.sh @@ -37,11 +37,18 @@ do_build() { } do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + eslint . cd test tsc --build cd .. - c8 --reporter=lcov --reporter=text mocha "${builder_extra_params[@]}" + c8 --reporter=lcov --reporter=text mocha ${MOCHA_FLAGS} "${builder_extra_params[@]}" } builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo diff --git a/developer/src/kmc-keyboard-info/build.sh b/developer/src/kmc-keyboard-info/build.sh index c85d76db01..5ccc41a813 100755 --- a/developer/src/kmc-keyboard-info/build.sh +++ b/developer/src/kmc-keyboard-info/build.sh @@ -32,23 +32,28 @@ function do_configure() { mkdir -p src/imports echo 'export default ' > src/imports/langtags.js cat "$KEYMAN_ROOT/resources/standards-data/langtags/langtags.json" >> src/imports/langtags.js - } + +function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + + eslint . + tsc --build test + c8 --reporter=lcov --reporter=text --exclude-after-remap --check-coverage=false mocha ${MOCHA_FLAGS} +} + #------------------------------------------------------------------------------------------------------------------- builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo builder_run_action configure do_configure builder_run_action build tsc --build builder_run_action api api-extractor run --local --verbose - -#------------------------------------------------------------------------------------------------------------------- - -if builder_start_action test; then - eslint . - tsc --build test - c8 --reporter=lcov --reporter=text --exclude-after-remap mocha - builder_finish_action success test -fi +builder_run_action test do_test #------------------------------------------------------------------------------------------------------------------- diff --git a/developer/src/kmc-kmn/build.sh b/developer/src/kmc-kmn/build.sh index a073241475..5f81a367a9 100755 --- a/developer/src/kmc-kmn/build.sh +++ b/developer/src/kmc-kmn/build.sh @@ -56,27 +56,31 @@ function copy_deps() { cp ../kmcmplib/build/wasm/$BUILDER_CONFIGURATION/src/wasm-host.wasm ./build/src/import/kmcmplib/wasm-host.wasm } -if builder_start_action build; then +function do_build() { copy_deps tsc --build - builder_finish_action success build -fi +} -builder_run_action api api-extractor run --local --verbose +function do_test() { + local MOCHA_FLAGS= -#------------------------------------------------------------------------------------------------------------------- + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi -if builder_start_action test; then copy_deps tsc --build test/ npm run lint readonly C8_THRESHOLD=80 - c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha + c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha ${MOCHA_FLAGS} builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." builder_echo warning "Please increase threshold in build.sh as test coverage improves." +} - builder_finish_action success test -fi +builder_run_action build do_build +builder_run_action api api-extractor run --local --verbose +builder_run_action test do_test #------------------------------------------------------------------------------------------------------------------- diff --git a/developer/src/kmc-ldml/build.sh b/developer/src/kmc-ldml/build.sh index 73a40c79d7..61fc2a695c 100755 --- a/developer/src/kmc-ldml/build.sh +++ b/developer/src/kmc-ldml/build.sh @@ -33,30 +33,19 @@ builder_describe_outputs \ builder_parse "$@" -#------------------------------------------------------------------------------------------------------------------- - -if builder_start_action clean; then +function do_clean() { rm -rf ./build/ ./tsconfig.tsbuildinfo - builder_finish_action success clean -fi +} -#------------------------------------------------------------------------------------------------------------------- - -if builder_start_action configure; then +function do_configure() { verify_npm_setup - builder_finish_action success configure -fi +} -#------------------------------------------------------------------------------------------------------------------- - -if builder_start_action build; then +function do_build() { npm run build - builder_finish_action success build -fi +} -#------------------------------------------------------------------------------------------------------------------- - -if builder_start_action build-fixtures; then +function do_build_fixtures() { # Build basic.kmx and emit its checksum mkdir -p ./build/test/fixtures node ../kmc build ./test/fixtures/basic.xml --no-compiler-version --debug --out-file ./build/test/fixtures/basic-xml.kmx @@ -65,22 +54,29 @@ if builder_start_action build-fixtures; then # Generate a binary file from basic.txt for comparison purposes node ../../../common/tools/hextobin/build/hextobin.js ./test/fixtures/basic.txt ./build/test/fixtures/basic-txt.kmx +} - builder_finish_action success build-fixtures -fi +function do_test() { + local MOCHA_FLAGS= -builder_run_action api api-extractor run --local --verbose + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi -#------------------------------------------------------------------------------------------------------------------- - -if builder_start_action test; then eslint . cd test tsc -b cd .. - c8 --reporter=lcov --reporter=text mocha "${builder_extra_params[@]}" - builder_finish_action success test -fi + c8 --reporter=lcov --reporter=text mocha ${MOCHA_FLAGS} "${builder_extra_params[@]}" +} + +builder_run_action clean do_clean +builder_run_action configure do_configure +builder_run_action build do_build +builder_run_action build-fixtures do_build_fixtures +builder_run_action api api-extractor run --local --verbose +builder_run_action test do_test #------------------------------------------------------------------------------------------------------------------- diff --git a/developer/src/kmc-model-info/build.sh b/developer/src/kmc-model-info/build.sh index b1ba95c34b..2563da2224 100755 --- a/developer/src/kmc-model-info/build.sh +++ b/developer/src/kmc-model-info/build.sh @@ -50,13 +50,20 @@ builder_run_action api api-extractor run --local --verbose #------------------------------------------------------------------------------------------------------------------- -if builder_start_action test; then +function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi eslint . tsc --build test - c8 --reporter=lcov --reporter=text --exclude-after-remap --lines 80 mocha + c8 --reporter=lcov --reporter=text --exclude-after-remap --check-coverage=false --lines 80 mocha ${MOCHA_FLAGS} # TODO: remove --lines 80 and improve coverage - builder_finish_action success test -fi +} + +builder_run_action test do_test #------------------------------------------------------------------------------------------------------------------- diff --git a/developer/src/kmc-model/build.sh b/developer/src/kmc-model/build.sh index 372a145312..7186c3ef89 100755 --- a/developer/src/kmc-model/build.sh +++ b/developer/src/kmc-model/build.sh @@ -35,10 +35,24 @@ function do_build() { npm run build } +function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + npm run lint + cd test + tsc -b + cd .. + c8 --reporter=lcov --reporter=text mocha ${MOCHA_FLAGS} +} + builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo builder_run_action configure verify_npm_setup builder_run_action build do_build builder_run_action api api-extractor run --local --verbose -builder_run_action test npm test +builder_run_action test do_test builder_run_action publish builder_publish_npm diff --git a/developer/src/kmc-model/package.json b/developer/src/kmc-model/package.json index 9f95de51f8..3f95b5e181 100644 --- a/developer/src/kmc-model/package.json +++ b/developer/src/kmc-model/package.json @@ -18,7 +18,7 @@ "scripts": { "build": "tsc -b", "lint": "eslint .", - "test": "npm run lint && cd test && tsc -b && cd .. && c8 --reporter=lcov --reporter=text mocha" + "test": "./build.sh test" }, "author": "Marc Durdin (https://github.com/mcdurdin)", "contributors": [ diff --git a/developer/src/kmc-package/build.sh b/developer/src/kmc-package/build.sh index 0b2d7bda9b..bad3bb1d18 100755 --- a/developer/src/kmc-package/build.sh +++ b/developer/src/kmc-package/build.sh @@ -30,20 +30,25 @@ builder_describe_outputs \ builder_parse "$@" +function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + eslint . + cd test + tsc --build + cd .. + c8 --reporter=lcov --reporter=text mocha ${MOCHA_FLAGS} +} + #------------------------------------------------------------------------------------------------------------------- builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo builder_run_action configure verify_npm_setup builder_run_action build tsc --build builder_run_action api api-extractor run --local --verbose - -if builder_start_action test; then - eslint . - cd test - tsc --build - cd .. - c8 --reporter=lcov --reporter=text mocha - builder_finish_action success test -fi - +builder_run_action test do_test builder_run_action publish builder_publish_npm diff --git a/developer/src/kmc/build.sh b/developer/src/kmc/build.sh index 6c3dfa17bd..6e4ebc0a58 100755 --- a/developer/src/kmc/build.sh +++ b/developer/src/kmc/build.sh @@ -62,10 +62,17 @@ function do_api() { #------------------------------------------------------------------------------------------------------------------- function do_test() { + local MOCHA_FLAGS= + + if [[ "${TEAMCITY_GIT_PATH:-}" != "" ]]; then + # we're running in TeamCity + MOCHA_FLAGS="-reporter mocha-teamcity-reporter" + fi + eslint . tsc --build test/ readonly C8_THRESHOLD=50 - c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha + c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha ${MOCHA_FLAGS} builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." builder_echo warning "Please increase threshold in build.sh as test coverage improves." } From 6731cc44abae2ae6a61d919ac6dfb270649d0977 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 27 Nov 2024 12:13:57 +0100 Subject: [PATCH 05/11] chore(web): rename file missed in #12704 --- ...geContextAttachment.test.ts => pageContextAttachment.tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename web/src/test/auto/dom/cases/attachment/{pageContextAttachment.test.ts => pageContextAttachment.tests.ts} (100%) diff --git a/web/src/test/auto/dom/cases/attachment/pageContextAttachment.test.ts b/web/src/test/auto/dom/cases/attachment/pageContextAttachment.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/attachment/pageContextAttachment.test.ts rename to web/src/test/auto/dom/cases/attachment/pageContextAttachment.tests.ts From 0958a2da23e48416fdf72a9173fad3d4f3c899c6 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 14 Nov 2024 16:37:55 +0100 Subject: [PATCH 06/11] 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 --- core/src/kmx/kmx_processevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/kmx/kmx_processevent.cpp b/core/src/kmx/kmx_processevent.cpp index 6e1e8dc2b4..70d20102bc 100644 --- a/core/src/kmx/kmx_processevent.cpp +++ b/core/src/kmx/kmx_processevent.cpp @@ -12,7 +12,7 @@ using namespace kmx; /* Globals */ KMX_BOOL km::core::kmx::g_debug_ToConsole = FALSE; -KMX_BOOL km::core::kmx::g_debug_KeymanLog = TRUE; +KMX_BOOL km::core::kmx::g_debug_KeymanLog = FALSE; // workaround for #12661 KMX_BOOL km::core::kmx::g_silent = FALSE; /* From 767d7c65be4a16fc00929a19d843ddaf78e2533e Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 27 Nov 2024 18:04:35 +0100 Subject: [PATCH 07/11] 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 --- linux/ibus-keyman/meson.build | 5 +++++ linux/ibus-keyman/src/meson.build | 2 ++ 2 files changed, 7 insertions(+) diff --git a/linux/ibus-keyman/meson.build b/linux/ibus-keyman/meson.build index 763a121245..98281849e8 100644 --- a/linux/ibus-keyman/meson.build +++ b/linux/ibus-keyman/meson.build @@ -8,6 +8,11 @@ project('ibus-keyman', 'c', 'cpp', # meson doesn't allow us to reference a file outside its root subdir('resources') +if get_option('buildtype') != 'debug' + # Disable assertions on release builds + defns += ['-DG_DISABLE_ASSERT'] +endif + conf = configuration_data() ibus = dependency('ibus-1.0', version: '>= 1.2.0') diff --git a/linux/ibus-keyman/src/meson.build b/linux/ibus-keyman/src/meson.build index 2b436caef6..13b3caafc0 100644 --- a/linux/ibus-keyman/src/meson.build +++ b/linux/ibus-keyman/src/meson.build @@ -40,6 +40,8 @@ configure_file( exe = executable( 'ibus-engine-keyman', + c_args: defns, + cpp_args: defns, sources: [engine_files, util_files], dependencies: deps, include_directories: include_dirs, From ddb6631d2a305aa45e40971a3735a1cab8213511 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 28 Nov 2024 11:45:26 +0100 Subject: [PATCH 08/11] 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. --- resources/build/_builder_nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/build/_builder_nvm.sh b/resources/build/_builder_nvm.sh index cccbb6b055..a1bb9a4cc1 100755 --- a/resources/build/_builder_nvm.sh +++ b/resources/build/_builder_nvm.sh @@ -41,8 +41,8 @@ type -t nvm >/dev/null || { } } -nvm install "$REQUIRED_NODE_VERSION" -nvm use "$REQUIRED_NODE_VERSION" +nvm use "$REQUIRED_NODE_VERSION" || \ + (nvm install "$REQUIRED_NODE_VERSION" && nvm use "$REQUIRED_NODE_VERSION") # Beware the hardcoded path below -- it should already be in the system PATH From d3d9ab3a9b451b6b855ab0ec92c987556aa3a402 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Thu, 28 Nov 2024 13:02:29 -0500 Subject: [PATCH 09/11] auto: increment master version to 18.0.148 --- HISTORY.md | 12 ++++++++++++ VERSION.md | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index b2771fd853..2300e60b44 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,17 @@ # Keyman Version History +## 18.0.147 alpha 2024-11-28 + +* docs(android): Add android/docs/internal/README (#12717) +* test(common/web/types): unit tests for string-list (#12702) +* docs(common): linux and macOS emscripten setup (#12701) +* refactor(developer): output number of tests when running on TC (#12710) +* refactor(common): output number of tests when running on TC (#12719) +* chore(web): rename file missed in #12704 (#12720) +* fix(core): permanently disable logging (#12724) +* fix(linux): disable assertions in release builds of ibus-keyman (#12725) +* chore(common): improve offline builds (#12739) + ## 18.0.146 alpha 2024-11-27 * test(developer): kmcmplib compiler unit tests 5 (#12612) diff --git a/VERSION.md b/VERSION.md index 1c488bbaed..1c8a1a4ca1 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -18.0.147 \ No newline at end of file +18.0.148 \ No newline at end of file From 3de4f997e1234153d3db5a699e2b92cafb6c1d04 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Fri, 29 Nov 2024 01:56:38 +0000 Subject: [PATCH 10/11] chore(common/web): remove MockUnicodeSet as unnecessary --- .../ldml-keyboard/test-unicodeset-parser-api.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts b/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts index 330e53c7c8..4f85a39cb3 100644 --- a/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts +++ b/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts @@ -1,7 +1,7 @@ /* * Keyman is copyright (C) SIL Global. MIT License. * - * Created by Dr Mark C. Sinclair on 2024-11-28 + * Created by Dr Mark C. Sinclair on 2024-11-29 * * Test code for unicodeset-parser-api.ts */ @@ -10,22 +10,14 @@ import 'mocha'; import { assert } from 'chai'; import { UnicodeSet } from '../../src/ldml-keyboard/unicodeset-parser-api.js'; -class MockUnicodeSet extends UnicodeSet { - constructor(public pattern: string, public ranges: number[][]) { - super(pattern, ranges); // does nothing - this.pattern = pattern; - this.ranges = ranges; - } -} - describe('Test of Unicode-Parser-API', () => { describe('Test UnicodeSet', () => { it('can provide a correct ranges length', () => { - const unicodeSet = new MockUnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]); + const unicodeSet = new UnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]); assert.equal(unicodeSet.length, 2); }); it('can provide a correct string representation', () => { - const unicodeSet = new MockUnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]); + const unicodeSet = new UnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]); assert.deepEqual(unicodeSet.toString(), "[ħa-z]"); }); }); From eccc7edeba33f85c5cc3c8d7663ca5a0c3d97266 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Fri, 29 Nov 2024 03:30:08 +0000 Subject: [PATCH 11/11] chore(common/web): add blank line at end of file --- .../web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts b/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts index 4f85a39cb3..cc36e78ae2 100644 --- a/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts +++ b/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts @@ -21,4 +21,4 @@ describe('Test of Unicode-Parser-API', () => { assert.deepEqual(unicodeSet.toString(), "[ħa-z]"); }); }); -}); \ No newline at end of file +});