Closed celtic-coder closed 1 year ago
Greetings @celtic-coder I'm afraid I cannot help much here and that it goes beyond what I can do here. I don't have a Windows 10 machine to tinker with WSL, but I once had something similar though (i.e. complaints on missing files) on a regular native Ubuntu system which had Lua 5.2 installed, but an older version of luarocks that was only looking for Lua 5.1... I think I upgraded the system and rebuilt_ luarocks by myself to get it working, though I can't recollect my exact steps... I've no idea why there was such a discrepancy in the first place.
Hi Didier (@Omikhleia),
You have put a huge amount of work into the SILE packages. I was not expecting that you would put any extra work into trying to sort out a particular WSL or Ubuntu problem. I was just hoping that you might have come across something like this in the past, and that you could share from your expertise.
In any case, it was a good learning experience for me. Both personally and professionally, my main platform has been Windows, with occasional stints on Linux. I had expectations that everything would work "out of the box", and so trying to figure out the "development" environment was useful.
Yes, there seems to be a problem involving the version of "luarocks" in combination with the default Lua installation on the vanilla Ubuntu provided on WSL. Thankfully, I didn't have to rebuild "luarocks" like you did, but I at least now have a complete installation of "markdown.sile".
In any case, I trust that what I have written might help some other user who may have a problem with WSL.
Thanks for your help! I am going to close this issue.
Kind Regards, Liam
Hi Didier (@Omikhleia),
In the past few days, I've been working on installing both the SILE Typesetter and "markdown.sile" in the Windows Subsystem for Linux (WSL). Through trial and error, I was finally able to get it installed in Ubuntu by working through the following steps. I would be interested to know if I just got it working by accident, or might there be a better way of doing this?
In Section 2.7 of the SILE manual (Installing third-party packages), it mentions checking the version of Lua that SILE uses, so that Luarocks will install the correct version. Since I wanted to install locally, I used:
luarocks --lua-version 5.2 install --dev markdown.sile
However, there were problems downloading the "rockspec" file, so I did it manually using:
wget https://luarocks.org/dev/markdown.sile-dev-1.rockspec
I then tried this command, but it gave an error about Lua header files:
luarocks install --dev --local markdown.sile-dev-1.rockspec
The article Error: Failed finding Lua header files. You may need to install them or configure LUA_INCDIR. - Windows 10 with Lua distribution, mentioned that Luarocks could not find "lua.h", "lualib.h" and other related files.
To find these on my system, I installed locate (
sudo apt install locate -y
) and updated the database (sudo updatedb --prunepaths='/mnt'
) and then updated the LUA_INCDIR as follows:luarocks-5.2 config variables.LUA_INCDIR /usr/include/lua5.1 --local
However, the installation still failed. Running the Luarocks command by itself (
luarocks
) to get the configuration information, was showing the same error for the "include" directory, even though the folder existed and "lua.h" was present:LUA_INCDIR : (not found)
I installed Lua 5.2 (
sudo apt install lua5.2
), but this did not create any further "include" folders. The article Lua 5.3 is installed, but I can't locate the correct lua.h, however, gave a pointer in the correct direction.I installed liblua5.2-dev and updated the "locate" database:
sudo apt install liblua5.2-dev
sudo updatedb --prunepaths='/mnt'
and then checked for further "include" folders:
locate include | grep lua
This gave the following:
Updating the LUA_INCDIR (
luarocks config variables.LUA_INCDIR "/usr/include/lua5.2" --local
) gave the following configuration, with the "include" directory finally being recognised:This allowed the installation to work correctly (
luarocks-5.2 install --dev --local markdown.sile-dev-1.rockspec
):As I said, this was trial-and-error over several days. I wasn't always consistent with the commands and the Lua versions that I used, so I may have been giving myself extra work to get it installed locally.
Some final questions: might there have been some checks that I could have run earlier to find out what was missing? Since I am not familiar with the dependencies between Lua versions, or much about the Lua ecosystem, are there some assumptions that needed to be corrected?
Kind Regards, Liam