Continuous integration can be used to prepare complex documents including sheet music. GitHub Actions is a proprietary continuous integration service that provides free plans for public projects. However, Lilypond seems to fail with GitHub Actions.
At https://github.com/witiko/lilypond-github-actions-example, I have created a minimal working example of GitHub Actions failing to compile an example Lilypond score. Here are the files from my example: ### document.ly \score { \relative c' { \time 4/4 \clef treble c4 d8 e f8 g a b | c4 b8 a g8 f e d | c8 g' e g c,8 g' e g | c,4 e c r \bar "|." } } ### .github/workflows/main.yml name: Typeset document on: push: pull_request: workflow_dispatch: env: DEBIAN_FRONTEND: noninteractive jobs: typeset-document: name: Typeset document runs-on: ubuntu-latest container: image: ubuntu:latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Install Lilypond run: | set -e apt-get -qy update apt-get -qy install --no-install-recommends lilypond - name: Typeset score run: lilypond document.ly GitHub Actions produces the following error [1] in the last step of `.github/workflows/main.yml` (the `lilypond document.ly` command): Processing `document.ly' Parsing... document.ly:1: warning: no \version statement found, please add \version "2.22.1" for future compatibility Interpreting music... Preprocessing graphical objects... Finding the ideal number of pages... Fitting music on 1 page... Drawing systems... Converting to `document.pdf'... warning: g_spawn_sync failed (0): gs: Failed to close file descriptor for child process (Operation not permitted) fatal error: cannot rename `document-tmp-2786319.384671.pdf' to `document.pdf' Do you have any idea what could cause this? Running the following command locally compiles the example score just fine: $ docker run --rm -it -v "$PWD":/mnt -w /mnt ubuntu:latest # apt-get -qy update # apt-get -qy install --no-install-recommends lilypond # lilypond document.ly This indicates that there is some issue with GitHub Actions. Furthermore, removing `container: {image: ubuntu:latest}` from the file `.github/workflows/main.yml` also makes GitHub Actions succeed in compiling the score. [2] This indicates that the issue is specifically with the way GitHub Actions runs Docker containers. An extended discussion of this issue is available in the issue tracker of an upstream project (LyLuatex) [3], where I first reported the issue before discovering that we can reproduce the issue with just Lilypond. Some discussion also took place in the GitLab repository of Lilypond [4], but mostly I was told to ask here rather than at GitLab. I understand that due to the proprietary nature of GitHub Actions, the amount of digging is inherently limited. I am interested in whether this is a known issue with a known workaround. Furthermore, the error message indicates that this issue might related to Ghostscript rather than Lilypond. Therefore, I will also appreciate any pointers, which would allow me to make the example that demonstrates the failure tinier before I run out of time and interest and report the issue to the GitHub people. [1]: https://github.com/witiko/lilypond-github-actions-example/actions/runs/3411927906 [2]: https://github.com/witiko/lilypond-github-actions-example/actions/runs/3411907379 [3]: https://github.com/jperon/lyluatex/issues/295 [4]: https://gitlab.com/lilypond/lilypond/-/issues/6460 Best, Vit
signature.asc
Description: PGP signature
