From aca5d177bf2c2c25835c6c5cf8506a5a8ed21eb1 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sat, 25 Apr 2020 04:30:01 -0300 Subject: [PATCH 1/2] Fix macos not find gettex, msgfmt: command not found https://github.com/ankitects/anki/runs/617116053?check_suite_focus=true#step:27:1244 Compiling *.po... ./scripts/build-mo-files: line 18: msgfmt: command not found ./scripts/build-mo-files: line 18: msgmerge: command not found --- .github/workflows/checks.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 221803852..0994f4b81 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -64,6 +64,9 @@ jobs: # https://stackoverflow.com/questions/43175529/updating-make-version-4-1-on-mac echo "::set-env name=PATH::/usr/local/opt/make/libexec/gnubin:$PATH" + # https://stackoverflow.com/questions/59644349/msgmerge-on-macos-catalina + echo "::set-env name=PATH::/usr/local/opt/gettext/bin:$PATH" + - name: Configure Windows environment variables if: matrix.os == 'windows-latest' run: | @@ -213,7 +216,6 @@ jobs: run: | set -x brew install portaudio protobuf gettext ripgrep make - brew link gettext --force - name: Set up python uses: actions/setup-python@v1 From 06056236c057ba28188ab50b966d960e676e651c Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sat, 25 Apr 2020 04:31:56 -0300 Subject: [PATCH 2/2] Fixed build-mo-files not failing the build when msgmerge is not found: https://github.com/ankitects/anki/runs/617116053?check_suite_focus=true#step:27:1244 The build was not falling because when you do `(commands)` in a shell script, the `set -e` directive is not inherited. Then, either do not start a new shell or just use an if to test the error condition. --- qt/po/scripts/build-mo-files | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qt/po/scripts/build-mo-files b/qt/po/scripts/build-mo-files index 9e04f6a34..40fdd34de 100755 --- a/qt/po/scripts/build-mo-files +++ b/qt/po/scripts/build-mo-files @@ -15,7 +15,8 @@ do perl -pe "s%repo/desktop/(.*)/anki.po%$targetDir/\1/LC_MESSAGES%") outfile="$outdir/anki.mo" mkdir -p $outdir - (msgmerge -q "$file" repo/desktop/anki.pot | msgfmt - --output-file="$outfile") || ( - echo "error building $file" - ) + if ! msgmerge -q "$file" repo/desktop/anki.pot | msgfmt - --output-file="$outfile"; then + echo "error building $file"; + exit 1; + fi; done