Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Patrick Carey
@paddycarey
Sorry I missed this response, thanks for the reply @hishamhm , I'll definitely consider submitting a patch as it'll be useful for our (my employer's) users I think
wmoors
@wmoors
Hey all... I'm having problems trying to manage different lua versions on my system. I used luaver to switch until now, but I started to use network namespaces now for testing purposes (ip netns NS_X exec lua -lluarocks.loader ...) but this fails as the luaver script is only available in my user shell and not as the root user.
So I was wondering how this typically done.
I tried to check the wiki, but their is little to no documentation on how to work with luarocks with different lua versions.
Hisham Muhammad
@hishamhm
Hi @wmoors, there are many ways that people go about this and indeed it can get pretty confusing! the luarocks tool has gotten better at maintaining multiple lua versions at the same time recently, but when launching lua to run it, everything always boils down to your environment variables
the variables that matter are LUA_PATH_5_3 and LUA_CPATH_5_3 for Lua 5.3 (with unversioned variants LUA_PATH and LUA_CPATH as fallbacks), same thing for Lua 5.2, and only the unversioned ones for Lua 5.1
the command luarocks path --lua-version=5.x outputs the correct values for the Lua version 5.x you want to use
I don't know about the specifics of your setup to say what the values of these environment variables should be, but comparing their current values with the output of luarocks path should lead you in the right direction!
Milind Gupta
@aryajur
I have been doing multiple Lua versions by using self contained LuaRocks versions. I documented it here (for windows): https://milindsweb.amved.com/LuaRocks_.html#L5 . I just need to open a command line terminal and run the batch file to initilize the environment variables. I also have a video for it: https://www.youtube.com/watch?v=403rjwb8gfc
A question I had for external dependencies packages and libraries in LuaRocks. Is there a way that we can specify compilation of an external package? Another thing is if we don't want to go the compile route can we specify the library files directly that should be downloaded for the platform? I am thinking about say LuaCURL which needs the curl library which may be compiled and also for IUP which has all the binaries of the libraries we can just download them as part of rock installation.
Hisham Muhammad
@hishamhm
@aryajur you can't specifiy which files to be compiled or installed externally (because the procedures for installation vary from OS to OS and from distro to distro), but you can specify which libraries can be checked using the external_dependencies table
Milind Gupta
@aryajur
@hishamhm it would be nice if there is a way to run scripts or download external dependencies and specify them in the rockspec. Even though it depends from OS to OS have a method to write it in rockspec and just give some API to figure out the OS etc can open doors for developers to take care of platform dependence and make installation of complex modules more painless. LuaRocks can just enable just some mechanisms that can guve the choice to package managers to tackle this problem.
Hisham Muhammad
@hishamhm
@aryajur I was thinking that a minimal first step would be to add an error_message field for external_dependencies entries, where the rockspec author could give customized instructions. A slight complicator of putting something like a script field there would be the fact that system package managers usually need root privileges, while rocks can be installed locally.
Milind Gupta
@aryajur
@hishamhm I would still think that having the script option would be very useful since it allows the package creator to create and add the script. Even if the installer does not have root privilege existence of a premade script greatly simplifies installation because that script can then be passed to the system administrator who can use it and save time. Although lot of users may already have root privileges. The users I have talked to always state as this being the major hurdle for usage and getting the right packages. If the mechanism is started the problem can then slowly resolve over time for popular packages.
Caleb Maclennan
@alerque
Has anybody successfully setup Github's new Actions CI to test a Lua Rocks repository? I have one I'd like to run Busted on... If not that any good examples of any CI (Travis, Circle, Gitlab, etc.) being run on a Rock (including against a couple Lua versions) would be nice.
daurnimator
@daurnimator
alerque: see a few of my repositories
alerque: you want a pure-lua library? or C library?
Caleb Maclennan
@alerque
Pure Lua.
@daurnimator It looks like you're using Travis. Thanks for the example.
If anybody has Lua working Github Actions CI I'm still all ears. I seem to have container with Lua/Luarocks running but actually getting it to do anything is another story.
Caleb Maclennan
@alerque
Interesting use of hererocks by the way, I've never seen that. It looks cleaner than the Lua rigging we have for sile.
daurnimator
@daurnimator
alerque: I think my usage of hererocks was straight out of the hererocks readme....
leaf
@leafo
I just setup github actions for lua/luajit + luarocks tonight for one of my repos, works great
I'm going to make a reusable action for it
Caleb Maclennan
@alerque
Thanks for pointing that out @leafo. That's quite a bit of tooling though! I'm hoping some of that gets extracted to a reusable action that can live outside of my repository ;-) I have a working Travis setup now. I think I'm going to wait on implementing Actions until there is something with a little less plumbing to debug and maintain.
leaf
@leafo
I'm working on reusable thing as we speak
for travis I've always used this: https://github.com/moteus/lua-travis-example
Caleb Maclennan
@alerque
I'm familiar with that setup and use it too but again it's a lot of tooling to include in the parent repository and changing any part of it involves a lot of round trip trial-and-error with Travis.
Matthieu Coudron
@teto
is there a changelog for the new release ? couldn't find any specific in changelog.md. Also it doesn't appear in https://luarocks.github.io/luarocks/releases/
Caleb Maclennan
@alerque
Thanks @leafo! I set those actions up on simoncozens/cassowary.lua#7 and it appears to work great (At least in my fork, I guess PR's don't work in Actions until it's been started on master?).
Thijs Schreijer
@Tieske
@leafo the install-lua one is giving me a 404 ?
Caleb Maclennan
@alerque
@Tieske If you look at his example you'll see he renamed the action and repo to install-lua-luajit.
I don't happen to think that was a good idea, but it does still exist.
Caleb Maclennan
@alerque
Lets say I want to run luacheck and busted and have different pass/fail behavior for PRs. Does that need to be two separate action workflows or can it be two jobs in the same workflow? I don't understand when one layout would be preferred.
Also @leafo I see you are posting to Lua Locks after build. Have you set this up to handle releases when Github tags are created as well or are you just using it for updating SCM versions?
leaf
@leafo
I didn't rename the action to install-luajit
github marketplace needs 1 action per repo, so there's leafo/install-lua and leafo/install-luarocks
oh
they generated a new url because I changed the title of the action to mention luajit
that's annoying (especially since they don't create redirects)
well, in any case the name used in the workflow won't change
Caleb Maclennan
@alerque
@leafo Thanks again, I just started a new project fluent-lua and it was nice to get going quickly and cleanly with actions.
I'm looking into how to post to Lua Rocks now though, and it looks like even in your lua-twitter project example you are posting the same spec twice for every run, no? Shouldn't that bit be a separate job (depending on the first) so it doesn't repost the spec for every iteration of the matrix?
leaf
@leafo
@alerque yeah, dont use my publish example exactly in lua twitter, it's double deploying. You'll want to probably set something up that does it on pushing a tag
that was just me messing around. I think the only thing missing for deploy from tag is generating a rockspec with the correct version in the name and file
Caleb Maclennan
@alerque
Is there any advantage to publishing the scm rockspec to Lua Rocks on every pushed commit?
mothilv
@Starkyv
Can someone give me a lead on where to start contributing?
Caleb Maclennan
@alerque
Sure, but can you be a little more specific? Do you have Lua code you want to make into a rock? Or just want some Lua project to tinker with? Or something to the luarocks project itself?