Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SILE.documentState.paperSize not found using SILE v0.14.17 #77

Closed
pdenapo opened this issue Mar 12, 2024 · 6 comments
Closed

SILE.documentState.paperSize not found using SILE v0.14.17 #77

pdenapo opened this issue Mar 12, 2024 · 6 comments
Labels
documentation Improvements or additions to documentation not my Bug

Comments

@pdenapo
Copy link

pdenapo commented Mar 12, 2024

Trying to build the documentation in ./examples with the command

sile -u inputters.silm mybook.silm

using SILE v0.14.17 (Lua 5.3) in Ubuntu 22.04, I`ve got the following error:

=========================================================================

! Could not find file at

! Unexpected Lua error

error summary:
Processing at:

Using code at: /home/pablo/.local/share/sile/outputters/libtexpdf.lua:31: attempt to index a nil value (field 'paperSize')

Run with --traceback for more detailed trace leading up to errors.

This is caused by the line

local w, h = SILE.documentState.paperSize[1], SILE.documentState.paperSize[2]

@Omikhleia
Copy link
Owner

"A train can hide another", the error is actually "Could not find file" (and it triggers another error, on the ouputter, likely because occurring too soon).
Can you try to run with the -tas suggested? Is your m̀ybook.silm file correct?

@Omikhleia
Copy link
Owner

Omikhleia commented Mar 12, 2024

"A train can hide another", the error is actually "Could not find file" (and it triggers another error, on the ouputter, likely because occurring too soon).

Just reproduced on a pretty fresh Ubuntu setup, it occurs when the input file does not exist (= in your case, mybook.silm is likely not found?)

If it helps, here is an annotated transcript from my session (EDIT: for some reason I have Lua 5.2 on that host, not 5.3 -- the versions below need to be adapted then)

# Let's install SILE and Luarocks on this fresh host
sudo add-apt-repository ppa:sile-typesetter/sile
sudo apt-get update
sudo apt-get install sile
sudo apt install luarocks  liblua5.2-dev
# Let's install resilient and all deps (markdown etc.) for the local user
luarocks install resilient.sile --local
# Run this and also add to my .bashrc so the Lua path takes my local tree into account in next sessions too.
eval $(luarocks --lua-version 5.2 --local path)
# Clone some cool books, and compile one...
git clone [email protected]:Omikhleia/awesome-sile-books.git
cd  awesome-sile-books/
sile -u inputters.silm lovecraft/lovecraft.silm 
# One more time, to get the final table of contents and labels...
sile -u inputters.silm lovecraft/lovecraft.silm 

And lo! I got a PDF (lovecraft/lovecraft.pdf)
Erm, it is a bit ugly as-is, but now I guess I can install the missing fonts, for it to be nice ;)

@pdenapo
Copy link
Author

pdenapo commented Mar 13, 2024

Sorry my report was wrong. What I should have reported is this

After cloning your repository at

https://github.com/Omikhleia/resilient.sile.git

I have run this command for building the documentation

pablo@cleopatra:~/git-repos/resilient.sile/examples$ sile -u inputters.silm ./sile-resilient-manual.silm --traceback
SILE v0.14.17 (Lua 5.3)
<./sile-resilient-manual.silm> as silm

! Unexpected Lua error

stack traceback:
/home/pablo/.luarocks/share/lua/5.3/sile/inputters/silm.lua:435: in function 'inputters.silm.parse'
/home/pablo/.local/share/sile/inputters/base.lua:47: in function 'inputters.xml.process'
/home/pablo/.local/share/sile/core/sile.lua:345: in function 'core.sile.processString'
/home/pablo/.local/share/sile/core/sile.lua:385: in function 'core.sile.processFile'
...local/share/sile/lua_modules/share/lua/5.3/pl/tablex.lua:351: in function 'pl.tablex.imap'
/home/pablo/.local/bin/sile:56: in function </home/pablo/.local/bin/sile:55>
[C]: in function 'xpcall'
/home/pablo/.local/bin/sile:55: in main chunk
[C]: in ?

error summary:
Processing at: ./sile-resilient-manual.silm: in :
[[masterfile: 1.0␤metadata:␤ title: The re·sil·ient collection of classes & packages for SILE␤ sub]]
Using code at: /home/pablo/.luarocks/share/lua/5.3/sile/inputters/silm.lua:435: attempt to index a nil value (field 'options')

@Omikhleia
Copy link
Owner

Omikhleia commented Mar 13, 2024

Ah, I see, the error is obtained with

$ sile -u inputters.silm ./sile-resilient-manual.silm

But not with (doh!!):

$ sile -u inputters.silm sile-resilient-manual.silm

(Though you'll get other issues afterwards, due to other relative paths)

That's weird, and I would have to check and likely report to SILE... --> Something to investigate here.

(On the other hand I think (if I remember correctly) there's a fix in upcoming SILE 0.15.x for the initialization of inputters that would indirectly address the issue of their options not always been correctly initialized.)

I never noticed: I always compile the manual from the base folder (sile -u inputters.silm examples/sile-resilient-manual.silm)...
Though it does have its own chicken and eggs problems too, when having development versions installed (which is what you get by cloning the repository on the latest version) and not all dependencies on dev versions too..

Honestly, I don't recommend trying to build the manual:

  • It's not really documented (yet), and it's pending major reworks (soon)
  • Notably the prerequisites are not all indicated (one also need tooling for Graphviz, Lilypond, etc.) to have all bits of advanced stuff documented.
  • There's probably a bunch of relative path to clarify here and there.

For sample books, that's why I made the awesome-sile-books repository -- used above in my session transcript -- A curated list of book projects ;)

@Omikhleia
Copy link
Owner

(On the other hand I think (if I remember correctly) there's a fix in upcoming SILE 0.15.x for the initialization of inputters that would indirectly address the issue of their options not always been correctly initialized.)

Just checked and it is indeed fixed in SILE develop branch (= expected for next major 0.15 release).

@pdenapo
Copy link
Author

pdenapo commented Mar 14, 2024

Many thanks!

@Omikhleia Omikhleia added the documentation Improvements or additions to documentation label Mar 17, 2024
@Omikhleia Omikhleia closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation not my Bug
Projects
None yet
Development

No branches or pull requests

2 participants