Use `builder_launch` to launch other builder scripts rather than calling
directly, so that inheritable state and options are passed through.
Test-bot: skip
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
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
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
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
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
`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
- 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
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
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
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.
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.
- 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
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.
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.
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
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
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
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`.
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).