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 --version error: "Please install a bit library" #1115

Closed
carlocab opened this issue Dec 2, 2020 · 8 comments
Closed

sile --version error: "Please install a bit library" #1115

carlocab opened this issue Dec 2, 2020 · 8 comments
Labels
tooling Build tooling, release management, and packaging processes

Comments

@carlocab
Copy link

carlocab commented Dec 2, 2020

I'm working on updating Homebrew's lua package to lua5.4.1: Homebrew/homebrew-core#65993

Homebrew CI runs a battery of tests, which includes running a test for each package that depends on lua. (This, of course, includes sile.)

The test for sile calls sile --version. Despite the successful build against lua5.4, running this causes the following error:

❯ sile --version
/usr/local/opt/lua/bin/lua: ...llar/sile/0.10.13_1/share/sile/lua-libraries/bitshim.lua:50: Please install a bit library
stack traceback:
        [C]: in function 'error'
        ...llar/sile/0.10.13_1/share/sile/lua-libraries/bitshim.lua:50: in main chunk
        [C]: in function 'require'
        ...ocal/Cellar/sile/0.10.13_1/share/sile/core/utilities.lua:1: in main chunk
        [C]: in function 'require'
        /usr/local/Cellar/sile/0.10.13_1/share/sile/core/sile.lua:33: in main chunk
        [C]: in function 'require'
        /usr/local/Cellar/sile/0.10.13_1/libexec/bin/sile:36: in main chunk
        [C]: in ?

I'd appreciate some help fixing this, as this is the last test failure that needs to be addressed for Homebrew lua to be upgraded.

Additionally, suggestions for more substantive tests of functionality would be appreciated.

Thank you!

@alerque
Copy link
Member

alerque commented Dec 2, 2020

Is Homebrew's Lua 5.4 compiled with or without the Lua 5.2 compatibility flag on or off? The 5.3 build had it enabled which gave it a bit32 module built into the VM. Hence the formula skimmed installing the bit32 LuaRock as called out in the dependency list. If you've compiled 5.4 without that flag then it doesn't have one built into the VM so you need to add a resource bundle to the SILE formula to get a bit32 module to shim it. SILE has already been updated to adapt (see #957), but you do need the latest library for it to count. Previous versions of the bit32 library were not aware of Lua 5.4 and would refuse to load on it. 5.3.5.1-1 was released specifically to address this issue. See also this hot mess.

Also just a heads up there was a LuaRocks bug related to this as well. This is why you are getting past the configure/make stages and crashing later rather than detecting the missing dependency earlier. LuaRocks has been patched for this, but it sounds like Homebrew isn't using it yet.

@alerque alerque added the tooling Build tooling, release management, and packaging processes label Dec 2, 2020
@carlocab
Copy link
Author

carlocab commented Dec 2, 2020

The compatibility flag is off. I'll add it, as who knows what else it breaks (not to mention that Homebrew does not ship lua5.2). Thanks for the tip; it would've taken ages for me to figure it out (if I ever would have).

Do you mind keeping this issue open till I get CI to succeed with sile? I'd hate to spam your issue tracker with other related issues, should any come up. (Hopefully not)

@alerque
Copy link
Member

alerque commented Dec 2, 2020

No worries. I hope this saves you some of the deep goose chases I spent who knows how many hours chasing this and other gremlins down when 5.4 hit Arch Linux and everything went haywire.

@carlocab
Copy link
Author

carlocab commented Dec 2, 2020

Didn't work. 😞

I tried grepping the lua5.4.1 source and there doesn't seem to be any reference to LUA_COMPAT_5_2 in it. It does define a macro based on LUA_COMPAT_5_3, though, in luaconf.h.

Have I misunderstood what I'm supposed to do?

@alerque
Copy link
Member

alerque commented Dec 2, 2020

I would suggest leaving Lua compiled with default options, adding a resource block to the SILE formula that installs the bit32 shim module, and making sure LuaRocks is the freshest release possible.

carlocab added a commit to carlocab/homebrew-core that referenced this issue Dec 2, 2020
Dependency switched to `[email protected]` due to test failure.

A potential fix to upgrade to lua5.4 is proposed here:
sile-typesetter/sile#1115
@carlocab
Copy link
Author

carlocab commented Dec 3, 2020

I've left sile on 5.3 for now. Will try to fix it in a separate PR. The CI results should be good enough for the PR to be merged, I think.

Thanks so much for your help; I really needed it. You've been very generous with your time.

@carlocab carlocab closed this as completed Dec 3, 2020
fxcoudert pushed a commit to Homebrew/homebrew-core that referenced this issue Dec 3, 2020
A potential fix to upgrade to lua5.4 is proposed here:
sile-typesetter/sile#1115
@alerque
Copy link
Member

alerque commented Dec 3, 2020

@carlocab Thanks for your work on HomeBrew. I just took a stab at updating the SILE Formula for 5.4, but since I'm not even on macOS it's a total stab in the dark. Here is my PR, you also have access to that remote if you see anything to poke.

@carlocab
Copy link
Author

carlocab commented Dec 3, 2020

Oh,thanks very much. I'll have a look at it this afternoon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling Build tooling, release management, and packaging processes
Projects
None yet
Development

No branches or pull requests

2 participants