Skip to content
Snippets Groups Projects
Select Git revision
  • fix-macos
  • emilua-0.11.x default protected
  • fix-visibility
  • fix-exit-code-on-exception-from-main-fiber
  • fix-preload-libc-cpplinkargs
  • feat/use-asio-config
  • fix-137
  • fix/link-libc-svc2
  • fix/link-libc-svc
  • emilua-0.10.x protected
  • emilua-0.9.x protected
  • emilua-0.8.x protected
  • emilua-0.7.x protected
  • emilua-0.6.x protected
  • emilua-0.5.x protected
  • emilua-0.4.x protected
  • feat/clone_into_cgroup
  • feat/calendar
  • v0.11.2
  • v0.11.1
  • v0.11.0
  • v0.10.1
  • v0.10.0
  • v0.9.1
  • v0.9.0
  • v0.8.4
  • v0.8.3
  • v0.8.2
  • v0.8.1
  • v0.8.0
  • v0.7.3
  • v0.7.2
  • v0.7.1
  • v0.7.0
  • v0.6.0
  • v0.5.3
  • v0.5.2
  • v0.5.1
38 results

emilua

  • Clone with SSH
  • Clone with HTTPS
  • Vinícius dos Santos Oliveira's avatar
    Vinícius dos Santos Oliveira authored
    This commit touches many different parts of the project:
    
    * It introduces a new optional library to override functions from libc
      that relate to ambient authority.
    * If this new library is linked with the binary, libemilua will make use
      of its features to offer its own replacement functions for a few libc
      functions.
    * It becomes possible to spawn actors where the caller can opt to act as
      a policy manager for libc calls in the spawned actor. This allows one
      to fake the implementation of some libc functions that don't work in
      capsicum mode.
    * Yet another library is introduced so it becomes to do the same for any binary
      in the system using `LD_PRELOAD`.
    
    Fixes #158
    ef814a45
    History

    Emilua

    A cross-platform execution engine for LuaJIT with support for async IO and flexible threading layout.

    Features:

    • Complete fiber API (sync primitives, interruption API, clean-up handlers, fiber local storage, assert-like scheduling constraints, …​).

    • TCP, UDP, TLS, file IO, address/service forward/reverse name resolution, UNIX domain sockets, SCM_RIGHTS fd-passing, pipes, serial ports, …​

    • Clocks & timers.

    • Filesystem API.

    • Portable error comparison.

    • Integrates with Lua builtins (i.e. you can mix up fibers and coroutines, modules, …​).

    • Actor API (each VM is an actor and they’re spawned in thread pools under your control[1]). You can even spawn isolated actors into new Linux namespaces, Landlock & seccomp rules, etc.

    • Native JSON module.

    • Cross-platform (should run anywhere Boost.Asio also runs).

    Install

    • Windows: Windows binaries are published on Gitlab after AppVeyor build.

    • ArchLinux: Emilua is available on AUR.

    • GUIX: Emilua is available from the main repository.

    • NixOS: Emilua is available from the unstable repository.

    • Ubuntu: Emilua is available for Ubuntu via this PPA repository.

    • FreeBSD: Emilua is available from the main repository and ports.

    LICENSE

    • C/C++ source code dual-licensed under Boost Software License and MIT. This model of license (user picks one from the offered options) makes it easier to contribute code back to both communities Emilua depends on (Boost and LuaJIT).

    • Lua code (including snippets scattered throughout the documentation) distributed in this repo is released as public domain.

    • The file src/emilua_gperf.awk is released as public domain.

    • Documentation (except for the source code samples contained within) is licensed under the Creative Commons Attribution 4.0 International License.

    • Submodules and dependencies have their own licensing terms.

    Emilua provides libraries with the interpreter which are themselves interpreted. This approach is not uncommon. For instance, Perl comes with many Perl modules, and a Java implementation comes with many Java classes. These libraries and the programs that call them are always dynamically linked together. It’s for this reason that Lua source code bundled with Emilua is released as public domain. Bundled public domain libraries that the interpreter loads will impose no additional restriction on your Lua program.

    Documentation

    You can browse the documentation online at https://docs.emilua.org/.

    Alternatively, you may pass -Denable_manpages=true when building the project to have the documentation installed as manpages in your system. The reference pages will be installed in the section 3em ("em" stands for Emilua Module). Tutorial pages will be installed in section 7, but every page in this section will be prefixed by "emilua-".

    Dependencies

    • Meson 1.2.0 or later.

    • C++20 compiler (GCC 12.1 or newer should work).

    • LuaJIT.

    • Boost.Asio (and other Boost libraries as well).

    • fmt 8.0 or later.

    • re2c 2.1 or later.

    • gperf 3.1 or later (maybe it’ll work on older versions as well).

    • GNU AWK 5.1 or later.

    Optional dependencies

    • Curses: coloured output on errors.

    • asciidoctor: manpages.

    • asciidoctor-diagram: ascii-art diagrams for manpages.

    • PlantUML: ascii-art diagrams for manpages.

    BUILD

    $ meson setup build
    $ meson compile -C build
    # meson install -C build

    You can also pass options when you invoke meson. One of the options is -D enable_file_io=true.

    It’s encouraged that you build luajit with -DLUAJIT_ENABLE_LUA52COMPAT.

    Standalone ASIO

    There are two approaches to use standalone ASIO (after tuning the right variable in meson-configure). The first one is to use unmodified ASIO:

    $ meson wrap install asio

    The second approach is to use a fork instead. The fork will need meson.build on the root directory:

    $ git clone https://gitlab.com/emilua/asio.git subprojects/asio

    Tests

    $ meson test -C build

    Some tests are more intrusive and can only be built if you enable the plugins support.

    Some fuzz tests are also available. You can configure the seed for these tests by setting the EMILUA_TEST_SEED environment variable. The envirnoment variable EMILUA_TEST_FUZZER_NITER can be used to override the number of iterations.


    1. The default profile inherits the parent execution context (no new thread is created), but the option to create a new one is also available.