Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2.33 KB

development.md

File metadata and controls

74 lines (52 loc) · 2.33 KB

Development

Install rustup before working from a checkout. Cargo uses rust-toolchain.toml to select and install the pinned Rust release and Clippy. Local builds also require FFmpeg 8 development libraries, Clang, pkg-config, and C/C++ build tools; the Dockerfile records the Linux build dependencies.

Before submitting changes, run the lint check used by CI and the server tests:

cargo clippy --locked --workspace --all-targets -- -D warnings
cargo test --locked -p lyra-server

To run Clippy with the image’s build dependencies:

docker build --target clippy .

Keep GitLab’s Pipelines must succeed merge check enabled, including on forks.

Rust formatting uses nightly separately from the pinned build toolchain:

rustup toolchain install nightly --component rustfmt
cargo +nightly fmt

When updating rust-toolchain.toml, resolve new lint and test failures in the same change.

See testing for plugin scenarios and Luau tests, and commit conventions when preparing changes.

Cargo installation

For local development, install the build prerequisites above, then install the server from a checkout so the pinned toolchain applies:

cargo install --locked --path lyra-server
lyra serve

For a frontend, build lyra-web and set LYRA_STATIC_DIR to its output.

See plugin repositories to install plugins.

Startup library

To create and scan a library at startup, add a library block to config.json:

{
  "library": {
    "path": "/music",
    "name": "Music",
    "language": "en",
    "country": "US"
  }
}

Use a path visible to the server. path is required. name defaults to Music. language and country are optional; language accepts ISO 639-1 or 639-3 codes or English names, and country accepts country codes or names.

Docker builds

Full image builds require a lyra-web commit SHA in LYRA_WEB_GIT_HASH. To build with its current main, as CI does:

LYRA_WEB_GIT_HASH=$(git ls-remote https://github.com/lyra-org/lyra-web.git refs/heads/main | cut -f1)
docker build \
  --build-arg LYRA_GIT_HASH="$(git rev-parse HEAD)" \
  --build-arg LYRA_WEB_GIT_HASH="$LYRA_WEB_GIT_HASH" \
  -t lyra:local .