Stratus3D / asdf-lua

Lua plugin for asdf version manager. https://github.com/asdf-vm/asdf
MIT License
62 stars 13 forks source link

Added Lua shim to use lib and share in install path #2

Closed pirogoeth closed 7 years ago

pirogoeth commented 7 years ago

Without this, Lua will only search for modules in the global path for installed modules and rocks. Might also need a luac shim as well.

Stratus3D commented 7 years ago

Thanks! I haven't been using Lua for day to day work so I wasn't aware of this issue.

Stratus3D commented 7 years ago

As per the asdf documentation the shims need to include a comment with metadata like this so they can be removed when the plugin is removed:

# asdf-plugin: asdf-lua
Stratus3D commented 7 years ago

I'm also thinking it might be better off if we move this logic to the exec-env callback script (there isn't one currently as I didn't think I'd need it). It basically sets the shell environment the plugin binaries are executed in. I'm not sure if this can be done with env variables though.

Stratus3D commented 7 years ago

I think the LUA_INIT environment variable might be able to do everything the -e flag does.

pirogoeth commented 7 years ago

@Stratus3D Ah, I guess I missed the part in the doc about the metadata. I'll take care of that!


I do also agree that this would be a lot nicer from exec-env - I wasn't aware that was a thing! I was also looking for env vars ingested by the Lua interpreter and didn't find those either, guess I didn't look hard enough! 😥

I'll work on switching this over to exec-env tonight! Thanks for the feedback 😄

Stratus3D commented 7 years ago

Awesome! Really appreciate it. If you run into any issues let me know.

I tested the LUA_INIT and -e flag, and it seems like the -e flag is evaluated after the expression in LUA_INIT, which is great because that will allow users to potentially override anything we set LUA_INIT if they need to.

Stratus3D commented 7 years ago

I think I have fixed this issue in commit 14fbcfb19ca658b82e1f40cdb56f9819a66220c8. If you encounter any issues please reopen this ticket.

pirogoeth commented 7 years ago

@Stratus3D Sorry I didn't get around to it, life has been busy. Thanks! I'll try it out when I get a chance.