ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Wrong Lua package loaded by 'require'
@ 2018-02-07 22:51 Przemek Wesolek
  2018-02-08  9:04 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Przemek Wesolek @ 2018-02-07 22:51 UTC (permalink / raw)
  To: ntg-context

Hi,

I have problems using PGF graph drawing with ConTeXt. The problem is
described on https://tex.stackexchange.com/questions/414102/

It all boils down to Lua trying to load wrong file. When

  require 'pgf.gd.control'

is called, ConTeXt resolvers come into play and 'lua variable format'
locates Control.lua -- note the uppercase letter here -- which cannot be
loaded (on Linux) and 'require' fails:

> sandbox         > requiring: pgf.gd.control
> resolvers       > libraries > locating, level '1', method 'already loaded', name 'pgf.gd.control'
> resolvers       > libraries > locating, level '1', method 'preload table', name 'pgf.gd.control'
> resolvers       > libraries > locating, level '1', method 'lua variable format', name 'pgf.gd.control'
> resolvers       > libraries > lua format, checking 33 paths
> resolvers       > libraries > lua format, identifying 'pgf/gd/control.lua' using format 'tex'
> resolvers       > libraries > lua format, 'pgf/gd/control.lua' found on '/opt/texlive/2017/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/Control.lua'
> resolvers       > libraries > locating, level '1', method 'lib variable format', name 'pgf.gd.control'

I suspect some part of the system (ConTeXt? kpsewhich? TeXLive?) messes
up and the resolver instead of pgf/gd/control.lua hits
pgf/gd/force/Control.lua. But I have plainly no experience in where to
look...

One more place, where I found some traces: in
texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/trees/929f6dbc83f6d3b65
dab91f1efa4aacb.lua file I have (in ["content"]["files"])

> ["control.lua"]={ "tex/generic/pgf/graphdrawing/lua/pgf/gd", "tex/generic/pgf/graphdrawing/lua/pgf/gd/force" }

as well as (in ["content"]["remap"])

> ["control.lua"]="Control.lua"

Clearly not OK.

My system is current TeXLive 2017. LuaTeX 1.0.4. ConTeXt 1.01. Ubuntu
14.04 and 16.04.

Regards,
Przemek

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Wrong Lua package loaded by 'require'
  2018-02-07 22:51 Wrong Lua package loaded by 'require' Przemek Wesolek
@ 2018-02-08  9:04 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2018-02-08  9:04 UTC (permalink / raw)
  To: ntg-context

On 2/7/2018 11:51 PM, Przemek Wesolek wrote:
> Hi,
> 
> I have problems using PGF graph drawing with ConTeXt. The problem is
> described on https://tex.stackexchange.com/questions/414102/
> 
> It all boils down to Lua trying to load wrong file. When
> 
>    require 'pgf.gd.control'
> 
> is called, ConTeXt resolvers come into play and 'lua variable format'
> locates Control.lua -- note the uppercase letter here -- which cannot be
> loaded (on Linux) and 'require' fails:

having two files with the same name looks like an error in pgf to me

Hans

>> sandbox         > requiring: pgf.gd.control
>> resolvers       > libraries > locating, level '1', method 'already loaded', name 'pgf.gd.control'
>> resolvers       > libraries > locating, level '1', method 'preload table', name 'pgf.gd.control'
>> resolvers       > libraries > locating, level '1', method 'lua variable format', name 'pgf.gd.control'
>> resolvers       > libraries > lua format, checking 33 paths
>> resolvers       > libraries > lua format, identifying 'pgf/gd/control.lua' using format 'tex'
>> resolvers       > libraries > lua format, 'pgf/gd/control.lua' found on '/opt/texlive/2017/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/Control.lua'
>> resolvers       > libraries > locating, level '1', method 'lib variable format', name 'pgf.gd.control'
> 
> I suspect some part of the system (ConTeXt? kpsewhich? TeXLive?) messes
> up and the resolver instead of pgf/gd/control.lua hits
> pgf/gd/force/Control.lua. But I have plainly no experience in where to
> look...
> 
> One more place, where I found some traces: in
> texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/trees/929f6dbc83f6d3b65
> dab91f1efa4aacb.lua file I have (in ["content"]["files"])
> 
>> ["control.lua"]={ "tex/generic/pgf/graphdrawing/lua/pgf/gd", "tex/generic/pgf/graphdrawing/lua/pgf/gd/force" }
> 
> as well as (in ["content"]["remap"])
> 
>> ["control.lua"]="Control.lua"
> 
> Clearly not OK.
context ignores cases in filenames and in fact in tds there cannot be 
two files with the same name ... keep in mind that windows is case 
insensitive ... if there are files with the same name then they normally 
are in (sub)paths that are identified by some distinctive category 
(variable)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-08  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 22:51 Wrong Lua package loaded by 'require' Przemek Wesolek
2018-02-08  9:04 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).