luapower bundle

  • I did the following but still getting error. I could not find the file anywhere in the cloned directory. What am i still missing . Thanks.

    git clone luapower
    cd luapower
    ./mgit clone

    ./mgit bundle

    .mgit/ line 423: .mgit/ No such file or directory
    Unable to set platform.

  • 32
    Log in to reply

  • You have to do mgit clone too, that's where the script is. I might embed that into in the future, though bundle itself is not very useful without the luapower repos (what would you bundle with it?)

  • Hi,

    Thanks. Got that working now. What do I need to add to the PATH so that I can execute mgit bundle outside of the installed directory?
    FYI, OS is Ubuntu 14.04 64bit.

  • You can't right now, but if you give me some details about your use case I could add an option for that.

    mgit tries to behave like git, so it looks for a .mgit directory in the current directory or one of its parents, just like git looks for a .git directory. The mgit script itself you can put it in PATH by eg. symlinking it to /usr/bin.

  • Hi,

    As an example, I install the mgit, bundle and luapower-repos in /home/albert/luapower. Now my custom lua scripts is in /usr/local/programs. I would like to be able to issue the "mgit bundle -m --all -M main -o main.exe" from the /usr/local/programs directory. In essence, I want to keep my custom scripts directory separate from the luapower directory. Thanks.

  • How about (cd /home/albert/luapower; mgit bundle -m --all -M main -o main.exe) ?

  • Hi,

    I have done that but the issue is that I need to dump my source code in the /home/albert/luapower directory. The use case that I am look for is the ability to execute the bundle compiler on an directory of my choosing. Hope this clarify my use case scenario. Thanks.

  • I can see why you might feel uneasy adding your scripts to the flaming wok. You probably cloned all the modules and now you're looking at a directory with 450 files in it and say "what a mess, I don't want to mix my app with that". You want to use it all as an upstream library that you don't want to touch. I can understand that. But you'd be going against the grain if you do that. It would be much easier to use luapower as if it's you who's written it, as if it's yours and not something external to your project that you don't want to mess with. So make it yours, i.e.:

    • only clone the modules that you actually use -- seeing only relevant files will make it more approachable.
    • fork the modules that you think you might want to hack on and clone them from your own place -- hack them, remove stuff that you don't need from them and push the changes -- the modules are yours now.
    • embrace the directory conventions, they're just common sense after all, so put your binaries in bin/platform, put Lua files in root where the luajit launcher is, etc. All the tools will know where to find your files and you'll never have to specify paths on the command line.
    • your app will be mixed with other luapower modules on disk, yes, but it will still have its own completely separate git repository with its own history etc. (none of that git subtree merge crap either). As a bonus, anyone will be able to fork/clone your app directly into their own luapower tree in case you'll ever want to open its development to other luapower users.

    I hope you'll to give it a shot, because adding command line options all the tools with all the search paths is a pain in the butt :)

  • Hi,

    Thanks for the clear explanation on your approach to luapower. FYI, I have only cloned the mgit, bundle and luapower-repos. Even that those three, I am bewildered with the sear amount of files and sub-directory.

    Again my expectation was way off from your vision of luapower. I was thinking more along the line of mgit source compiled to an executable which in turn can be used for bundling/compiling of lua code into a standalone execute.

    Anyway, I would like to express my sincere gratitude for all the work that you have done for the lua /luajit community. Thank you.

  • To make it less overwhelming you could type mgit ls-tracked to see which file was added in by which package. Or you could try cloning these again and look at how the directory evolves.

    Let's summarize: cloning multigit adds in the mgit script, fair enough, then cloning luapower-repos adds in the .mgit directory which contains the origins of all known packages so you can do mgit clone bundle instead of mgit clone It also adds some scripts that are specific to luapower because multigit itself has nothing to do with luapower, it's just a way to clone multiple git repos overlapped. Finally, bundle adds in files all over the place. That's ok, all packages do that. This is why we have the luapower conventions, to allow packages to coexist peacefully in the same directory even when it's very crowded in there. This looks messy at first (just like a Linux system) but it's much more simple and scalable than putting each module in it's own directory and is in fact easier to use. It's just, well, not very mainstream, although it's weird to say that because that's how Linux works and Linux is very mainstream :)

    The truth is that in order to make a good quality app you will have to know your full stack and be able to hack it at any level, no blackboxes. Luapower embraces that so it doesn't try to hide the guts, it just tries to organize them :)

    Anyway I hope this helps. And thanks for the kind words. They're very much appreciated.

  • Hi,

    I have compiled a project of mine and the process when without any error. But I encounter this problem with luasql.mysql . How do I include it in the executable. Thanks.

    ./mainexe: ./main.lua:13: module 'luasql.mysql' not found:
    no field package.preload['luasql.mysql']
    no file './luasql/mysql.lua'
    no file './luasql/mysql/init.lua'
    no file './clib/luasql/mysql.dll'
    no file './clib/luasql.dll'
    no symbol 'Blua_luasql_mysql'
    no symbol 'luaopen_luasql_mysql'

    ----- Compiled Command
    ./mgit bundle -m --all -a --all -M main -o mainexe -v

  • Hi Albert,

    What is the file name and path of luasql.mysql ?

  • I did a search and it appear as

    sudo find /. |grep luasql


  • Bundle doesn't know how how to find libraries outside of the luapower tree. All dependencies must be included. In your case it looks like is a Lua/C library and so you need to put it (or link it) in bin/linux64/clib/

    Btw, if that module was compiled against Lua 5.2 then it might not work with luajit (not sure)

  • Actually, bin/linux64/clib/luasql/ gosh talk about love for hierarchy :)

  • Oh and if it's for mysql, there's a libmysql binding and there's binaries for libmysql and libmariadb.

  • Yes. I was working with lua in the beginning and most people point me to luasql so there is where i build my modules.

    How about socket, mime and ltn12? do I need to move the library to the /bin/linux64/clib ?

  • There's a LP package for luasocket: mgit clone socket

  • @cosmin I traced that the the to the following /usr/lib/x86_64-linux-gnu/

    I did a ln -s /usr/lib/x86_64-linux-gnu/ in the bin/linux64/clib/ directory. Compiled again but still getting the same error. What else do I need to do? Thanks.

  • Hm, the error was from windows but now you're talking about Linux. I'm confused...

    If you run ./luajit -lluasql.mysql does it work?

  • For your information, I am running all the commands in Ubuntu 14.04 64bit machine.

    ./luajit -lluasql.mysql

    LuaJIT 2.1.0-alpha -- Copyright (C) 2005-2015 Mike Pall.
    JIT: ON SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse

Log in to reply

Internal error.

Oops! Looks like something went wrong!