Repository navigation
fix: load sibling modules without the debug library - #12
Merged
Merged
Conversation
q2 has no debug library, so every module that loads a sibling failed to load there, and an extension that used one stopped with a shortcode script error. Without debug, load_sibling now passes the bare name to require, which q2 resolves in the directory of the module being loaded. quarto-cli keeps the absolute path, because a bare require('string') there returns the standard library.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The six modules that load a sibling (
content-extraction,html,metadata,pandoc-helpers,paths,schema-check) found its path withdebug.getinfo.q2 has no
debuglibrary, so on q2 these modules failed to load, and an extension that vendors them, such as quarto-iconify, stopped with[Q-16-2] Shortcode script error.When
debug.getinfois missing,load_siblingnow passes the bare name torequire.q2's
requirelooks in the directory of the module being loaded first, sorequire('string')there loads the siblingstring.luaand not the standard library.quarto-cli keeps the absolute path, because a bare
require('string')there does return the standard library.A new test vendors the modules into a shortcode extension under a path with a space, renders it with
quartoandq2, and callshtml.raw_header, which needs the real siblingstring.lua.The test workflow now installs q2 v0.34.0 for it.
I also rendered quarto-iconify with these modules on q2 0.34.0: the icon renders, where the released modules give the shortcode error.
Locally,
quarto pandoc lua tests/run.luapasses with 214 checks and 0 failures, with q2 0.34.0 on the path.