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

The recommended luarocks invocation completely breaks SILE (on macOS?) #2215

Open
davidchisnall opened this issue Jan 15, 2025 · 2 comments
Open
Assignees
Milestone

Comments

@davidchisnall
Copy link

If you use a package that does not exist, SILE tells you to first do:

      luarocks --lua-version 5.1 --tree lua_modules install {package}

This installs the package under lua_modules. So far so good.

It then tells you to:

      eval $(luarocks --lua-version 5.1 --tree lua_modules path)

This then sets LUA_PATH and LUA_CPATH, which overrides SILE's built-in paths and prevents it from finding things (the first error is for penlight, but then all of the other things SILE depends on).

It looks as if SILE forcibly preserves some paths. The error list includes things like:

	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/lua-libraries/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/lua-libraries/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/lua_modules/share/lua/5.1/sile/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/lua_modules/share/lua/5.1/sile/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/lua_modules/share/lua/5.1/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/lib/sile/lua_modules/share/lua/5.1/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/lua-libraries/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/lua-libraries/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/lua_modules/share/lua/5.1/sile/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/lua_modules/share/lua/5.1/sile/pl/import_into/init.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/lua_modules/share/lua/5.1/pl/import_into.lua'
	no file '/opt/homebrew/Cellar/sile/0.15.9/share/sile/lua_modules/share/lua/5.1/pl/import_into/init.lua'

But the SILE dependencies are installed under /opt/homebrew/Cellar/sile/0.15.9/libexec, so this doesn't work.

You can work around this by doing:

export LUA_PATH="${LUA_PATH};;"
export LUA_CPATH="${LUA_CPATH};;" 

This (from reading the comments in the SILE code) makes add (prepend) the environment variables to the default path, rather than replacing.

@alerque
Copy link
Member

alerque commented Jan 15, 2025

If you are installing Rocks to a project-local lua_modules tree, you shouldn't need that eval $(luarocks path) business at all, that one tree location is built in already.

That's not to say there isn't a real issue here, just a tip to maybe get you back to work fast while I try to make out what's up with the rest of this.

@davidchisnall
Copy link
Author

Ah, I had a stale invocation left over in that terminal. Okay, simply not running the second command seems to work well.

@alerque alerque added this to the v0.15.10 milestone Jan 17, 2025
@alerque alerque self-assigned this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants