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

Busted should run under the same interpreter it was installed with. #227

Closed
jszakmeister opened this issue Mar 8, 2014 · 4 comments · Fixed by #234
Closed

Busted should run under the same interpreter it was installed with. #227

jszakmeister opened this issue Mar 8, 2014 · 4 comments · Fixed by #234

Comments

@jszakmeister
Copy link
Contributor

Right now, the main busted script is a shell script that expects to find a suitable interpreter on the path. Unfortunately, when using a custom tree for only a specific purpose, such as unit testing in Neovim, you have to add our custom tree to your path or specify it with the -l option. It'd be nice to just run the busted script, and have it use the same interpreter that was used to install it.

FWIW, it seems that both luarocks and moonscript work well in this regard. Maybe the could serve as an example of what busted needs to do?

@Tieske
Copy link
Member

Tieske commented Mar 9, 2014

I'm not sure this can be accomplished easily. LuaRocks has an extensive install script that handles this. Where Busted is installed using LuaRocks, and installing through a rockspec doesn't allow you to catch that information and write it into some busted config file.

That said, LuaRocks will wrap any Lua scripts in the BIN directory in a shell wrapper script that handles the correct Lua environment. So to make that work, I think the shell script should be rewritten as a Lua script.

This is an example (Windows) from LuaxPL, for the xpllogger Lua script

@echo off
"C:\Program Files (x86)\Lua\5.1\bin\lua.exe" -e "package.path=\"C:\\Program Files (x86)\\LuaRocks\\systree/share/lua/5.1/?.lua;C:\\Program Files (x86)\\LuaRocks\\systree/share/lua/5.1/?/init.lua;C:\\Users\\Thijs\\AppData\\Roaming/luarocks/share/lua/5.1/?.lua;C:\\Users\\Thijs\\AppData\\Roaming/luarocks/share/lua/5.1/?/init.lua;C:\\Program Files (x86)\\LuaRocks\\2.1\\lua\\?.lua;\"..package.path; package.cpath=\"C:\\Program Files (x86)\\LuaRocks\\systree/lib/lua/5.1/?.dll;C:\\Users\\Thijs\\AppData\\Roaming/luarocks/lib/lua/5.1/?.dll;\"..package.cpath" -e "local k,l,_=pcall(require,\"luarocks.loader\") _=k and l.add_context(\"luaxpl\",\"0.2.0-1\")" "C:\Program Files (x86)\LuaRocks\systree\lib\luarocks\rocks\luaxpl\0.2.0-1\bin\xpllogger" %*

Would that satisfy your request?

@jszakmeister
Copy link
Contributor Author

@Tieske Yes, I believe it would. Unfortunately, my lua-fu is pretty low right now, so I can't say for certain if it's the right approach.

Tieske added a commit to Tieske/busted that referenced this issue Apr 7, 2014
ajacksified pushed a commit that referenced this issue May 2, 2014
@jszakmeister
Copy link
Contributor Author

Can we open this issue back up since it's now no longer fixed?

jszakmeister referenced this issue in neovim/neovim May 4, 2014
Apparently busted 1.11.0 is broken(lunarmodules/busted#236)
in a way that is causing the unit tests to fail. This pins the version to 1.10.0
and also fixes a wrong variable set when msgpack was added as a dependency
@aktau
Copy link

aktau commented Aug 4, 2014

Hey guys, as you might've noticed (or not), a recent LuaRocks upgrade broke some things for us. (I) think this is because something changed on the Busted side. Could you advise? Reference: neovim/neovim#1031

EDIT: could you please re-open if found to be a valid issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants