luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

custom luvi #180

Open zenlor opened 8 years ago

zenlor commented 8 years ago

Hello, I have run in a bit of trouble running in Alpine Linux, and musl.

Since lit will download the supposedly right version of the precompiled binary from github it will not run on my small system (an ARM server from scaleway and my Raspberry).

I already have luvi, lit and luvit installed in /usr/local. Additionally I had to replace the downloaded luvi with my compiled version ~/.litdb.git/cache/24339028e53ad0607172d8c0f0105a5814cd7bc9/luvi.

A quick inspection of the code revealed tha there is currently no way to set a preferred luvi executable. Is this something you would like to support? If you are positive I could give it a try and send a pull request.

Tests are all green in Alpine 3.3.3, kernel 4.3.3-std-1 platform armv7l

creationix commented 8 years ago

Actually I've been playing with this last week.

  1. There is a way to specify a custom luvi, but for some reason it was never documented.
  2. You don't even need to embed luvi, a single with #!/path/to/luvi --\n will work just fine in place of the luvi binary.

Using both these my solution is to compile custom luvi for alpine (just clone luvi source and build normally inside alpine). I put it at /usr/local/bin/luvi. Then create a file, I call it prefix that contains #!/usr/local/bin/luvi --\n. Then I build my luvi based app, but using /path/to/prefix in place of the custom luvi.

> lit make lit://luvit/luvit /usr/local/bin/luvit /path/to/prefix

And it will build the zip for luvit/luvit, and append it to the file at /path/to/prefix and store it in /usr/local/bin/luvit

The undocumented feature is the 3rd argument to lit make is the custom luvi path.

creationix commented 8 years ago

I would like to think of some tweaks to luvi that makes this custom luvi easier, maybe a config option?

zenlor commented 8 years ago

Thanks for the prompt response!

A config option would be helpful to force a custom version of luvi instead of grabbing a prebuild binary

creationix commented 8 years ago

Agreed, I'll leave this issue open as a reminder to add such an option when I'm back at my desk next week.