1. The native Lua
Project¶
Lua on the platform you use with the compiler you choose
Lua is multi-paradigm programming language. Lua is cross-platform as it is written in ANSI C. Lua is licensed under MIT license. native Luas goal is to deliver a framework to build Lua on any platform with any compiler.
For information on Lua see Lua.org.
1.1. Overview¶
As default Lua requires gcc
and make
to be installed to build the
Lua binaries, therefore building for e.g., Linux or other POSIX systems where
gcc
and make
are natively available is easy. Building Lua on Windows
with MinGWs’ gcc
and some sort of make
is also straight forward.
But this does not allow a good platform and compiler independent way of building and testing Lua. Especially testing is not that simple as it should be. Therefore this project tries to implement a platform and compiler independent way of building and testing Lua.
1.2. How-To¶
Building Lua with the native Lua project requires Python 3.5 or greater and some C compiler.
1.3. Supported Platforms And Compilers¶
The current release supports the following platform/compiler combinations:
Platform |
Official Lua Releases |
native Lua Releases |
---|---|---|
aix |
gcc |
xlc*, gcc*, clang* |
bsd |
gcc |
see OpenBSD and NetBSD |
OpenBSD |
see bsd |
gcc, clang |
NetBSD |
see bsd |
gcc*, clang* |
c89 |
gcc |
all compilers* |
FreeBSD |
gcc |
gcc, clang |
generic |
gcc |
gcc (not win32), msvc (win32) |
linux |
gcc |
gcc, clang, icc* |
macOS |
gcc |
gcc, clang |
MinGW |
gcc |
see win32 |
posix |
gcc |
TODO |
solaris |
gcc |
gcc*, clang* |
win32 |
see MinGw |
msvc, gcc, clang |
cygwin |
no |
gcc, clang |
* means not or not fully tested.
1.4. Repository Structure And Code Organization¶
The repository is structured into the parts described below.
1.4.1. Root Directory¶
The root directory contains the
general project documentation (
README.md
,CHANGELOG.md
)build script and build toolchain (
wscript
,waf
,waf.bat
),required Python packages (
requirements.txt
,environment.yml
),CI scripts (
.appveyor.yml
,.cirrus.yml
,.travis.yml
,azure-pipelines.yml
,readthedocs.yml
),editor configurations (
.vscode
,.editorconfig
),coding and general guidelines (
pyproject.toml
),licensing information (
LICENSE
),and information on the
native Lua
project and the lua version (VERSION
).
1.4.2. demos
Directory¶
Some scripts demonstrating what can be done with Lua. These demos should not use libraries that do not come with the Lua interpreter.
1.4.3. docs
Directory¶
This directory contains the native Lua project documentation as well as the
official Lua documentation. The official Lua documentation is found in
_static/doc
. This documentation is also linked into the project
documentation. The main documentation files index.rst
, conf.py
and
doxygen.conf
are found here. Contribution guidelines are found in
contributing.rst
.
native Lua uses the ReadTheDocs Sphinx theme sphinx_rtd_theme
as
layout theme for the documentation.
1.4.4. src
Directory¶
This directory contains the source files downloaded from Lua.org. Trailing whitespace and additional newlines at the end of the files are removed. Furthermore the native Lua header is included (see _native_lua_config.h).
Changes are indicated by the following comment:
/* native Lua */
The lua interpreter (lua.c
) as well as the lua compiler (luac.c
) have
been changed, to indicate, that they were build based on the native Lua
project:
$ build/gcc/lua -v
Lua 5.4.0 Copyright (C) 1994-2017 Lua.org, PUC-Rio [based on native Lua (0.5.0-devel), https://github.com/swaldhoer/native-lua]
1.4.5. tests
Directory¶
This directory contains the source files downloaded from Lua.org. Trailing whitespace and additional newlines at the end of the files are removed.
Note
The encoding of test files must not be changed.
Some tests require changes to the test files in order to work on platforms. Changes are indicated by the following comment:
-- native Lua
Test files for the build toolchain have been added in tests/build
.
1.5. Links¶
1.5.1. Documentation¶
The documentation can be found on readthedocs.io.
1.5.2. Continuous Integration¶
Azure Pipelines: Linux (GCC, Clang), MacOS (Clang, GCC), Windows (MSVC, GCC, Clang)
AppVeyor: Windows (Cygwin GCC, Cygwin Clang)
Cirrus CI: Linux (GCC, Clang), FreeBSD(Clang, GCC)
Travis CI: Linux (GCC, Clang)
ReadTheDocs.org: Documentation
On Azure Pipelines’ Windows build we also run black
and pylint
.