• Announcement: Lua.org now officially recommends this forum as a meeting place for the Lua community

Vagrant (development environment) with recent Lua and Luarocks version (1 Viewer)

scls

Newcomer
Joined
Mar 10, 2021
Messages
10
Reaction score
2
Hello,

I'm looking for a Vagrant environment for Lua and LuaRocks

I noticed on Github

This use the luajit-rocks that provides LuaJIT and Luarocks in just one location.

Code:
vagrant ssh
Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-159-generic x86_64)

* Documentation:  [URL='https://help.ubuntu.com']Official Ubuntu Documentation[/URL]
* Management:     [URL='https://landscape.canonical.com']Landscape | Home[/URL]
* Support:        [URL='https://ubuntu.com/advantage']Ubuntu Advantage for Infrastructure | Ubuntu[/URL]

  System information as of Thu Oct 14 08:30:04 UTC 2021

  System load:  0.0               Processes:             97
  Usage of /:   3.9% of 38.71GB   Users logged in:       0
  Memory usage: 4%                IP address for enp0s3: 10.0.2.15
  Swap usage:   0%


0 updates can be applied immediately.

New release '20.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Thu Oct 14 08:09:27 2021 from 10.0.2.2
[email protected]:~$ lua
LuaJIT 2.0.4 -- Copyright (C) 2005-2017 Mike Pall. [URL='http://luajit.org/']The LuaJIT Project[/URL]

_____              _
|_   _|            | |
  | | ___  _ __ ___| |__
  | |/ _ \| '__/ __| '_ \
  | | (_) | | | (__| | | |
  \_/\___/|_|  \___|_| |_|

JIT: ON CMOV SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
> ^C
[email protected]:~$ luarocks --version
/opt/luarocks/bin/luarocks 2.3.0
LuaRocks main command-line interface



and


Code:
$ hostnamectl
   Static hostname: lua.box
         Icon name: computer-vm
           Chassis: vm
           Boot ID: 6b50009125d849b294e3f43cc6ed532e
  Operating System: Ubuntu 14.04.6 LTS
            Kernel: Linux 3.13.0-170-generic
      Architecture: x86_64

[email protected]:~$ lua
Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> ^C
[email protected]:~$ luarocks
The program 'luarocks' is currently not installed. To run 'luarocks' please ask your administrator to install the package 'luarocks'
[email protected]:~$ sudo apt install luarocks
Reading package lists... Done
Preparing to unpack .../luarocks_2.0.9-1_all.deb ...
Unpacking luarocks (2.0.9-1) ...
Selecting previously unselected package pkg-config.
Preparing to unpack .../pkg-config_0.26-1ubuntu4_amd64.deb ...
Unpacking pkg-config (0.26-1ubuntu4) ...
Selecting previously unselected package unzip.
Preparing to unpack .../unzip_6.0-9ubuntu1.5_amd64.deb ...
Unpacking unzip (6.0-9ubuntu1.5) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for install-info (5.2.0.dfsg.1-2) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Setting up liblua5.1-0:amd64 (5.1.5-5ubuntu0.1) ...
Setting up autotools-dev (20130810.1) ...
Setting up libltdl-dev:amd64 (2.4.2-1.7ubuntu1) ...
Setting up libtinfo-dev:amd64 (5.9+20140118-1ubuntu1) ...
Setting up libreadline6-dev:amd64 (6.3-4ubuntu2) ...
Setting up libreadline-dev:amd64 (6.3-4ubuntu2) ...
Setting up liblua5.1-0-dev:amd64 (5.1.5-5ubuntu0.1) ...
Setting up libtool (2.4.2-1.7ubuntu1) ...
Setting up lua5.1 (5.1.5-5ubuntu0.1) ...
Setting up zip (3.0-8) ...
Setting up luarocks (2.0.9-1) ...
Making manifest for /usr/local/lib/luarocks/rocks
Generating index.html for /usr/local/lib/luarocks/rocks
Setting up pkg-config (0.26-1ubuntu4) ...
Setting up unzip (6.0-9ubuntu1.5) ...
Processing triggers for libc-bin (2.19-0ubuntu6.15) ...

[email protected]:~$ luarocks --version
luarocks 2.0.8
LuaRocks main command-line interface


The first project is about LuaJIT... not Lua and both seems quite outdated...

I wonder if some of you know if a Vagrant development environment exists for recent Lua version (5.4.2) and LuaRocks (3.7.0) (at the time of writing).

Kind regards
 

scls

Newcomer
Joined
Mar 10, 2021
Messages
10
Reaction score
2
For those who might an interest for such a Vagrant env... here is my Vagrantfile which should install Lua 5.4.3 and LuaRocks 3.7.0 in an Ubuntu Impish Indri VM.

Code:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
    # lua_version_major_minor = "5.4"
    lua_version = "5.4.3"
    luarocks_version = "3.7.0"
    hostname = "lua.box"
    locale = "en_GB.UTF.8"
    # Box
    config.vm.box = "ubuntu/impish64"
    # Shared folders
    config.vm.synced_folder ".", "/srv"
    # Setup
    config.vm.provision :shell, :inline => "touch .hushlogin"
    config.vm.provision :shell, :inline => "hostnamectl set-hostname #{hostname} && locale-gen #{locale}"
    config.vm.provision :shell, :inline => "apt-get update --fix-missing"
    config.vm.provision :shell, :inline => "apt-get install -q -y build-essential libreadline-dev unzip g++ make git curl vim"
    # Lang
    ## Lua
    #config.vm.provision :shell, :inline => "apt-get install -q -y lua#{lua_version_major_minor}"
    config.vm.provision :shell, :inline => "curl -R -O http://www.lua.org/ftp/lua-#{lua_version}.tar.gz"
    config.vm.provision :shell, :inline => "tar -zxf lua-#{lua_version}.tar.gz"
    config.vm.provision :shell, :inline => "rm -f lua-#{lua_version}.tar.gz"
    config.vm.provision :shell, :inline => "cd lua-#{lua_version}"
    #config.vm.provision :shell, :inline => "make linux test" # default: make: *** No rule to make target 'linux'.  Stop.
    #config.vm.provision :shell, :inline => "make linux" #  default: make: *** No rule to make target 'linux'.  Stop.
    #config.vm.provision :shell, :inline => "make install"
    ## LuaRocks
    config.vm.provision :shell, :inline => "wget https://luarocks.org/releases/luarocks-#{luarocks_version}.tar.gz"
    config.vm.provision :shell, :inline => "tar zxpf luarocks-#{luarocks_version}.tar.gz"
    config.vm.provision :shell, :inline => "rm -f luarocks-#{luarocks_version}.tar.gz"
    config.vm.provision :shell, :inline => "cd luarocks-#{luarocks_version}"
    config.vm.provision :shell, :inline => "./configure --with-lua-include=/usr/local/include"
    config.vm.provision :shell, :inline => "make"
    config.vm.provision :shell, :inline => "make install"
end

I still don't understand why the provisionning line make linux test doesn't work.
(I'm also quite new to Vagrant)

Any idea?
 

scls

Newcomer
Joined
Mar 10, 2021
Messages
10
Reaction score
2
Problem fixed... that was simply because running make should be done in the correct directory (which wasn't the case).

For those who might be interested here is a Github project I did for installing Lua and LuaRocks from source in a Linux Ubuntu OS.

 
Last edited:
Top