As detailed in the https://github.com/u-fischer/luaotfload/issues/6, pgf_lookup_and_require wrongly uses resolvers.findfile to find the graph drawing libraries when used with ConTeXt. This bug surfaced when luaotfload was upgraded which now also the resolvers.findfile function.
The problem is clearly with PGF here, because resolvers.findfile is to find fonts and not arbitrary files in the TeX tree. Until this is fixed, you can override the pgf_lookup_and_require function with your own variant which does the correct thing.
\documentclass{article}
\usepackage{luacode}
\usepackage{tikz}
\usetikzlibrary{graphdrawing}
\begin{luacode*}
function pgf_lookup_and_require(name)
local sep = package.config:sub(1,1)
local function lookup(name)
local sub = name:gsub('%.',sep)
if kpse.find_file(sub, 'lua') then
require(name)
elseif kpse.find_file(sub, 'clua') then
collectgarbage('stop')
require(name)
collectgarbage('restart')
else
return false
end
return true
end
return
lookup('pgf.gd.' .. name .. '.library') or
lookup('pgf.gd.' .. name) or
lookup(name .. '.library') or
lookup(name)
end
\end{luacode*}
\usegdlibrary{trees}
\begin{document}
Hello World
\end{document}
It seems to me that the Lua code in PGF is not so well thought through as this simple function already exhibits some Lua antipatterns, such as polluting the global environment by require instead of returning a table and stopping and restarting the garbage collector, which forces a collection cycle. Also this clumsy way of determining the path separator instead of using package.config should really be avoided.
luaotfload. – Joseph Wright Sep 29 '18 at 21:14