From 06e653917f5bae33578559c44fe3b7d7ce8848f8 Mon Sep 17 00:00:00 2001 From: Darren Kulp Date: Fri, 2 Aug 2024 14:29:35 -0700 Subject: [PATCH 1/6] Stop depending on ImageMagick v7 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e1291bdf..63f2e83c 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ check_book: book CLOBBERFILES += metrics/ metrics/%.metrics: PDF/eogsized/%.pdf | metrics @echo "[ METRICS ] $@" - magick identify -format "%P %@\n" $< > $@ + identify -format "%P %@\n" $< > $@ CLOBBERFILES += booklayout/book.tex booklayout/book.aux booklayout/book.log booklayout/book.tex: $(LYS:%.ly=metrics/%.metrics) | $(LYS:%.ly=PDF/eogsized/%.pdf) From 66314963a3880eb5524a8dab12c709062109c06b Mon Sep 17 00:00:00 2001 From: Darren Kulp Date: Fri, 2 Aug 2024 13:40:33 -0700 Subject: [PATCH 2/6] Install book-build dependencies in Docker --- docker/Dockerfile | 16 ++++++++++++++++ transforms.map | 2 ++ 2 files changed, 18 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 11e1123d..f475d83c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -31,3 +31,19 @@ RUN \ qpdf RUN apt install -y make + +# Install dependencies for book build: +RUN apt install \ + git \ + imagemagick \ + libarray-group-perl \ + libfile-slurp-perl \ + liblingua-stem-perl \ + libperl6-slurp-perl \ + libregexp-common-perl \ + libtext-trim-perl \ + -y # end of list + +# Disable a security workaround for Ghostscript: +# (see https://stackoverflow.com/a/59193253) +RUN sed -i '/PDF/{/rights=.*none/d}' /etc/ImageMagick*/policy.xml diff --git a/transforms.map b/transforms.map index e8fe19d8..c78dd976 100644 --- a/transforms.map +++ b/transforms.map @@ -273,3 +273,5 @@ what -- e’er whate’er wher -- e’er where’er won -- d’ring wondering wor -- ship -- pers worshippers +Can't locate Array/Group.pm in @INC (you may need to install the Array::Group module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/aarch64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl-base /usr/lib/aarch64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at scripts/getlyrics.pl line 7. +BEGIN failed--compilation aborted at scripts/getlyrics.pl line 7. From bdd8d4c593f246bf97452fb9db494035cb4980d9 Mon Sep 17 00:00:00 2001 From: Darren Kulp Date: Fri, 2 Aug 2024 13:58:10 -0700 Subject: [PATCH 3/6] Set wildcard for safe.directory This is a workaround for the Git capability introduced in response to CVE-2022-24765. --- .github/workflows/lilypond.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lilypond.yml b/.github/workflows/lilypond.yml index 5a88319d..7e3c4219 100644 --- a/.github/workflows/lilypond.yml +++ b/.github/workflows/lilypond.yml @@ -33,7 +33,9 @@ jobs: --env MAKEFLAGS --env VARIANTS_PDF image: my-lilydock:${{ env.LILYPOND_VERSION }} - run: make --environment-overrides pdf + run: | + git config --global --add safe.directory '*' && + make --environment-overrides pdf - uses: actions/upload-artifact@v4 with: name: pdfs From f4010ea3883d5644d721677d8bbd7b546c587972 Mon Sep 17 00:00:00 2001 From: Darren Kulp Date: Fri, 2 Aug 2024 15:01:49 -0700 Subject: [PATCH 4/6] Hoist TECTONIC variable --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 63f2e83c..389c9347 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ TOTAL_FILE_COUNT = 387 TOTAL_PAGE_COUNT = 358 # for toplevel LILYPOND ?= lilypond +TECTONIC ?= tectonic space :=# space +=# @@ -218,7 +219,7 @@ booklayout/index.meter: $(LYS:%.ly=PDF/eogsized/%.meter) %.pdf: %.tex @echo "[ LATEX ] $@" - tectonic -Zsearch-path=$(CURDIR) $< + $(TECTONIC) -Zsearch-path=$(CURDIR) $< .PHONY: FORCE booklayout/revision.tex: FORCE From 705e1c88db6d29848a4df1ee5fbac960f8ad7e97 Mon Sep 17 00:00:00 2001 From: Darren Kulp Date: Fri, 2 Aug 2024 13:33:10 -0700 Subject: [PATCH 5/6] Use setup-tectonic action --- .github/workflows/lilypond.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/lilypond.yml b/.github/workflows/lilypond.yml index 7e3c4219..d9d318f6 100644 --- a/.github/workflows/lilypond.yml +++ b/.github/workflows/lilypond.yml @@ -10,6 +10,9 @@ on: env: MAKEFLAGS: --jobs=4 LILYPOND_VERSION: 2.24.1 + # TODO Update TECTONIC_VERSION to 0.15.0 once OpenSSL 3.0 is in the Docker + # image: + TECTONIC_VERSION: 0.14.1 VARIANTS_PDF: eogsized jobs: build: @@ -24,6 +27,10 @@ jobs: file: docker/Dockerfile build-args: LILYPOND_VERSION=${{ env.LILYPOND_VERSION }} tags: my-lilydock:${{ env.LILYPOND_VERSION }} + - uses: wtfjoke/setup-tectonic@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + tectonic-version: ${{ env.TECTONIC_VERSION }} - name: Build PDFs uses: addnab/docker-run-action@v3 with: From 97a8354eba8ee7724e48abc327e8d342cdbb1b50 Mon Sep 17 00:00:00 2001 From: Darren Kulp Date: Fri, 2 Aug 2024 13:56:43 -0700 Subject: [PATCH 6/6] Build book --- .github/workflows/lilypond.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lilypond.yml b/.github/workflows/lilypond.yml index d9d318f6..467874d4 100644 --- a/.github/workflows/lilypond.yml +++ b/.github/workflows/lilypond.yml @@ -31,6 +31,7 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} tectonic-version: ${{ env.TECTONIC_VERSION }} + - run: cp -f "$(command -v tectonic)" "${{ github.workspace }}/tectonic" - name: Build PDFs uses: addnab/docker-run-action@v3 with: @@ -42,8 +43,10 @@ jobs: image: my-lilydock:${{ env.LILYPOND_VERSION }} run: | git config --global --add safe.directory '*' && - make --environment-overrides pdf + make --environment-overrides booklayout/toplevel.pdf SKIP_SPELLCHECK=1 TECTONIC=${{ github.workspace }}/tectonic - uses: actions/upload-artifact@v4 with: name: pdfs - path: PDF/*/*.pdf + path: | + PDF/*/*.pdf + booklayout/toplevel.pdf