Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fontloader/runtime/fontloader-basics-gen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ do
end

if not writable then
logs.report("system","no writeable cache path, quiting")
logs.report("system","no writeable cache path, quiting. Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug.org/texinfohtml/kpathsea.html#Safe-filenames")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not a luaotfload developer, so feel free to ignore any of my comments here)

I don't think that logs.report wraps its output (assuming that it behaves like the version from ConTeXt), so it might be better to add the hint to a separate line:

Suggested change
logs.report("system","no writeable cache path, quiting. Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug.org/texinfohtml/kpathsea.html#Safe-filenames")
logs.report("system","no writeable cache path, quiting")
logs.report("system","Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug.org/texinfohtml/kpathsea.html#Safe-filenames")

In general though, adding a hint to this error message seems like a really good idea to me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to be able to do this, but because of

do
local saved_reporter = texio.reporter
local saved_exit = os.exit
local errmsg
function texio.reporter(msg, ...)
errmsg = msg
end
function os.exit()
error(errmsg)
end
load_fontloader_module "basics-gen"
texio.reporter = saved_reporter
os.exit = saved_exit
end
only the last log is reported.

(I'm not a lua dev, so could easily be missing something here)

Trying to embed a newline in the string also makes the reporting a bit odd wrt indentation.

luaotfload | load : FATAL ERROR
luaotfload | load :   × Failed to load "fontloader" module "basics-gen".
luaotfload | load :   × Error message:
luaotfload | load :     × "./luaotfload-init.lua:301: system : no writeable cache path, quiting.\
Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug.org/texinfohtml/kpathsea.html#Safe-filenames".

...

./luaotfload-init.lua:301: system : no writeable cach
e path, quiting.
Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug.org/texinfohtml/
kpathsea.html#Safe-filenames

whereas just one long string gives

luaotfload | load : FATAL ERROR
luaotfload | load :   × Failed to load "fontloader" module "basics-gen".
luaotfload | load :   × Error message:
luaotfload | load :     × "./luaotfload-init.lua:301: system : no writeable cache path, quiting. Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug.org/texinfohtml/kpathsea.html#Safe-filenames".

...

./luaotfload-init.lua:301: system : no writeable cach
e path, quiting. Try setting TEXMFCACHE or TEXMFVAR and reading https://www.tug
.org/texinfohtml/kpathsea.html#Safe-filenames

I'm not particularly happy with either option here. Hopefully a maintainer can suggest a non-invasive change with nicer output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either option is fine really. Currently the output looks weird but that shouldn't be worked around here but fixed in the output printer.

I think doing multiple calls to texio.reporter is the cleanest option for now.

os.exit()
elseif #readables == 0 then
logs.report("system","no readable cache path, quiting")
Expand Down