On Mon, Nov 07, 2022 at 09:20:24PM +0100, Jean Abou Samra wrote:
> Le 07/11/2022 à 20:59, Vít Novotný a écrit :
> > Furthermore, the error message indicates that this issue might related
> > to Ghostscript rather than Lilypond.
>
> It does not. The message is
>
> 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'
>
> The warning (g_spawn_sync blabla) is emitted by LilyPond
> due to an error in GhostScript. The second line, the fatal
> error, is also emitted by LilyPond and has absolutely nothing
> to do with GhostScript.

If Ghostscript is supposed to create `document-tmp-2786319.384671.pdf`
and fails, then Lilypond's `rename()` will naturally also fail, because
`document-tmp-2786319.384671.pdf` does not exist. Therefore, even though
the final error message originates from Lilypond, the primary source of
the issue would be Ghostscript.

It would be neat if Lilypond could check the exit code of Ghostscript
and fail earlier, but that seems difficult to do if you are sticking to
ANSI C with its `system()` call that is quite oblivious to exit codes
and the like.

Best,
Vit

Attachment: signature.asc
Description: PGP signature

Reply via email to