Commit graph

60 commits

Author SHA1 Message Date
Marc Durdin
5f88bbf50c fix(developer): kmc-kmn would abort build on warnings
Fixes #8615.

The msgproc was never being located as we were missing the UTF8ToString
wrapper for the context.

This also ensures error message codes are emitted in hexadecimal, and
that the return value from the msgproc callback is 1, meaning 'continue
build'.
2023-04-18 13:04:59 +07:00
Marc Durdin
e31ad60d3c chore(developer): Further AddWarning and SetError cleanup
* Splits compiler interface functions that return bool into
  CompilerInterfaces.cpp, and moves `SetError` define to that unit so
  it can't be used accidentally elsewhere
* Audit of `AddWarning` calls and only those that are used in bool
  functions now `return FALSE` (with new `AddWarningBool`) whereas all
  others `return CERR_Break`
2023-04-10 16:04:46 +07:00
Marc Durdin
5e761f56eb chore(developer): add basic unit test for kmcmplib apis 2023-04-10 15:24:03 +07:00
Marc Durdin
732c0e4786 chore(developer): -d flag should not be overridden in build.sh 2023-04-10 15:23:43 +07:00
Marc Durdin
59b981880f chore(developer): cleanup SetError and return types for public apis in kmcmplib 2023-04-10 15:23:17 +07:00
Marc Durdin
f5c055e619 chore(developer): move cassert ref to filesystem.cpp 2023-03-28 13:10:12 +07:00
Marc Durdin
c18ef54029 refactor(common): move core baseline tests into common
Decided to use the name `baseline` for this set of tests. They can be
used by any project in the repo now. Tests will be treated as shared,
and not modified (except in the case of a buggy test).

* Moves .kmn files, add `&NAME` line (don't use meson templating for
  these files)
* Generates reference .kmx files using kmcomp for use as a baseline with
  kmcmplib (kmc) tests, and for linux tests
* Updates references in core, kmcmplib, and linux builds
* Renames all the .kmn / .kmx to use a standardized, clean name format
  (this was needed for building packages in the core tests)
2023-03-28 05:20:45 +07:00
Marc Durdin
32cea3eef2 chore(developer): fixup fail to builder_die in commands.inc.sh 2023-03-27 11:10:46 +07:00
Marc Durdin
f3f8514445 chore(developer): fix typos 2023-03-24 15:06:12 +07:00
Marc Durdin
7f9addebbb chore(developer): tweak build scripts 2023-03-23 10:14:28 +07:00
Marc Durdin
18b3133c69 feat(developer): wasm integration 2023-03-23 10:14:27 +07:00
Marc Durdin
0deb5ff245 chore(common): define BUILDER_CONFIGURATION env var 2023-03-23 10:14:26 +07:00
Marc Durdin
5b60c2efab chore(developer): final cleanup 2023-03-17 05:38:03 +07:00
Marc Durdin
2d9106f422 chore(developer): always clone keyboards repo for tests
During the configure phase for kmcmplib, we'll now always make a clone
of the keyboards repo so that we can checkout the specific commit we
want without making a mess of the user's environment. This is a little
slower (about 30 seconds to do a full local clone, a couple of minutes
for a remote clone) but a whole lot safer.

This only needs to be done in the `configure` action.

This also simplifies our scripts because we no longer need to pass any
option into meson for the keyboards repo, as we'll always know it is in
tests/keyboards.
2023-03-17 05:14:51 +07:00
Marc Durdin
9a7ebac071 chore(developer): fixup tests and build process 2023-03-17 04:31:03 +07:00
Marc Durdin
fcdd436484 chore(developer): rebuild fixtures with appropriate version of legacy compiler 2023-03-17 04:27:22 +07:00
Marc Durdin
18e102186e chore(developer): tooling to generate set of fixtures 2023-03-16 12:48:24 +07:00
Marc Durdin
920f376b64 chore(developer): fix compile errors 2023-03-10 13:23:31 +07:00
Marc Durdin
73a080a949 chore(developer): fix kmcompx compile errors
Some minor errors post-merge.
2023-03-10 13:16:25 +07:00
Marc Durdin
2ad0689090
Merge pull request #8402 from keymanapp/chore/developer/breadth-first-build
chore(developer): kmcmplib breadth-first-build 🚑
2023-03-10 09:24:55 +11:00
Marc Durdin
36c185f5f8
Merge pull request #8398 from keymanapp/chore/core/shared-meson-config
chore(core): shared meson config 🚑
2023-03-10 09:24:45 +11:00
Marc Durdin
aa9065e7df
Merge pull request #8393 from keymanapp/feat/developer/kmcmplib-wasm-support
feat(developer): adds support for compiling kmcmplib to wasm 🚑
2023-03-09 18:43:57 +11:00
Marc Durdin
fed2d18c89
Merge branch 'feature-kmcompx' into chore/developer/kmcmplib-tidy-up-filesystem-access 2023-03-09 18:43:29 +11:00
Marc Durdin
0291399d13
Merge pull request #8388 from keymanapp/fix/developer/8381-kmx-output-consistency
fix(developer): improve .kmx output consistency for cross-platform 🚑
2023-03-09 18:41:44 +11:00
Marc Durdin
583280c636
Merge pull request #8387 from keymanapp/chore/developer/cross-platform-fixups-for-wasm
chore(developer): cross-platform fixups pre-wasm build of kmcmplib 🚑
2023-03-09 18:41:25 +11:00
Marc Durdin
42e395e0be chore(developer): fix typo 2023-03-09 13:07:33 +07:00
Marc Durdin
bd768b1d0e
Merge pull request #8379 from keymanapp/refactor/developer/8082-xstring-check-for-p
chore(developer): check for *p != NULL and test for p > pStart
2023-03-09 17:00:41 +11:00
Marc Durdin
a0cb9a61be chore(developer): kmcmplib breadth-first-build 2023-03-09 12:57:20 +07:00
Marc Durdin
7a57e2aba0
Merge branch 'feature-kmcompx' into chore/developer/cross-platform-fixups-for-wasm 2023-03-09 16:29:25 +11:00
Marc Durdin
ef80f0f6b5 chore(developer): shared meson config for kmcmplib 2023-03-09 12:14:15 +07:00
Marc Durdin
6a280804b8 chore(developer): fixup build errors 2023-03-09 11:34:14 +07:00
Marc Durdin
0341f554e9
Merge pull request #8367 from keymanapp/chore/developer/kmcmplib-remove-windows.h
chore(developer): remove references to windows.h
2023-03-09 12:27:15 +11:00
Marc Durdin
98ca597320
Merge pull request #8365 from keymanapp/chore/developer/kmcmplib-api-interfaces-and-types
chore(developer): cleanup API interfaces and types for kmcmplib
2023-03-09 12:27:05 +11:00
Marc Durdin
e10606f6c1 feat(developer): adds support for compiling kmcmplib to wasm
Note: unit tests require manual build of keyboards in keyboards repo
using kmcmpdll.dll under Windows, and copying into the tests/fixtures
folder, prior to run, under non-Windows platforms.

(Later: will make it possible to build the reference keyboards using
kmcomp.exe on Windows.)
2023-03-09 07:20:50 +07:00
Marc Durdin
2ce959aee5 chore(developer): fixup header 2023-03-09 07:20:26 +07:00
Marc Durdin
ad0ce5e5b8 chore(developer): avoid symbol collision 2023-03-09 07:04:55 +07:00
Marc Durdin
5d52932e1c chore(developer): further filesystem cleanup in kmcmplib
* fixes CheckFilenameConsistency to use Windows functions on Windows,
  to check case differences, and only test for file existence on other
  platforms which are already case sensitive.
* fixes memory leaks in usage of `wstrtostr2`, and eliminated the
  function altogether.
* avoided use of u16sprintf for error messages, as it seems not to be
  working correctly (long term, eliminate altogether, use C++ string
  formatting).
* fix memory leak and overwrite of token in compiler error message.
* remove debug logging and namespace from filesystem.cpp

Unrelated to kmcmplib:
* improved logs in kmcomp tests (these tests are running on kmcmplib),
  so it is easier to diagnose failing tests.
2023-03-09 05:39:39 +07:00
SabineSIL
30f0f0b87a
Update developer/src/kmcmplib/src/xstring.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-03-08 10:54:10 +01:00
SabineSIL
66e4bde0d3
Update developer/src/kmcmplib/src/xstring.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-03-08 10:50:28 +01:00
SabineSIL
b27189fb21
Update developer/src/kmcmplib/src/xstring.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-03-08 10:49:39 +01:00
Marc Durdin
9cb58e9030 chore(developer): add filesystem.h ref 2023-03-08 15:43:10 +07:00
Marc Durdin
8277b6b38f chore(developer): tidy up kmcmplib filesystem access
Moves filesystem functionality into filesystem.cpp (it was partially
in kmx_u16.h previously), and adds cross-platform switches. This brings
us most of the way towards being able to run kmcompx under WASM and in
theory other platforms (yet to be tested).
2023-03-08 15:42:16 +07:00
Marc Durdin
3758aa261e chore(developer): remove filesystem.h ref 2023-03-08 15:41:38 +07:00
Marc Durdin
462ebb0e88
chore: remove filesystem.h ref 2023-03-08 19:40:25 +11:00
Marc Durdin
e36c0085b0 fix(developer): improve .kmx output consistency for cross-platform
This fixes two issues:

1. `COMP_KEY` structure had padding that was not always zeroed out.
   Made this explicit.

2. Rule sorting could be inconsistent when re-sorting rules that
   use `+ any() > ...`, which are expanded at compile time into multiple
   rules, and which ended up with identical sort keys due to lack of
   precision. This relates to #8381 but only adds differentiation for
   the otherwise ambiguous rule sort keys, and does not fix that issue,
   which requires further investigation.
2023-03-08 13:53:29 +07:00
Marc Durdin
e52e7731ad chore(developer): cross-platform fixups pre-wasm build of kmcmplib
This is not enough for building to WASM, but wanted to split out the
bigger changes into their own PRs. This is mostly busy-work.

One serious bug fixed:
* u16string_from_string was not converting from UTF-16 correctly

Apart from that, just tidies up a few bits and pieces in kmcmplib:
* type coercion for json-validator.cpp (probably already fixed upstream)
* cleanup of build scripts for new builder variable names
* various compatibility macros for MSVC vs clang
* safer math expressions
* file name casing in headers
* replacement of various ms-only std funcs
* removed some unused variables and consts
* tightened up search for keyboards to get only keyboards in /source/
  folders (may be possible to improve further in the future?)
2023-03-08 13:49:06 +07:00
Sabine
5ef2c42694 Merge remote-tracking branch 'origin/feature-kmcompx' into refactor/developer/8086-common-includes 2023-03-07 16:27:25 +01:00
Sabine
2b19fecce5 chore(developer): use \n as line endings (instead of \r\n) 2023-03-07 16:08:02 +01:00
Sabine
349d970a39 chore(developer): undo previous change in Readline 2023-03-07 16:08:02 +01:00
Sabine
9426204e87 chore(developer): check for *p != NULL and test for p > pStart 2023-03-07 15:57:35 +01:00