Skip to content

Latest commit

 

History

History
105 lines (62 loc) · 5.24 KB

lua_dependencies.md

File metadata and controls

105 lines (62 loc) · 5.24 KB

Declare runtime dependencies

These are needed for local dev, and users must install them as well. See https://docs.bazel.build/versions/main/skylark/deploying.html#dependencies

lua_register_system_toolchain

lua_register_system_toolchain(lua_path, name)

PARAMETERS

Name Description Default Value
lua_path

-

none
name

-

"lua"

lua_repositories

lua_repositories(name, lua_repository_name, platform, repo_mapping)

Fetch external tools needed for lua toolchain

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this repository. Name required
lua_repository_name - String required
platform - String required
repo_mapping In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).
Dictionary: String -> String optional

lua_system_repositories

lua_system_repositories(name, repo_mapping, target_tool_path)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this repository. Name required
repo_mapping In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).
Dictionary: String -> String optional
target_tool_path - String required

lua_toolchains

lua_toolchains = use_extension("@rules_lua//lua:repositories.bzl", "lua_toolchains")
lua_toolchains.lua(name, version)
lua_toolchains.luajit(name, version)

TAG CLASSES

lua

initialise lua toolchain

Attributes

Name Description Type Mandatory Default
name register toolchain repo with this name Name optional "lua"
version version of lua SDK String optional "v5.1.1"

luajit

initialise luajit toolchain

Attributes

Name Description Type Mandatory Default
name register toolchain repo with this name Name optional "luajit"
version version of luajit SDK String optional "v2.1"