diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bcedd83..53f70a89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [0.18.0-alpha.0] +- Add support for multiple Lua versions, including 5.1, 5.3 and 5.4 (the default) +- Add implementations of `FromLua` and `ToLua` for `[T;N]`. + +## [0.17.1] +- Add "lua-compat-mathlib" feature, which enables Lua's LUA_COMPAT_MATHLIB + option. +- Bump num-traits version to 0.2.14 and fix some incompatibilities +- Fix some tests from improved diagnostics in recent rustc. + ## [0.17] - API incompatible change: depend on `bstr` crate and implement `ToLua` / `FromLua` for `BString` and `BStr` types (thanks @azdle!) diff --git a/Cargo.toml b/Cargo.toml index d00a0b63..6b84e8f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.18.0-alpha.0" authors = ["kyren "] edition = "2018" description = "High level bindings to Lua 5.x" -repository = "https://github.com/kyren/rlua" +repository = "https://github.com/amethyst/rlua" documentation = "https://docs.rs/rlua" readme = "README.md" keywords = ["lua"] @@ -44,6 +44,17 @@ builtin-lua53 = ["cc"] system-lua51 = ["pkg-config"] system-lua53 = ["pkg-config"] system-lua54 = ["pkg-config"] +builtin-lua = ["cc"] +# Uses pkg-config to find an appropriate lua 5.3 library to link with. All of +# the caveats about disabling the default builtin-lua feature apply here as +# well. If neither the builtin-lua nor the system-lua feature is enabled, then +# no lua library will be linked at all and one must be linked with or built into +# the final binary manually. The builtin-lua and system-lua features are +# mutually exclusive and enabling both will cause an error at build time. +system-lua = ["pkg-config"] + +# Enabled functions from the math module that have been deprecated +lua-compat-mathlib = [] [dependencies] libc = { version = "0.2" } diff --git a/README.md b/README.md index 92d7ecd0..174a9710 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # rlua -- High level bindings between Rust and Lua -[![Build Status](https://img.shields.io/circleci/project/github/kyren/rlua.svg)](https://circleci.com/gh/kyren/rlua) +[![Build Status](https://img.shields.io/circleci/project/github/amethyst/rlua.svg)](https://circleci.com/gh/amethyst/rlua) [![Latest Version](https://img.shields.io/crates/v/rlua.svg)](https://crates.io/crates/rlua) [![API Documentation](https://docs.rs/rlua/badge.svg)](https://docs.rs/rlua) @@ -22,14 +22,34 @@ something you feel could perform better, feel free to file a bug report. ## API stability Currently, this library follows a pre-1.0 semver, so all API changes should be -accompanied by 0.x version bumps. +accompanied by 0.x version bumps. See the [Version 1.0 +milestone](https://github.com/amethyst/rlua/milestone/1) for the work planned +to be done before a more stable 1.0 release. -*The new 0.16 release has a particularly large amount of API breakage which was -required to fix several long-standing limitations and bugs. The biggest change -by far is that most API usage now takes place through `Lua::context` callbacks -rather than directly on the main `Lua` state object. See CHANGELOG.md for -information about other API changes, and also see the guided tour for an example -of using the new `Context` API.* +## Lua versions supported + +As of release 0.18, the version of Lua can be configured at build time using +Cargo features. Lua 5.4 is the default. The rlua API stays the same with +different Lua versions, though there are a small number of limitations. Lua +code may, of course, behave a little differently between the versions. + +Only one can be selected at a time, so to select anything +other than the default (built-in Lua 5.4) you will need to disable default +features. + +The available features are: + +| Cargo feature | Lua version | +| ------------- | ----------- | +| builtin-lua54 | Lua 5.4 (source included in crate, default) | +| builtin-lua53 | Lua 5.3 (source included in crate) | +| system-lua51 | Lua 5.1 (installed on host system, found using pkg-config) | +| system-lua53 | Lua 5.3 (installed on host system, found using pkg-config) | +| system-lua54 | Lua 5.4 (installed on host system, found using pkg-config) | + +At current writing rlua has not been tested with alternative Lua +implementations (such as Luajit) which share PUC-Rio Lua's C API, but it is +expected that they can be made to work with little if any change to rlua. ## Safety and Panics @@ -79,7 +99,7 @@ If you encounter them, a bug report would be very welcome: define set. Any abort caused by this internal Lua API checking is definitely a bug, and is likely to be a soundness bug because without `LUA_USE_APICHECK` it would likely instead be UB. - * Lua C API errors are handled by lonjmp. All instances where the Lua C API + * Lua C API errors are handled by longjmp. All instances where the Lua C API would otherwise longjmp over calling stack frames should be guarded against, except in internal callbacks where this is intentional. If you detect that `rlua` is triggering a longjmp over your Rust stack frames, this is a bug! diff --git a/RELEASE.md b/RELEASE.md index 91001fdb..f7edcd31 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -5,7 +5,9 @@ * For a maintenance release: * Check if there are any bugfixes on master which should be included * Update version number in Cargo.toml +* Check other fields in Cargo.toml are sensible * Check that CI is passing +* Tag the commit for the release * Run `cargo publish` * Check that the version from crates.io looks good * Update version number on branch to (next version)-alpha. diff --git a/build.rs b/build.rs index d7da2935..b1b827d2 100644 --- a/build.rs +++ b/build.rs @@ -104,6 +104,9 @@ fn main() { if cfg!(debug_assertions) { config.define("LUA_USE_APICHECK", None); } + if cfg!(feature = "lua-compat-mathlib") { + config.define("LUA_COMPAT_MATHLIB", None); + } config .include("lua5.3/src")