sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.61k stars 97 forks source link

Runtime error: attempt to index field 'ast' (a nil value) #2061

Closed jodros closed 3 weeks ago

jodros commented 3 weeks ago

I can't call any command that uses SU.ast and similar, for example the \lua command, I got:

Error: runtime error: /usr/local/share/sile/classes/base.lua:496: attempt to index field 'ast' (a nil value)

alerque commented 3 weeks ago

I'm not 100% sure, but this smells like you have more than one set of SILE sources jumbled up together in the same directory and it is finding some code from old versions and mismatching it with some new bits. Did you by any chance compile and install from sources manually without doing an uninstall on the previous version(s) first?

alerque commented 3 weeks ago

For example the v0.15.x sources load the SILE.utilities (aliased as SU) from core/utilities/init.lua, but v0.14.x had the same thing at core/utilities.lua. If you for some reason had both sets of files around you might be getting the utilities module from v0.14.x loading into other code belonging to v0.15.x.

jodros commented 3 weeks ago

Damn, this makes all the sense, now how could I remove any piece of previous versions at once?

Well, I'll try to just delete everything in /usr/local/share/sile, I guess it doesn't have important files anywhere else, right?

alerque commented 3 weeks ago

If you install stuff from sources not from distro packages (I highly recommend the latter) there is no way to remove all of them no. Our build tooling does provide a make unistall that should reverse the actions of make install, but you really need to run it on the same version and ./configure options you installed with. The alternative is to just cleanup the files yourself.

Off the topy of my head (and assuming you used /usr/local as your prefix for all installs) the places I would look to nuke stuff are /usr/local/share/sile, /usr/local/lib/sile /usr/include/libtexpdf, as well ase some files in /usr/local/bin and /usr/lib. After that there are a handful of shell completion, documentation, license, and other files that you may have gotten based on your configure options, but those are much less likely to have problems and you probably just overwrite the same files on install.

jodros commented 3 weeks ago

Thank you, it solved both this problem and that one in #2053.