ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Lua in Ctx: "require()" fails?
@ 2012-10-04 10:09 Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-04 11:27 ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-04 10:09 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 2943 bytes --]

Hello,

I just renewed ConTeXt and new error when using "require" appears (it worked OK until the update):

---- t-Req.mkiv
\startluacode
   require "Test-U"
\stopluacode

\starttext
   A
\stoptext
----

"
mtx-context     | run 1: luatex --fmt="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/cont-en" --interaction="nonstopmode" --jobname="t-Req" --lua="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/cont-en.lui" --no-parse-first-line --c:FILE="t-Req.mkiv" --c:currentrun=1 --c:fulljobname="C:/Lukas/ConTeXt/Test/t-Req.mkiv" --c:halt-on-error --c:input="C:/Lukas/ConTeXt/Test/t-Req.mkiv" --c:kindofrun=1 --c:mode="t-Req" --c:nonstopm
ode "cont-yes.mkiv"
This is LuaTeX, Version beta-0.70.2-2012092822 (TeX Live 2012/W32TeX)
  \write18 enabled.
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2012.10.02 22:03 MKIV  fmt: 2012.10.4  int: english/english

system          > cont-new.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
fonts           > latin modern fonts are not preloaded
languages       > language en is active
(C:/Lukas/ConTeXt/Test/t-Req.mkiv
! LuaTeX error <main ctx instance>:2: module 'Test-U' not found:
         no field package.preload['Test-U']
         no file 'Test-U.dll'
         no file 'c:\Program Files\Lua\5.1\clibs\Test-U.dll'
         no file 'C:\Lukas\Lua\Test-U.dll'
stack traceback:
         [C]: in function 'require'
         <main ctx instance>:2: in main chunk.

system          > tex > error on line 3 in file C:/Lukas/ConTeXt/Test/t-Req.mkiv: LuaTeX error  ...

1     \startluacode
2       require "Test-U"
3 >>  \stopluacode
4
5     \starttext
6       A
7     \stoptext
8

} require "Test-U".erocount {

\luat_start_lua_code_indeed ...ua \zerocount {#1}}

l.3 \stopluacode
...
"

---- Test-U.lua
print("This is Test-U.")
----

The "Test-U.lua is located at:

c:\Lukas\Lua\Test-U.lua

And (some) environment variables are:

"
C:\Lukas\ConTeXt\Test>set lua
LUA_CPATH=?.dll;c:\Program Files\Lua\5.1\clibs\?.dll;C:\Lukas\Lua\?.dll
LUA_DEV=C:\Program Files\Lua\5.1
LUA_PATH=?.lua;C:\Program Files\Lua\5.1\lua\?.luac;C:\Lukas\Lua\?.lua;C:\Lukas\Common\Statics\?.lua;C:\Lukas\Lua\3rdParty\?.lua;C:\Lukas\Lua\3rdParty\stdlib\modules\?.lua
"

- So the "Test-U.lua" should be found.

So what's wrong? What's been renewed in this matter? How to "require" a Lua file (module) correctly?

Personally - I've been using "require <file-name>" so far at many places and there was no problem with it.

TIA.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: Test-U.lua --]
[-- Type: application/octet-stream, Size: 26 bytes --]

print("This is Test-U.")

[-- Attachment #3: t-Req.log --]
[-- Type: application/octet-stream, Size: 12695 bytes --]

(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2012.10.02 22:03 MKIV  fmt: 2012.10.4  int: english/english

system          > cont-new.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
fonts           > latin modern fonts are not preloaded
languages       > language en is active
(C:/Lukas/ConTeXt/Test/t-Req.mkiv
! LuaTeX error <main ctx instance>:2: module 'Test-U' not found:
	no field package.preload['Test-U']
	no file 'Test-U.dll'
	no file 'c:\Program Files\Lua\5.1\clibs\Test-U.dll'
	no file 'C:\Lukas\Lua\Test-U.dll'
stack traceback:
	[C]: in function 'require'
	<main ctx instance>:2: in main chunk.

system          > tex > error on line 3 in file C:/Lukas/ConTeXt/Test/t-Req.mkiv: LuaTeX error  ...

1     \startluacode
2       require "Test-U"
3 >>  \stopluacode
4     
5     \starttext
6       A
7     \stoptext
8     

<inserted text> ...erocount {\r  require "Test-U"\r}
                                                  
\luat_start_lua_code_indeed ...ua \zerocount {#1}}
                                                  
l.3 \stopluacode
                
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.

{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts           > preloading latin modern fonts (second stage)
fonts           > typescripts > unknown: library 'loc'
{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts           > virtual math > unable to resolve name mapsfromchar
fonts           > fallback modern rm 12pt is loaded

% begin of command line arguments
%
% halt-on-error        = true
% script               = true
% no-parse-first-line  = true
% nonstopmode          = true
% kindofrun            = 1
% fulljobname          = C:/Lukas/ConTeXt/Test/t-Req.mkiv
% input                = C:/Lukas/ConTeXt/Test/t-Req.mkiv
% FILE                 = t-Req.mkiv
% mode                 = t-Req
% currentrun           = 1
%
% end of command line arguments

% begin of command line files
%
% 1  C:/Lukas/ConTeXt/Test/t-Req.mkiv
%
% end of command line files

backend         > xmp > using file 'c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1
 ) )<c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf>

system          > files > start used files

used files      >    1: filename=cont-yes.mkiv | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv | usedmethod=otherwise
used files      >    2: filename=cont-new.mkiv | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv | usedmethod=otherwise
used files      >    3: filename=lang-us.lua | filetype=lua | foundname=c:/ConTeXt/tex/texmf-context/tex/context/patterns/lang-us.lua | usedmethod=otherwise
used files      >    4: filename=C:/Lukas/ConTeXt/Test/t-Req.mkiv | foundname=C:/Lukas/ConTeXt/Test/t-Req.mkiv | usedmethod=direct
used files      >    5: filename=mkiv-base.map | filetype=map | format=map | foundname=c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map | usedmethod=otherwise
used files      >    6: filename=lm.lfg | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/fonts/lm.lfg | usedmethod=otherwise
used files      >    7: filename=lm-math.lfg | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/fonts/lm-math.lfg | usedmethod=otherwise
used files      >    8: filename=lm-math.map | filetype=map | format=map | foundname=c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map | usedmethod=otherwise
used files      >    9: filename=lm-rm.map | filetype=map | format=map | foundname=c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map | usedmethod=otherwise
used files      >   10: filename=lmroman12-regular | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf | usedmethod=otherwise
used files      >   11: filename=lmroman7-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman7-regular.otf | usedmethod=otherwise
used files      >   12: filename=rm-lmr7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/rm-lmr7.tfm | usedmethod=otherwise
used files      >   13: filename=lmmi7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmi7.tfm | usedmethod=otherwise
used files      >   14: filename=lmsy7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmsy7.tfm | usedmethod=otherwise
used files      >   15: filename=lmex10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmex10.tfm | usedmethod=otherwise
used files      >   16: filename=msam7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msam7.tfm | usedmethod=otherwise
used files      >   17: filename=msbm7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msbm7.tfm | usedmethod=otherwise
used files      >   18: filename=stmary10.afm | filetype=afm | format=afm | foundname=c:/ConTeXt/tex/texmf/fonts/afm/public/stmaryrd/stmary10.afm | usedmethod=otherwise
used files      >   19: filename=stmary10.pfb | filetype=pfb | format=pfb | foundname=c:/ConTeXt/tex/texmf/fonts/type1/public/stmaryrd/stmary10.pfb | usedmethod=otherwise
used files      >   20: filename=lmroman7-bold.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman7-bold.otf | usedmethod=otherwise
used files      >   21: filename=lmmib7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmib7.tfm | usedmethod=otherwise
used files      >   22: filename=lmsans8-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmsans8-regular.otf | usedmethod=otherwise
used files      >   23: filename=lmmono8-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmmono8-regular.otf | usedmethod=otherwise
used files      >   24: filename=eufm7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufm7.tfm | usedmethod=otherwise
used files      >   25: filename=eufb7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufb7.tfm | usedmethod=otherwise
used files      >   26: filename=lmroman9-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman9-regular.otf | usedmethod=otherwise
used files      >   27: filename=rm-lmr9.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/rm-lmr9.tfm | usedmethod=otherwise
used files      >   28: filename=lmmi9.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmi9.tfm | usedmethod=otherwise
used files      >   29: filename=lmsy9.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmsy9.tfm | usedmethod=otherwise
used files      >   30: filename=msam10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msam10.tfm | usedmethod=otherwise
used files      >   31: filename=msbm10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msbm10.tfm | usedmethod=otherwise
used files      >   32: filename=lmroman9-bold.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman9-bold.otf | usedmethod=otherwise
used files      >   33: filename=lmmib10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmib10.tfm | usedmethod=otherwise
used files      >   34: filename=lmsans9-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmsans9-regular.otf | usedmethod=otherwise
used files      >   35: filename=lmmono9-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmmono9-regular.otf | usedmethod=otherwise
used files      >   36: filename=eufm10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufm10.tfm | usedmethod=otherwise
used files      >   37: filename=eufb10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufb10.tfm | usedmethod=otherwise
used files      >   38: filename=lmroman12-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf | usedmethod=otherwise
used files      >   39: filename=rm-lmr12.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/rm-lmr12.tfm | usedmethod=otherwise
used files      >   40: filename=lmmi12.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmi12.tfm | usedmethod=otherwise
used files      >   41: filename=lmsy10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmsy10.tfm | usedmethod=otherwise
used files      >   42: filename=lmroman12-bold.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-bold.otf | usedmethod=otherwise
used files      >   43: filename=lmsans12-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmsans12-regular.otf | usedmethod=otherwise
used files      >   44: filename=lmmono12-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmmono12-regular.otf | usedmethod=otherwise
used files      >   45: filename=lpdf-pdx.xml | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml | usedmethod=otherwise

system          > files > stop used files


system          > structure > start used structure

used structure  > text: t-Req

system          > structure > stop used structure


mkiv lua stats  > used config file          - selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path           - c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver         - loadtime 0.016 seconds, 2 scans with scantime 0.016 seconds, 0 shared scans, 45 found files, scanned paths: C:/Lukas/ConTeXt/Fonts c:/windows/fonts
mkiv lua stats  > stored bytecode data      - 312 modules (0.171 sec), 66 tables (0.000 sec), 378 chunks (0.171 sec)
mkiv lua stats  > cleaned up reserved nodes - 41 nodes, 9 lists of 441
mkiv lua stats  > node memory usage         - 2 glue, 2 penalty, 9 attribute, 30 glue_spec, 3 attribute_list
mkiv lua stats  > node list callback tasks  - 6 unique task lists, 5 instances (re)created, 39 calls
mkiv lua stats  > used backend              - pdf (backend for directly generating pdf output)
mkiv lua stats  > loaded patterns           - en::2
mkiv lua stats  > jobdata time              - 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks                 - 192 direct, 198 indirect, 390 total
mkiv lua stats  > lxml preparation time     - 0.000 seconds, 0 nodes, 11 lpath calls, 0 cached calls
mkiv lua stats  > result saved in file      - t-Req.pdf, compresslevel 3, objectcompreslevel 3
mkiv lua stats  > loaded fonts              - 33 files: stmary10.afm lmmono12-regular.otf lmmono8-regular.otf lmmono9-regular.otf lmroman12-bold.otf lmroman12-regular.otf lmroman7-bold.otf lmroman7-regular.otf lmroman9-bold.otf lmroman9-regular.otf lmsans12-regular.otf lmsans8-regular.otf lmsans9-regular.otf eufb10.tfm eufb7.tfm eufm10.tfm eufm7.tfm msam10.tfm msam7.tfm msbm10.tfm msbm7.tfm lmex10.tfm lmmi12.tfm lmmi7.tfm lmmi9.tfm lmmib10.tfm lmmib7.tfm lmsy10.tfm lmsy7.tfm lmsy9.tfm rm-lmr12.tfm rm-lmr7.tfm rm-lmr9.tfm
mkiv lua stats  > fonts load time           - 0.500 seconds 
mkiv lua stats  > running on path           - C:/Lukas/ConTeXt/Test
mkiv lua stats  > job file properties       - jobname: C:/Lukas/ConTeXt/Test/t-Req.mkiv, input: C:/Lukas/ConTeXt/Test/t-Req.mkiv, suffix: mkiv
mkiv lua stats  > luatex banner             - this is luatex, version beta-0.70.2-2012092822 (tex live 2012/w32tex)
mkiv lua stats  > control sequences         - 35705 of 65536 + 100000
mkiv lua stats  > current memory usage      - 31 MB (ctx: 31 MB)
mkiv lua stats  > runtime                   - 1.047 seconds, 1 processed pages, 1 shipped pages, 0.955 pages/second


[-- Attachment #4: t-Req.mkiv --]
[-- Type: application/octet-stream, Size: 79 bytes --]

\startluacode
  require "Test-U"
\stopluacode

\starttext
  A
\stoptext

[-- Attachment #5: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lua in Ctx: "require()" fails?
  2012-10-04 10:09 Lua in Ctx: "require()" fails? Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-04 11:27 ` Hans Hagen
  2012-10-04 11:32   ` Hans Hagen
  2012-10-04 12:51   ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 2 replies; 17+ messages in thread
From: Hans Hagen @ 2012-10-04 11:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4-10-2012 12:09, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> Personally - I've been using "require <file-name>" so far at many places
> and there was no problem with it.

try with

\enabletrackers[resolvers.libraries]



-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-04 11:27 ` Hans Hagen
@ 2012-10-04 11:32   ` Hans Hagen
  2012-10-05  6:13     ` Lua in Ctx: "require()" fails? (solved) Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-04 12:51   ` Procházka Lukáš Ing. - Pontex s. r. o.
  1 sibling, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2012-10-04 11:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4-10-2012 13:27, Hans Hagen wrote:
> On 4-10-2012 12:09, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>
>> Personally - I've been using "require <file-name>" so far at many places
>> and there was no problem with it.
>
> try with
>
> \enabletrackers[resolvers.libraries]

btw, you should adapt LUAINPUTS and not some other environment variable 
.. after all, luatex is not native lua so you need to avoid conflicts in 
case you hav einstalled both

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-04 11:27 ` Hans Hagen
  2012-10-04 11:32   ` Hans Hagen
@ 2012-10-04 12:51   ` Procházka Lukáš Ing. - Pontex s. r. o.
  1 sibling, 0 replies; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-04 12:51 UTC (permalink / raw)
  To: ConTeXt

On Thu, 04 Oct 2012 13:27:40 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> On 4-10-2012 12:09, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>
>> Personally - I've been using "require <file-name>" so far at many places
>> and there was no problem with it.
>
> try with
>
> \enabletrackers[resolvers.libraries]

- OK -

----
\enabletrackers[resolvers.libraries]

\startluacode
    require "Test-U"
\stopluacode

\starttext
    A
\stoptext
----

- I'm getting:

"
C:\Lukas\ConTeXt\Test>t-Req.mkiv

C:\Lukas\ConTeXt\Test>set PATH=c:\ConTeXt\tex\texmf-mswin\bin;C:\Program Files\Windows Resource Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\PROGRA~1\COMMON~1\AUTODE~1\GIS\IMPORT~1\1.0;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Lua\5.1;C:\Program Files\Lua\5.1\clibs;C:\Lukas\..\Programs.Con\Ponton;C:\Program Files\Pandoc\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Tesseract-OCR;C:\Lukas/Bat
;C:\Lukas/../Programs.Con;;C:\PROGRA~1\COMMON~1\AUTODE~1

C:\Lukas\ConTeXt\Test>rem The lowercase "c:" if fatally necesssary!

C:\Lukas\ConTeXt\Test>set TEXMFHOME=;C:\Lukas\ConTeXt\Fonts

mtx-context     | run 1: luatex --fmt="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/cont-en" --interaction="nonstopmode" --jobname="t-Req" --lua="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/cont-en.lui" --no-parse-first-line --c:FILE="t-Req.mkiv" --c:currentrun=1 --c:fulljobname="C:/Lukas/ConTeXt/Test/t-Req.mkiv" --c:halt-on-error --c:input="C:/Lukas/ConTeXt/Test/t-Req.mkiv" --c:kindofrun=1 --c:mode="t-Req" --c:nonstopm
ode "cont-yes.mkiv"
This is LuaTeX, Version beta-0.70.2-2012092822 (TeX Live 2012/W32TeX)
   \write18 enabled.
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2012.10.02 22:03 MKIV  fmt: 2012.10.4  int: english/english

system          > cont-new.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
fonts           > latin modern fonts are not preloaded
languages       > language en is active
(C:/Lukas/ConTeXt/Test/t-Req.mkiv
resolvers       > libraries > ! locating "Test-U" as "Test-U.lua" using formats "texlua"
resolvers       > libraries > ! checking for "Test-U.lua"' using format "tex"
resolvers       > libraries > ! checking for "Test-U.lua"' using format "lua"
resolvers       > libraries > ! locating "Test-U" as "Test-U.dll" using formats "lib"
resolvers       > libraries > ! checking for "Test-U.dll"' using format "lib"
resolvers       > libraries > ! locating "Test-U" as "Test-U.lua" on "lua" paths
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "."
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "C:/Lukas/ConTeXt/Fonts"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-project"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-local"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-context"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/context/"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "/tex/plain/base/"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "/tex/generic/"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf/scripts/context/lua/"
resolvers       > libraries > ! locating "Test-U" as "Test-U.lua" on "lua" paths
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "."
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/context/lua/"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/luatex/lua/"
resolvers       > libraries > ! checking for "Test-U.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/lua/"
resolvers       > libraries > ! locating "Test-U" as "Test-U.dll" on "lib" paths
resolvers       > libraries > ! checking for "Test-U.dll" using "lib" path "."
resolvers       > libraries > ! checking for "Test-U.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/context/lua/"
resolvers       > libraries > ! checking for "Test-U.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/luatex/lua/"
resolvers       > libraries > ! checking for "Test-U.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/lua/"
resolvers       > libraries > ! locating "Test-U" using normal loader
resolvers       > libraries > ? unable to locate library "Test-U"
! LuaTeX error <main ctx instance>:2: module 'Test-U' not found:
          no field package.preload['Test-U']
          no file 'Test-U.dll'
          no file 'c:\Program Files\Lua\5.1\clibs\Test-U.dll'
          no file 'C:\Lukas\Lua\Test-U.dll'
stack traceback:
          [C]: in function 'require'
          <main ctx instance>:2: in main chunk.

system          > tex > error on line 5 in file C:/Lukas/ConTeXt/Test/t-Req.mkiv: LuaTeX error  ...

   1     \enabletrackers[resolvers.libraries]
   2
   3     \startluacode
   4       require "Test-U"
   5 >>  \stopluacode
   6
   7     \starttext
   8       A
   9     \stoptext
10

} require "Test-U".erocount {

\luat_start_lua_code_indeed ...ua \zerocount {#1}}

l.5 \stopluacode
...
"

> btw, you should adapt LUAINPUTS and not some other environment variable

OK, so what does it mean practically?

Should I define a new system variable LUAINPUTS to have similar content as LUA_PATH and LUA_CPATH are having?

Or LUAINPUTS is a (Con|Lua)TeX(t) internal variable and should be modified another way?

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails? (solved)
  2012-10-04 11:32   ` Hans Hagen
@ 2012-10-05  6:13     ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-05  6:51       ` luigi scarso
  2012-10-05  8:57       ` Hans Hagen
  0 siblings, 2 replies; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-05  6:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 04 Oct 2012 13:32:42 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> btw, you should adapt LUAINPUTS and not some other environment variable
> .. after all, luatex is not native lua so you need to avoid conflicts in
> case you hav einstalled both

... I just added

SET LUAINPUTS=%LUA_PATH%

to the batch I'm using to launch context.exe and it works.

Thanks for the answers.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails? (solved)
  2012-10-05  6:13     ` Lua in Ctx: "require()" fails? (solved) Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-05  6:51       ` luigi scarso
  2012-10-05  8:57       ` Hans Hagen
  1 sibling, 0 replies; 17+ messages in thread
From: luigi scarso @ 2012-10-05  6:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1771 bytes --]

On Fri, Oct 5, 2012 at 8:13 AM, Procházka Lukáš Ing. - Pontex s. r. o. <
LPr@pontex.cz> wrote:

> On Thu, 04 Oct 2012 13:32:42 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>
>  btw, you should adapt LUAINPUTS and not some other environment variable
>> .. after all, luatex is not native lua so you need to avoid conflicts in
>> case you hav einstalled both
>>
>
> ... I just added
>
> SET LUAINPUTS=%LUA_PATH%
>
> to the batch I'm using to launch context.exe and it works.
>
> Thanks for the answers.
>
> Best regards,
>
> Lukas
>
>
> --
> Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
> Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
> Bezová 1658
> 147 14 Praha 4
>
> Tel: +420 244 062 238
> Fax: +420 244 461 038
>
> ______________________________**______________________________**
> _______________________
> 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 <http://www.ntg.nl/mailman/listinfo/ntg-context>
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/**projects/contextrev/<http://foundry.supelec.fr/projects/contextrev/>
> wiki     : http://contextgarden.net
> ______________________________**______________________________**
> _______________________
>

For a fine and local tuning you also have the package.path and package.cpath

\starttext
package.path=\ctxlua{context(package.path)}\par
package.cpath=\ctxlua{context(package.cpath)}
\stoptext

See
http://www.lua.org/manual/5.1/manual.html

(usually I prefer to make  local changes on paths, they are more  portable
across minimals)

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 3110 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lua in Ctx: "require()" fails? (solved)
  2012-10-05  6:13     ` Lua in Ctx: "require()" fails? (solved) Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-05  6:51       ` luigi scarso
@ 2012-10-05  8:57       ` Hans Hagen
  2012-10-08 13:57         ` Procházka Lukáš Ing. - Pontex s. r. o.
  1 sibling, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2012-10-05  8:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5-10-2012 08:13, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
> On Thu, 04 Oct 2012 13:32:42 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>
>> btw, you should adapt LUAINPUTS and not some other environment variable
>> .. after all, luatex is not native lua so you need to avoid conflicts in
>> case you hav einstalled both
>
> .... I just added
>
> SET LUAINPUTS=%LUA_PATH%
>
> to the batch I'm using to launch context.exe and it works.

You can best set that in a local texmfcnf.lua file. In that case you use 
the original definition of luainputs and append lua_path to it. That way 
script in the context tree can also be found.

Hans





-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails? (solved)
  2012-10-05  8:57       ` Hans Hagen
@ 2012-10-08 13:57         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-15 18:29           ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-08 13:57 UTC (permalink / raw)
  To: ConTeXt

On Fri, 05 Oct 2012 10:57:15 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> On 5-10-2012 08:13, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>> On Thu, 04 Oct 2012 13:32:42 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>>
>>> btw, you should adapt LUAINPUTS and not some other environment variable
>>> .. after all, luatex is not native lua so you need to avoid conflicts in
>>> case you hav einstalled both
>>
>> .... I just added
>>
>> SET LUAINPUTS=%LUA_PATH%
>>
>> to the batch I'm using to launch context.exe and it works.
>
> You can best set that in a local texmfcnf.lua file.

OK...

I'm not familiar with (Lua)TeX deeply enough to know how exactly to do it, so a couple a questions:

- Where to put (my personal) texmfcnf.lua?

    The intention is Ctx to find and load its original texmfcnf.lua and then to load my texmfcnf.lua which would modify only some elements (namely: the LUAINPUTS member).

    I'd like to keep "factory" texmfcnf.lua settings as much as possible.

- When I look into "c:\ConTeXt\tex\texmf\web2c\texmfcnf.lua", I see many paths:

    - beginning with "!!",
    - ending with "//".

    What does mean this convention?

- I found 2 config files:

    c:\ConTeXt\tex\texmf\web2c\texmf.cnf
    c:\ConTeXt\tex\texmf\web2c\texmfcnf.lua

    It seems that the latter is a "Luaed" form of the former.

    How are used both files?

    Is the latter built from the former or vice versa?

    Or the former is no more used and I'm having it among Ctx files by chance?


(Or a link to a place where to learn more would be appreciated.)

TIA.

Best regards,

Lukas


> In that case you use
> the original definition of luainputs and append lua_path to it. That way
> script in the context tree can also be found.
>
> Hans


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails? (solved)
  2012-10-08 13:57         ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-15 18:29           ` Hans Hagen
  2012-10-23 14:14             ` Lua in Ctx: "require()" fails? Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2012-10-15 18:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 8-10-2012 15:57, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

>     The intention is Ctx to find and load its original texmfcnf.lua and
> then to load my texmfcnf.lua which would modify only some elements
> (namely: the LUAINPUTS member).

texmf-local\web2c

>     I'd like to keep "factory" texmfcnf.lua settings as much as possible.
>
> - When I look into "c:\ConTeXt\tex\texmf\web2c\texmfcnf.lua", I see many
> paths:
>
>     - beginning with "!!",
>     - ending with "//".
 >
>     What does mean this convention?

this controls the filedatabase building and recurssion into subtrees

  > - I found 2 config files:
>
>     c:\ConTeXt\tex\texmf\web2c\texmf.cnf
>     c:\ConTeXt\tex\texmf\web2c\texmfcnf.lua
>
>     It seems that the latter is a "Luaed" form of the former.

a bit more than that as we can have directives and such (and even have 
path tables)

>     How are used both files?

only the lua file is used

>     Is the latter built from the former or vice versa?

no, for texlive the latter is adapted a bit (few lines)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-23 14:14             ` Lua in Ctx: "require()" fails? Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-23 14:13               ` Hans Hagen
  2012-10-23 14:37                 ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2012-10-23 14:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 23-10-2012 16:14, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
> Hello,
>
> my "trick" with LUAINPUTS system variable stopped working after the
> today's Ctx update.

afaik nothing changed; best run with \enabletrackers[resolvers.libraries]

Hans


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-15 18:29           ` Hans Hagen
@ 2012-10-23 14:14             ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-23 14:13               ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-23 14:14 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

Hello,

my "trick" with LUAINPUTS system variable stopped working after the today's Ctx update.

So I'm trying again to solve the problem that

----
\startluacode
   require "LPr-U"
\stopluacode
----

doesn't load the file at "d:/Lukas/Lua/LPr-U.lua".

On Mon, 15 Oct 2012 20:29:53 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> On 8-10-2012 15:57, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>
>>     The intention is Ctx to find and load its original texmfcnf.lua and
>> then to load my texmfcnf.lua which would modify only some elements
>> (namely: the LUAINPUTS member).
>
> texmf-local\web2c
>
>>     I'd like to keep "factory" texmfcnf.lua settings as much as possible.
>
> Hans

Following Hans' advice, I created "d:/texmf-local/web2c/contextcnf.lua" with the following content:

----
return
   { LUAINPUTS = "d:/Lukas/Lua/",
   }
----

but I'm still getting error with "require".

What other steps do I have to do to make it work?

TIA.

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: contextcnf.lua --]
[-- Type: application/octet-stream, Size: 47 bytes --]

return
  { LUAINPUTS = "d:/Lukas/Lua/",
  }

[-- Attachment #3: t.mkiv --]
[-- Type: application/octet-stream, Size: 78 bytes --]

\startluacode
  require "LPr-U"
\stopluacode

\starttext
  A
\stoptext

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lua in Ctx: "require()" fails?
  2012-10-23 14:13               ` Hans Hagen
@ 2012-10-23 14:37                 ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-23 14:53                   ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-23 14:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans Hagen

[-- Attachment #1: Type: text/plain, Size: 8268 bytes --]

On Tue, 23 Oct 2012 16:13:31 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> On 23-10-2012 16:14, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>> Hello,
>>
>> my "trick" with LUAINPUTS system variable stopped working after the
>> today's Ctx update.
>
> afaik nothing changed; best run with \enabletrackers[resolvers.libraries]
>
> Hans

I attached the log (and all files).

Here's the output (trying to require "Test.lua" now, which is in "d:\Lukas\Lua\Test.lua"):

"
C:\Lukas\Jobs\HubI-ISK.DSP\SO_210\Statics.Tx>t.mkiv

C:\Lukas\Jobs\HubI-ISK.DSP\SO_210\Statics.Tx>set PATH=c:\ConTeXt\tex\texmf-mswin\bin;C:\Program Files\Windows Resource Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Autodesk Shared\;C:\PROGRA~1\COMMON~1\AUTODE~1\GIS\IMPORT~1\1.0;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Lua\5.1;C:\Program Files\Lua\5.1\clibs;C:\Lukas\..\Programs.Con\Ponton;C:\Program Files\Pandoc\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\Tes
seract-OCR;C:\Lukas/Bat;C:\Lukas/../Programs.Con;;C:\PROGRA~1\COMMON~1\AUTODE~1

C:\Lukas\Jobs\HubI-ISK.DSP\SO_210\Statics.Tx>set LUAINPUTS=;d:/Lukas/Lua/?.lua

mtx-context     | run 1: luatex --fmt="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/cont-en" --interaction="nonstopmode" --jobname="t" --lua="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/cont-en.lui" --no-parse-first-line --c:FILE="t.mkiv" --c:currentrun=1 --c:fulljobname="C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv" --c:halt-on-error --c:input="C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv" --c:kindofrun=1
  --c:mode="t" --c:nonstopmode "cont-yes.mkiv"
This is LuaTeX, Version beta-0.70.2-2012101522 (TeX Live 2012/W32TeX)
  \write18 enabled.
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2012.10.22 23:51 MKIV  fmt: 2012.10.23  int: english/english

system          > cont-new.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
system          > files > jobname: t, input: C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv, result: t
fonts           > latin modern fonts are not preloaded
languages       > language en is active
(C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv
resolvers       > libraries > ! locating "Test" as "Test.lua" using formats "texlua"
resolvers       > libraries > ! checking for "Test.lua"' using format "tex"
resolvers       > libraries > ! checking for "Test.lua"' using format "lua"
resolvers       > libraries > ! locating "Test" as "Test.dll" using formats "lib"
resolvers       > libraries > ! checking for "Test.dll"' using format "lib"
resolvers       > libraries > ! locating "Test" as "Test.lua" on "lua" paths
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "."
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "C:/Documents and Settings/LPR/texmf/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-project/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-local/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-context/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "C:/Documents and Settings/LPR/texmf/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-project/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-local/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-context/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "C:/Documents and Settings/LPR/texmf/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-project/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-local/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-context/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "d:/Lukas/Lua/?.lua"
resolvers       > libraries > ! locating "Test" as "Test.lua" on "lua" paths
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "."
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/context/lua/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/luatex/lua/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/lua/"
resolvers       > libraries > ! locating "Test" as "Test.dll" on "lib" paths
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "."
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/context/lua/"
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/luatex/lua/"
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/lua/"
resolvers       > libraries > ! locating "Test" using normal loader
resolvers       > libraries > ? unable to locate library "Test"
! LuaTeX error <main ctx instance>:2: module 'Test' not found:
         no field package.preload['Test']
         no file 'Test.dll'
         no file 'c:\Program Files\Lua\5.1\clibs\Test.dll'
         no file 'C:\Lukas\Lua\Test.dll'
stack traceback:
         [C]: in function 'require'
         <main ctx instance>:2: in main chunk.

system          > tex > error on line 5 in file C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv: LuaTeX error  ...

  1     \enabletrackers[resolvers.libraries]
  2
  3     \startluacode
  4       require "Test"
  5 >>  \stopluacode
  6
  7     \starttext
  8       A
  9     \stoptext
10

} require "Test"...\zerocount {

\luat_start_lua_code_indeed ...ua \zerocount {#1}}
"


Weird that there is line:

"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "d:/Lukas/Lua/?.lua"
"

in the output log but "d:\Lukas\Lua\Test.lua" is not found here (?!).

So - ?

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: Test.lua --]
[-- Type: application/octet-stream, Size: 30 bytes --]

print("This is 'Test.lua'.")

[-- Attachment #3: t.log --]
[-- Type: application/octet-stream, Size: 17290 bytes --]

(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2012.10.22 23:51 MKIV  fmt: 2012.10.23  int: english/english

system          > cont-new.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
system          > files > jobname: t, input: C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv, result: t
fonts           > latin modern fonts are not preloaded
languages       > language en is active
(C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv
resolvers       > libraries > ! locating "Test" as "Test.lua" using formats "texlua"
resolvers       > libraries > ! checking for "Test.lua"' using format "tex"
resolvers       > libraries > ! checking for "Test.lua"' using format "lua"
resolvers       > libraries > ! locating "Test" as "Test.dll" using formats "lib"
resolvers       > libraries > ! checking for "Test.dll"' using format "lib"
resolvers       > libraries > ! locating "Test" as "Test.lua" on "lua" paths
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "."
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "C:/Documents and Settings/LPR/texmf/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-project/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-local/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-context/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/context/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "C:/Documents and Settings/LPR/texmf/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-project/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-local/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-context/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/plain/base/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "C:/Documents and Settings/LPR/texmf/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-project/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-fonts/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-local/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-modules/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-context/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf/tex/generic/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "d:/Lukas/Lua/?.lua"
resolvers       > libraries > ! locating "Test" as "Test.lua" on "lua" paths
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "."
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/context/lua/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/luatex/lua/"
resolvers       > libraries > ! checking for "Test.lua" using "lua" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/lua/"
resolvers       > libraries > ! locating "Test" as "Test.dll" on "lib" paths
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "."
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/context/lua/"
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/luatex/lua/"
resolvers       > libraries > ! checking for "Test.dll" using "lib" path "c:/ConTeXt/tex/texmf-mswin/bin/lib/lua/"
resolvers       > libraries > ! locating "Test" using normal loader
resolvers       > libraries > ? unable to locate library "Test"
! LuaTeX error <main ctx instance>:2: module 'Test' not found:
	no field package.preload['Test']
	no file 'Test.dll'
	no file 'c:\Program Files\Lua\5.1\clibs\Test.dll'
	no file 'C:\Lukas\Lua\Test.dll'
stack traceback:
	[C]: in function 'require'
	<main ctx instance>:2: in main chunk.

system          > tex > error on line 5 in file C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv: LuaTeX error  ...

 1     \enabletrackers[resolvers.libraries]
 2     
 3     \startluacode
 4       require "Test"
 5 >>  \stopluacode
 6     
 7     \starttext
 8       A
 9     \stoptext
10     

<inserted text> ...\zerocount {\r  require "Test"\r}
                                                  
\luat_start_lua_code_indeed ...ua \zerocount {#1}}
                                                  
l.5 \stopluacode
                
The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.

{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts           > preloading latin modern fonts (second stage)
fonts           > typescripts > unknown: library 'loc'
{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts           > virtual math > unable to resolve name mapsfromchar
fonts           > fallback modern rm 12pt is loaded

% begin of command line arguments
%
% halt-on-error        = true
% script               = true
% no-parse-first-line  = true
% nonstopmode          = true
% kindofrun            = 1
% fulljobname          = C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv
% input                = C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv
% FILE                 = t.mkiv
% mode                 = t
% currentrun           = 1
%
% end of command line arguments

% begin of command line files
%
% 1  C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv
%
% end of command line files

backend         > xmp > using file 'c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1
 ) )<c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf>

system          > files > start used files

used files      >    1: filename=cont-yes.mkiv | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv | usedmethod=database
used files      >    2: filename=cont-new.mkiv | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv | usedmethod=database
used files      >    3: filename=lang-us.lua | filetype=lua | foundname=c:/ConTeXt/tex/texmf-context/tex/context/patterns/lang-us.lua | usedmethod=otherwise
used files      >    4: filename=C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv | foundname=C:/Lukas/Jobs/HubI-ISK.DSP/SO_210/Statics.Tx/t.mkiv | usedmethod=direct
used files      >    5: filename=mkiv-base.map | filetype=map | format=map | foundname=c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map | usedmethod=database
used files      >    6: filename=lm.lfg | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/fonts/lm.lfg | usedmethod=database
used files      >    7: filename=lm-math.lfg | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/fonts/lm-math.lfg | usedmethod=database
used files      >    8: filename=lm-math.map | filetype=map | format=map | foundname=c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map | usedmethod=database
used files      >    9: filename=lm-rm.map | filetype=map | format=map | foundname=c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map | usedmethod=database
used files      >   10: filename=lmroman12-regular | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf | usedmethod=database
used files      >   11: filename=lmroman7-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman7-regular.otf | usedmethod=database
used files      >   12: filename=rm-lmr7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/rm-lmr7.tfm | usedmethod=database
used files      >   13: filename=lmmi7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmi7.tfm | usedmethod=database
used files      >   14: filename=lmsy7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmsy7.tfm | usedmethod=database
used files      >   15: filename=lmex10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmex10.tfm | usedmethod=database
used files      >   16: filename=msam7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msam7.tfm | usedmethod=database
used files      >   17: filename=msbm7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msbm7.tfm | usedmethod=database
used files      >   18: filename=stmary10.afm | filetype=afm | format=afm | foundname=c:/ConTeXt/tex/texmf/fonts/afm/public/stmaryrd/stmary10.afm | usedmethod=database
used files      >   19: filename=stmary10.pfb | filetype=pfb | format=pfb | foundname=c:/ConTeXt/tex/texmf/fonts/type1/public/stmaryrd/stmary10.pfb | usedmethod=database
used files      >   20: filename=lmroman7-bold.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman7-bold.otf | usedmethod=database
used files      >   21: filename=lmmib7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmib7.tfm | usedmethod=database
used files      >   22: filename=lmsans8-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmsans8-regular.otf | usedmethod=database
used files      >   23: filename=lmmono8-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmmono8-regular.otf | usedmethod=database
used files      >   24: filename=eufm7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufm7.tfm | usedmethod=database
used files      >   25: filename=eufb7.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufb7.tfm | usedmethod=database
used files      >   26: filename=lmroman9-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman9-regular.otf | usedmethod=database
used files      >   27: filename=rm-lmr9.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/rm-lmr9.tfm | usedmethod=database
used files      >   28: filename=lmmi9.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmi9.tfm | usedmethod=database
used files      >   29: filename=lmsy9.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmsy9.tfm | usedmethod=database
used files      >   30: filename=msam10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msam10.tfm | usedmethod=database
used files      >   31: filename=msbm10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/symbols/msbm10.tfm | usedmethod=database
used files      >   32: filename=lmroman9-bold.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman9-bold.otf | usedmethod=database
used files      >   33: filename=lmmib10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmib10.tfm | usedmethod=database
used files      >   34: filename=lmsans9-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmsans9-regular.otf | usedmethod=database
used files      >   35: filename=lmmono9-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmmono9-regular.otf | usedmethod=database
used files      >   36: filename=eufm10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufm10.tfm | usedmethod=database
used files      >   37: filename=eufb10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/amsfonts/euler/eufb10.tfm | usedmethod=database
used files      >   38: filename=lmroman12-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf | usedmethod=database
used files      >   39: filename=rm-lmr12.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/rm-lmr12.tfm | usedmethod=database
used files      >   40: filename=lmmi12.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmmi12.tfm | usedmethod=database
used files      >   41: filename=lmsy10.tfm | filetype=tfm | format=tfm | foundname=c:/ConTeXt/tex/texmf/fonts/tfm/public/lm/lmsy10.tfm | usedmethod=database
used files      >   42: filename=lmroman12-bold.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-bold.otf | usedmethod=database
used files      >   43: filename=lmsans12-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmsans12-regular.otf | usedmethod=database
used files      >   44: filename=lmmono12-regular.otf | filetype=otf | format=otf | foundname=c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmmono12-regular.otf | usedmethod=database
used files      >   45: filename=lpdf-pdx.xml | filetype=tex | foundname=c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml | usedmethod=database

system          > files > stop used files


system          > structure > start used structure

used structure  > text: t

system          > structure > stop used structure


mkiv lua stats  > used config file          - selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path           - c:/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver         - loadtime 0.094 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 45 found files, scanned paths: 
mkiv lua stats  > stored bytecode data      - 312 modules (0.250 sec), 66 tables (0.000 sec), 378 chunks (0.250 sec)
mkiv lua stats  > cleaned up reserved nodes - 41 nodes, 9 lists of 441
mkiv lua stats  > node memory usage         - 2 glue, 2 penalty, 9 attribute, 30 glue_spec, 3 attribute_list
mkiv lua stats  > node list callback tasks  - 6 unique task lists, 5 instances (re)created, 39 calls
mkiv lua stats  > used backend              - pdf (backend for directly generating pdf output)
mkiv lua stats  > loaded patterns           - en::2
mkiv lua stats  > jobdata time              - 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks                 - 189 direct, 161 indirect, 350 total
mkiv lua stats  > lxml preparation time     - 0.000 seconds, 0 nodes, 11 lpath calls, 0 cached calls
mkiv lua stats  > result saved in file      - t.pdf, compresslevel 3, objectcompreslevel 3
mkiv lua stats  > loaded fonts              - 33 files: stmary10.afm lmmono12-regular.otf lmmono8-regular.otf lmmono9-regular.otf lmroman12-bold.otf lmroman12-regular.otf lmroman7-bold.otf lmroman7-regular.otf lmroman9-bold.otf lmroman9-regular.otf lmsans12-regular.otf lmsans8-regular.otf lmsans9-regular.otf eufb10.tfm eufb7.tfm eufm10.tfm eufm7.tfm msam10.tfm msam7.tfm msbm10.tfm msbm7.tfm lmex10.tfm lmmi12.tfm lmmi7.tfm lmmi9.tfm lmmib10.tfm lmmib7.tfm lmsy10.tfm lmsy7.tfm lmsy9.tfm rm-lmr12.tfm rm-lmr7.tfm rm-lmr9.tfm
mkiv lua stats  > fonts load time           - 0.406 seconds 
mkiv lua stats  > luatex banner             - this is luatex, version beta-0.70.2-2012101522 (tex live 2012/w32tex)
mkiv lua stats  > control sequences         - 35870 of 65536 + 100000
mkiv lua stats  > current memory usage      - 30 MB (ctx: 31 MB)
mkiv lua stats  > runtime                   - 1.078 seconds, 1 processed pages, 1 shipped pages, 0.928 pages/second


[-- Attachment #4: t.mkiv --]
[-- Type: application/octet-stream, Size: 117 bytes --]

\enabletrackers[resolvers.libraries]

\startluacode
  require "Test"
\stopluacode

\starttext
  A
\stoptext

[-- Attachment #5: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Lua in Ctx: "require()" fails?
  2012-10-23 14:37                 ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-23 14:53                   ` Hans Hagen
  2012-10-23 14:58                     ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2012-10-23 14:53 UTC (permalink / raw)
  To: "Procházka Lukáš Ing. - Pontex s. r. o."
  Cc: mailing list for ConTeXt users

On 23-10-2012 16:37, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> resolvers       > libraries > ! checking for "Test.lua" using "lua" path
> "d:/Lukas/Lua/?.lua"
> "
>
> in the output log but "d:\Lukas\Lua\Test.lua" is not found here (?!).
>
> So - ?

no clue ... maybe an error in test.lua

----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-23 14:53                   ` Hans Hagen
@ 2012-10-23 14:58                     ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-23 15:28                       ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-23 14:58 UTC (permalink / raw)
  To: Hans Hagen, ConTeXt

On Tue, 23 Oct 2012 16:53:01 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> On 23-10-2012 16:37, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>
>> resolvers       > libraries > ! checking for "Test.lua" using "lua" path
>> "d:/Lukas/Lua/?.lua"
>> "
>>
>> in the output log but "d:\Lukas\Lua\Test.lua" is not found here (?!).
>>
>> So - ?
>
> no clue ... maybe an error in test.lua

... Have you seen the content of "Test.lua"? It just prints some text...

When I downgraded Ctx to the previous installed version, it works...

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-23 14:58                     ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-23 15:28                       ` Hans Hagen
  2012-10-24  9:21                         ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 17+ messages in thread
From: Hans Hagen @ 2012-10-23 15:28 UTC (permalink / raw)
  To: "Procházka Lukáš Ing. - Pontex s. r. o."; +Cc: ConTeXt

On 23-10-2012 16:58, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
> On Tue, 23 Oct 2012 16:53:01 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>
>> On 23-10-2012 16:37, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>>
>>> resolvers       > libraries > ! checking for "Test.lua" using "lua" path
>>> "d:/Lukas/Lua/?.lua"
>>> "
>>>
>>> in the output log but "d:\Lukas\Lua\Test.lua" is not found here (?!).
>>>
>>> So - ?
>>
>> no clue ... maybe an error in test.lua
>
> .... Have you seen the content of "Test.lua"? It just prints some text...
>
> When I downgraded Ctx to the previous installed version, it works...

When I make

e:\tmp\whatever.lua (current path)
e:\tmp\whatever\something.lua

And run

\starttext

     \enabletrackers[resolvers.libraries]

     \startluacode
         print("LUAINPUTS",os.getenv("LUAINPUTS"))

         require("whatever") ;
         require("something") ;
     \stopluacode

\stoptext

i get

LUAINPUTS	e:/tmp/whatever
resolvers       > libraries > ! locating "whatever" as "whatever.lua" 
using formats "texlua"
resolvers       > libraries > ! checking for "whatever.lua"' using 
format "tex"
resolvers       > libraries > ! lib "whatever.lua" located on "whatever.lua"
whatever
resolvers       > libraries > ! locating "something" as "something.lua" 
using formats "texlua"
resolvers       > libraries > ! checking for "something.lua"' using 
format "tex"
resolvers       > libraries > ! checking for "something.lua"' using 
format "lua"
resolvers       > libraries > ! lib "something.lua" located on 
"e:/tmp/whatever/something.lua"
something

so it must be something with your path spec

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-23 15:28                       ` Hans Hagen
@ 2012-10-24  9:21                         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2012-10-24 10:09                           ` Hans Hagen
  0 siblings, 1 reply; 17+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2012-10-24  9:21 UTC (permalink / raw)
  To: Hans Hagen; +Cc: ConTeXt

Hello,

> When I make
>
> e:\tmp\whatever.lua (current path)
> e:\tmp\whatever\something.lua
>
> And run
>
> \starttext
>
>      \enabletrackers[resolvers.libraries]
>
>      \startluacode
>          print("LUAINPUTS",os.getenv("LUAINPUTS"))
>
>          require("whatever") ;
>          require("something") ;
>      \stopluacode
>
> \stoptext
>
> i get
>
> LUAINPUTS	e:/tmp/whatever
> resolvers       > libraries > ! locating "whatever" as "whatever.lua"
> using formats "texlua"
> resolvers       > libraries > ! checking for "whatever.lua"' using
> format "tex"
> resolvers       > libraries > ! lib "whatever.lua" located on "whatever.lua"
> whatever
> resolvers       > libraries > ! locating "something" as "something.lua"
> using formats "texlua"
> resolvers       > libraries > ! checking for "something.lua"' using
> format "tex"
> resolvers       > libraries > ! checking for "something.lua"' using
> format "lua"
> resolvers       > libraries > ! lib "something.lua" located on
> "e:/tmp/whatever/something.lua"
> something
>
> so it must be something with your path spec

it seems that I solved the problem finally.

Normally, the LUA_PATH contains members like "D:\Lukas\Lua\?.lua", whilst LUAINPUTS has form of "e:/tmp/whatever", so there are three differences:

1) drive letter is upper-case in my case, lower case in Hans' one,
2) I'm using backslashes '\' in path description, Hans uses '/',
3) my LUAINPUTS path contains "?.lua" and "?.clua" strings, which are typical for pure Lua scripts with LUA_PATH (and "?.dll" with LUA_CPATH), whilst Hans' LUAINPUTS doesn't contain these strings.

So I started to check influence of these three differences...

It seems that #3 is fatal - "?.[c]lua" must not be a part of the path; although it's been working so far.

So - if anyone interested - I modified slightly my Ctx-initializing batch '_InitCtx.bat':

----
set PATH=c:\ConTeXt\tex\texmf-mswin\bin;%PATH%
:: The lowercase "c:" if fatally necesssary!

set LUAINPUTS=%LUAINPUTS%;%LUA_PATH%
:: >= 10/2012

set LUAINPUTS=%LUAINPUTS:?.luac=%
set LUAINPUTS=%LUAINPUTS:?.lua=%
:: >= 24.10.2012
----

It seems also that Ctx accepts both "a/b/c" and "a/b/c/" forms of LUAINPUTS members, i.e. with or without the trailing (back)slash.

Thanks, Hans, for your detailed testing - the signal "LUAINPUTS e:/tmp/whatever" directed me to the solution.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Lua in Ctx: "require()" fails?
  2012-10-24  9:21                         ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2012-10-24 10:09                           ` Hans Hagen
  0 siblings, 0 replies; 17+ messages in thread
From: Hans Hagen @ 2012-10-24 10:09 UTC (permalink / raw)
  To: "Procházka Lukáš Ing. - Pontex s. r. o."; +Cc: ConTeXt

On 24-10-2012 11:21, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> 1) drive letter is upper-case in my case, lower case in Hans' one,

should be ok

> 2) I'm using backslashes '\' in path description, Hans uses '/',

should work out ok too, windows internally accepts both but in the end 
context normalizes to / (i always use / anyway as that works on all 
platforma)

> 3) my LUAINPUTS path contains "?.lua" and "?.clua" strings, which are
> typical for pure Lua scripts with LUA_PATH (and "?.dll" with LUA_CPATH),
> whilst Hans' LUAINPUTS doesn't contain these strings.
>
> It seems that #3 is fatal - "?.[c]lua" must not be a part of the path;
> although it's been working so far.
>
> So - if anyone interested - I modified slightly my Ctx-initializing
> batch '_InitCtx.bat':

indeed, as LUAINPUTS is a path specification cf web2c/tds

> It seems also that Ctx accepts both "a/b/c" and "a/b/c/" forms of
> LUAINPUTS members, i.e. with or without the trailing (back)slash.

yes, quite some some cleanup happens deep down

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2012-10-24 10:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-04 10:09 Lua in Ctx: "require()" fails? Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-04 11:27 ` Hans Hagen
2012-10-04 11:32   ` Hans Hagen
2012-10-05  6:13     ` Lua in Ctx: "require()" fails? (solved) Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-05  6:51       ` luigi scarso
2012-10-05  8:57       ` Hans Hagen
2012-10-08 13:57         ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-15 18:29           ` Hans Hagen
2012-10-23 14:14             ` Lua in Ctx: "require()" fails? Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-23 14:13               ` Hans Hagen
2012-10-23 14:37                 ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-23 14:53                   ` Hans Hagen
2012-10-23 14:58                     ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-23 15:28                       ` Hans Hagen
2012-10-24  9:21                         ` Procházka Lukáš Ing. - Pontex s. r. o.
2012-10-24 10:09                           ` Hans Hagen
2012-10-04 12:51   ` Procházka Lukáš Ing. - Pontex s. r. o.

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).