-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the absolute path of the generated image contains a double underscore, the image will not be found #102
Comments
(/__w/...) confusing asciidoctor-pdf, until there's a fix for https://github.com/asciidoctor/asciidoctor-pdf/issues/1888
It seems pretty clear to me what is going on. The Since Asciidoctor Mathematical replaces the text pre-substitution, it needs to protect against absolute paths which may contain formatting marks. There are two ways Asciidoctor Mathematical can do this. a) It can enclose the image macro in a passthrough macro so that it's hidden from substitutions or b) It can store the base path to the generated images in an attribute and use an attribute reference in the target. a) is probably the simplest approach, but that is up for Asciidoctor Mathematical to decide. There's nothing Asciidoctor PDF can do about this since it's not Asciidoctor PDF that's interpreting the formatting marks. It's happening inside the core processor, and it's behavior is correct given the input it is receiving. This issue belongs in Asciidoctor Mathematical, though GitHub Actions using a path with double underscores is what makes this situation arise. |
@mojavelinux thanks for the analysis. I've produced a minimal example, linked in a zip file from the issue header, which has been updated. |
@ProgramFan What I would recommend is to check whether the path to the generated image for an inline equation contains a sequence of one or more underscores. If it does, wrap the macro in |
Thanks for providing the reproducible example, @oddhack! |
NP. Our spec toolchain is fairly arcane. |
Edit: after @mojavelinux moved this issue here I produced a minimal case in the attached zipfile that doesn't require using Docker or our spec repo. Reproduce by downloading the attachment to /tmp and
The file gems.txt shows all the gems I have installed - basically everything is up to date as of posting time.
The problem seems to be sensitive to following asciidoctor markup as well as the path on which equation SVGs are being generated, e.g. removing everything after the latexmath[] directive makes the failure case go away.
TL;DR we have a pretty complex document build which I'm integrating into Github Actions. Actions extracts the repository under /__w/SYCL-Docs/SYCL-Docs/ - I don't think I can control this location - and on this path, I see lots of errors like this:
(see here: https://github.com/KhronosGroup/SYCL-Docs/pull/117/checks?check_run_id=2066711877)
This is not Docker-specific, but path-specific: running the build on a repo located under /__w/ results in the errors and putting it under a more common path like /sycl does not get errors.
The '/<em>w/' part of the error suggests that at some point in the toolchain, the '__w' may be getting interpreted as asciidoctor markup rather than as a literal pathname. I have tried replicating the error using just a regular image: directive but have not been able to, which leads me to think something about the way asciidoctor-pdf is interacting with asciidoctor-mathematical is responsible, rather than general handling of paths in image: directives.
If you need to reproduce our build to diagnose the problem, here's a recipe assuming you can run docker:
If this is too complex I can try to strip down the document markup - the problem appears to happen at the first latexmath:[] directive in the doc.
test102.zip
The text was updated successfully, but these errors were encountered: