spec-prod
spec-prod copied to clipboard
Fail to generate respec files with non-HTML data-include
I’m building the spec as part of a GitHub CI Action for w3c/N3 [1]. The spec references a number of files which are symlinked into the /spec directory along with /spec/index.html. It loads all of those that end in “.html”, but fails to load “/spec/n3.ebnf”. If I run respec locally (on Mac) it seems to work fine:
respec -s ["http://localhost:8000/spec/index.html"](http://localhost:8000/spec/index.html) -o /dev/null --verbose -t 20 -e
But, the GitHub action fails. I’ve tried renaming “n3.ebnf” to “n3.ebnf.txt”, but no joy.
reported by @gkellogg in https://lists.w3.org/Archives/Public/spec-prod/2022AprJun/0022.html
It successfully loaded /spec/n3.ebnf (checked generated artifact).
But I can see the files from grammar directory aren't copied to final output (they're referenced in index.html, but not copied). Is that the issue?
(I'll leave it to @gkellogg to reply - thanks a lot for already looking into this!)
Thanks @dontcallmedom. I perhaps should have just created the issue, but I thought there may have been some requirement I was unaware of.
The error comes up in the "Generate Static HTML" step that it can't fetch /spec/n3.ebnf, although it appears in the later $ ls -R
Warning: ING] Failed to fetch /spec/n3.ebnf. Some assets might be missing.
$ ls -R
.:
crypto.html
index.html
list.html
log.html
math.html
n3.ebnf
string.html
time.html
And, as I said in the email, running this locally on my Mac does not show the same error.
[w3c-N3] respec -s "http://localhost:8000/spec/index.html" -o /dev/null --verbose -t 20 -e
[INFO] [Timeout: 20000ms] Processing resource: http://localhost:8000/spec/index.html ...
[INFO] [Timeout: 19999ms] Launching browser
[INFO] [Timeout: 19571ms] Navigating to http://localhost:8000/spec/index.html
[INFO] [Timeout: 18815ms] Navigation complete.
[INFO] [Timeout: 18769ms] Using ReSpec v32.1.10
[INFO] [Timeout: 18769ms] Processing ReSpec document...
[INFO] [Timeout: 16501ms] Processed document.
[INFO] [Timeout: 15493ms] Done.
[w3c-N3] respec --version
32.1.10
The GH Action seems to be running exactly the same version of ReSpec.
The "failed to fetch" part is just a warning, you can ignore it.
spec-prod (not ReSpec) tries to recursively find all referenced resources (HTML files, markdown, images etc.) from the built spec (i.e. after ReSpec builds it) to copy them to a to-be-deployed directory.
This warning exists as spec-prod assumed the ebnf file to be HTML and tried to fetch its linked subresources (it failed here). But it still successfully copied the ebnf file.
Looking further at the CI log, it seems your build failed at the link checker step. If rightly so, I would encourage you to disable link checking entirely as it's very experimental and I haven't had the time/motivation to fix it yet.
Thanks @sidvishnoi. It would be great if it were easier to find the specific causes of errors in the GH Action output; I had missed the link-checker error, but it did find some dead URLs.
It seems that this issue really belonged against w3c/spec-prod after all.
https://github.com/w3c/spec-prod/issues/133 will be helpful there.