By default Git Bash converts paths starting with `/`, so running the docker image fails with errors or files mentioning `\Program Files\Git\` (e.g. https://github.com/keymanapp/keyman/pull/14058#issuecomment-2951820833). This change adds a wrapper function that prevents the conversion and thus uses the paths in the correct form when calling docker.
Since the docker builds run on Linux they expect LF line endings. If the scripts are checked out with CRLF line endings, they look for things like `bash^M`. While there are workarounds to some degree, I didn't found a solution that would fully work with our scripts. So in the end this PR now always checks out scripts with LF line endings, even on Windows.
If you test this you'll have to re-checkout the source tree so that you end up with LF line endings.
Fixes: #14153
This fixes a bug where a keyboard didn't show up in the language dropdown if the first language it specified wasn't a normalized language tag. Previously in that case we added a custom keyboard with whatever language tag the keyboard specified. With this change we now continue to use the first language of the first keyboard but normalize it. Since the selection of the language now happens a little earlier it is slightly possible that there will be unexpected side effects that didn't show up in my testing.
Fixes: #14465
* Also renames resources/environment.sh to resources/build/mac/xcode-environment.inc.sh.
* Adds a few more exclusions to linux/scripts/dist.sh
Fixes: #14478
Test-bot: skip
Build-bot: build
When #14551 and #14552 merged, it resulted in a bug which was exposed by
the unit tests (yay!).
Follows: #14551
Follows: #14552
Build-bot: skip:all build:common_windows,common_mac,common_linux
Test-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
This fixes a bug where a keyboard didn't show up in the language dropdown
if the first language it specified wasn't a normalized language tag.
Previously in that case we added a custom keyboard with whatever language
tag the keyboard specified. With this change we now continue to use
the first language of the first keyboard but normalize it. Since the
selection of the language now happens a little earlier it is slightly
possible that there will be unexpected side effects that didn't show up
in my testing.
Fixes: #14465
This fixes a permission problem when we run docker from git bash.
On Windows we want to build as _root_ inside of the docker container.
This gives the necessary permissions due to the way the Windows user
is mapped to git bash/mingw and the docker container. On Linux
however we want to build as _build_ user inside the container so that
files we create are owned by the host user.
See https://github.com/keymanapp/keyman/pull/14154#issuecomment-2970577312
for further explanation.
On Windows files are usually checked out with CRLF line endings.
However, the Docker image is Linux and thus expects LF line endings.
This causes conflicts with the scripts and so trying to build in docker
trips over the shebang line that contains CR - see #14153.
https://stackoverflow.com/a/14610574 suggests a workaround, however that
doesn't work because it converts the script on the fly and removes CR and
then reads the script from the command line. This causes the loss of the
script name and thus causes different failures. Even with that solved
it would likely still not work because of the sourced include scripts
would still contain CRLF line endings.
The only solution seems to be to check out the script files with LF
line endings which also seems to work when building directly on Windows.
See https://blog.programster.org/fixing-docker-volume-windows-line-endings-on-bash-scripts.
Fixes: #14153
Test-bot: skip
By default Git Bash converts paths starting with `/`, so running the
docker image fails with errors or files mentioning `\Program Files\Git\`.
This change adds a wrapper function that prevents the conversion
and thus uses the paths in the correct form when calling docker.
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. In the earlier commite some changes were missing.
Fixes: #14447