Commit graph

145 commits

Author SHA1 Message Date
Marc Durdin
5f6285fa87 fix(resources): block unsupported platforms from running certain scripts
If a builder script requires a specific platform, give a helpful
error message when the script is run on an unsupported platform.

Test-bot: skip
2026-01-22 12:41:26 +07:00
Marc Durdin
c3a8fdec13
Merge pull request #15257 from keymanapp/maint/resources/verify-order-of-builder_int_deps
maint(resources): verify order of builder_describe_internal_dependency
2025-12-05 07:10:37 +01:00
Marc Durdin
9335a82530 maint(core): verify that keyman_core_ldml.h is in sync
Fixes: #15254
Test-bot: skip
Build-bot: skip build:linux,mac,windows
2025-12-01 17:11:57 +01:00
Marc Durdin
94ac669ec1 maint(resources): verify order of builder_describe_internal_dependency
Test-bot: skip
2025-12-01 16:47:50 +01:00
Marc Durdin
7d6e04f9ac
Apply suggestions from code review
Build-bot: skip
2025-11-14 13:58:16 +01:00
Marc Durdin
0988a86fa4 maint(resources): improve builder_launch to allow for arbitrary parameters
Also cleans up reporting of child scripts and links the list of reserved
parameters across a few locations. Address review comments.
2025-11-14 10:44:35 +01:00
Marc Durdin
5dbc438f53 maint(resources): add builder_launch function
Use `builder_launch` to launch other builder scripts rather than calling
directly, so that inheritable state and options are passed through.

Test-bot: skip
2025-11-10 11:46:14 +01:00
Marc Durdin
c573709ee6 maint(resources): add build timing report to builder
This is enabled automatically for CI builds, and can be enabled with
`--timing` parameter otherwise. Also, adds `builder_launch`,
documentation to come.

Test-bot: skip
2025-11-10 11:03:45 +01:00
Marc Durdin
305813df0c maint(resources): ensure REPO_ROOT is fully resolved
Turns out that in some cases, REPO_ROOT had relative ../ path
components, which is not what we want. Now uses readlink to resolve
path completely.

Test-bot: skip
Build-bot: skip
2025-08-29 07:39:12 +02:00
Marc Durdin
50a03b502a maint(resources): don't fall back to 'build' action
When an unsupported action is provided to a child build, then don't fall
back to the default action 'build', because generally that is not what
we want -- we want a no-op

Fixes: #14506
Build-bot: skip:all build:common_linux,common_mac,common_windows
Test-bot: skip
2025-08-19 12:32:46 +02:00
Marc Durdin
2726050601 maint(common): rename and move node-related script functions into node.inc.sh
Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.

Fixes: #14447
2025-08-02 13:34:29 +10:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00
Eberhard Beilharz
07f6fba238
maint(common): fix standalone use of resources/builder.inc.sh
`resources/builder.inc.sh` is designed to be used on other non-builder
scripts, so not all variables can be assumed to be set. This change
fixes some "unbound variable" errors.

Test-bot: skip
2025-07-24 16:33:42 +02:00
Eberhard Beilharz
a53b5a4ab3
maint(common): address code review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-07-21 09:11:58 +02:00
Eberhard Beilharz
3b136fcec9
maint(common): consolidate functions to determine OS
- add `builder_is_windows`, `builder_is_macos` and `builder_is_linux`
  functions
- add/move `BUILDER_OS` env variable to `resources/builder.inc.sh`
- use the new functions and env variable

Fixes: #14109
Test-bot: skip
2025-07-09 18:33:09 +02:00
Marc Durdin
dde272ac27
Merge branch 'master' into feat/resources/14200-builder-ignore-unknown-for-script-integrations 2025-06-24 06:10:12 +07:00
Marc Durdin
8145c017d7 feat(resources): support ignoring unknown options in builder
Fixes: #14200
Test-bot: skip
2025-06-24 07:12:09 +10:00
Marc Durdin
156bdcdd8a maint(common): rename and move builder_if_release_build_level 2025-06-16 06:45:42 +10:00
Marc Durdin
11a558e926 maint(developer): support buildLevel
Relates-to: 14125
Build-bot: build
Test-bot: skip
2025-06-14 15:22:15 +10:00
Eberhard Beilharz
581e4e03ef chore(linux): add TC test runner
This adds a modified version of JetBrains' TeamCity test runner that
makes use of the `parent` property in the service messages and thus
allows to properly indent and fold the block that contains the test
output.

Test-bot: skip
2025-06-02 15:20:42 +02:00
Marc Durdin
e7090ff207
Merge pull request #13882 from keymanapp/maint/common/builder-error-to-stderr
maint(common): report builder errors to stderr
2025-05-14 15:57:52 +07:00
Eberhard Beilharz
7d33ff7ffa
maint(common): move build_is_ci_* functions
This change moves the `build_is_ci_*` functions from
`resources/build/build-utils-ci.inc.sh` → `resources/builder.inc.sh`.

Fixes: #13885
Test-bot: skip
2025-05-12 18:16:07 +02:00
Eberhard Beilharz
d307051836
Merge pull request #13854 from keymanapp/maint/common/versionvars
Previously the builder scripts defined a readonly `VERSION` environment variable for the Keyman version. That caused problems when another (external) script tried to define a `VERSION` variable. We encountered this problem when trying to move the TC build steps of a configuration into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.

This change uses a Keyman specific prefix for the version variables and renames `VERSION` → `KEYMAN_VERSION` etc. as well as `TIER` → `KEYMAN_TIER`. Unfortunately these variables are used in a lot of places, so this turned out to be a bit of a yak shave.
2025-05-12 08:58:19 +02:00
Eberhard Beilharz
da7c598d80
Merge pull request #13869 from keymanapp/maint/common/cifuncs 2025-05-12 08:56:56 +02:00
Marc Durdin
5b1e969c23 maint(common): report builder errors to stderr
Sometimes a builder script can be redirected internally and then error
messages are lost in the redirect if the script fails. This sidesteps
that problem by reporting errors to stderr instead of stdout.
2025-05-12 06:28:42 +02:00
Eberhard Beilharz
7f12f904eb
maint(common): address code review comments
- remove `builder_is_running_on_ci` function since there already is a
  similar `builder_is_ci_build` function
- use `GITHUB_ACTIONS` environment variable instead of `GITHUB_RUN_ID`
  to detect if we're run be GitHub Actions
2025-05-09 11:39:57 +02:00
Eberhard Beilharz
3634dd1702
maint(common): add three more functions to detect if running on CI
This adds the three additional functions `builder_is_running_on_ci`,
`builder_is_running_on_docker`, and `builder_is_running_on_gha` to be
able to detect if the build is running in a CI or CI-like container
environment.
2025-05-08 17:44:40 +02:00
Eberhard Beilharz
907a16012c
maint(common): output start/end messages if not running on TC
If we're not running on TC we should output the start/end messages as
headings unless it's a child build. This was the previous behavior
before we added support for TC blocks.
2025-05-08 17:01:00 +02:00
Eberhard Beilharz
4d81589f48
maint(common): use unique names for Keyman version variables
Previously the builder scripts defined a readonly `VERSION` environment
variable for the Keyman version. That caused problems when another
(external) script tried to define a `VERSION` variable. We encountered
this problem when trying to move the TC build steps of a configuration
into a single script (#13399) when we tried to source `~/.nvm/nvm.sh`.

This change uses a Keyman specific prefix for the version variables and
renames `VERSION` → `KEYMAN_VERSION` etc. Unfortunately these variables
are used in a lot of places, so this turned out to be a bit of a yak
shave.

Test-bot: skip
2025-05-07 18:46:51 +02:00
Joshua Horton
849014687b
Merge pull request #13827 from keymanapp/maint/common/local-builds-as-debug
maint(common): automatically set --debug option for local-environment builder-script uses
2025-05-07 10:17:59 +07:00
Joshua Horton
c389267a22
docs(common): comment removed per PR review
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-05-07 08:29:35 +07:00
Eberhard Beilharz
b83002ca85
maint(common): add builder_is_running_on_teamcity function
Addresses code review comments.

Co-authored-by: Marc Durdin <marc@durdin.net>
2025-05-06 16:26:22 +02:00
Joshua Horton
9b2d21ff2d maint(common): use booleans, not strings for is_release
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-05-06 13:58:36 +07:00
Joshua Horton
e2fe3861aa maint(common): builder_release -> is_release, other review concerns
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-05-06 13:56:02 +07:00
Eberhard Beilharz
c95cb5f0c2
maint(common): output script identifier in front of block name 2025-05-05 20:00:55 +02:00
Joshua Horton
51649bb8d3 maint(common): builder_release var should be local 2025-05-05 12:50:05 +07:00
Joshua Horton
ab9ed717aa maint(common): add --release option to force release builds in local environment
Co-authored-by: Marc Durdin <marc@durdin.net>
2025-05-05 12:48:55 +07:00
Joshua Horton
5af26297d9 maint(common): automatically set --debug option in local-environment builder scripts
Fixes: #11106
2025-05-02 15:02:04 +07:00
Eberhard Beilharz
92a903ddd8
maint(common): add support for TC blocks
This change adds support for TC blocks of service messages
(https://www.jetbrains.com/help/teamcity/service-messages.html#Blocks+of+Service+Messages)
and starts/ends a block in the `builder_start_action`/`builder_finish_action`
functions. We output the TC block service messages only if we're running
on TC, i.e. if the `TEAMCITY_GIT_PATH` environment variable is set.

Part-of:  #13399
Test-bot: skip
2025-04-30 20:39:09 +02:00
Joshua Horton
da5152f509
Merge pull request #12296 from keymanapp/feat/builder-autocomplete
feat: add builder tab-completion script
2025-01-15 11:46:41 +07:00
Joshua Horton
1ffae64dfb chore: apply suggestions from code review 2025-01-14 10:40:38 +07:00
Marc Durdin
dad1df3194 fix(developer): ensure license parameter is required and add tests
Some additional items arose from this:

* Adds a command-line-tests unit test which does some basic sanity tests
  on `kmc`.
* Cleans up some of the error reporting infrastructure in `kmc` to
  ensure that thrown errors are handled better.
* Removes redundant subshell from `builder_run_action`.

Fixes: #12846
2025-01-13 15:10:31 +07:00
Joshua Horton
7ebad957b9 fix: now autocompletes default options 2025-01-08 10:03:44 +07:00
Joshua Horton
9dfe83f3cf docs: for + suffix cleanup 2025-01-08 09:18:50 +07:00
Joshua Horton
73268f8d7f Merge branch 'master' into feat/builder-autocomplete 2025-01-08 09:15:50 +07:00
Eberhard Beilharz
3232c2a1a1
chore(common): allow to run build.sh scripts in bashdb debugger
One of the traps prevents debugging a build script in
the `bashdb` debugger. This change skips trapping `err` and `exit`
when run under a debugger and so allows to debug the script with `bashdb`.
2024-10-09 15:46:37 +02:00
Eberhard Beilharz
389fb4f9ee
chore(common): Allow to build offline
A lot of the `configure` actions rely on node dependencies and so call
`npm install`. Without a internet connection this hangs forever, even
if you had successfully installed the dependencies before and nothing
changed since then. This change adds a `--offline` parameter that passes
`--prefer-offline` to npm, which causes npm to use the cached
dependencies.

Also sets the `MESON_PACKAGE_CACHE_DIR` environment variable so that all
(sub-)projects share the same package cache dir. This will speed up regular
builds a bit (e.g. `developer/src/kmcmplib` and `core` both have `icu4c`
as a dependency), but will also help with offline builds.

`MESON_PACKAGE_CACHE_DIR` requires Meson 1.3, however older Meson
versions ignore this environment variable and simply continue to use a
cache per subproject, so will continue to work (minus offline builds).
2024-09-18 22:40:20 +02:00
Joshua A. Horton
e6fb213fa2 fix: revert unintended change outside of new func 2024-08-27 13:23:10 +07:00
Joshua A. Horton
b589aed4c0 chore: builder.inc.sh cleanup in new method 2024-08-27 13:14:57 +07:00
Joshua A. Horton
f07eba115d feat: add builder autocompletion script 2024-08-27 12:53:18 +07:00