rust/README.md
Paul Campbell b8b8d82104
All checks were successful
/ test (push) Successful in 4s
Version set to v0.2.7
2024-05-17 07:24:49 +01:00

919 B

docker-builder-rust

Docker image for building Rust projects with Cargo.

Usage

In a Forgejo action file, e.g. .forgejo/workflows/test.yml:

on: [push]
jobs:
  test:
    runs-on: docker
    steps:
      - uses: https://git.kemitix.net/kemitix/rust@v0.2.7
        with:
          args: test
      - uses: https://git.kemitix.net/kemitix/rust@v0.2.7
        with:
          args: build

Contents

  • nodejs
  • clang-16
  • mold
  • rust
  • cargo
  • cargo-binstall

Linking

To take advantage of the clang and mold packages, add the following to the .cargo/config.toml file in your project.

[target.x86_64-unknown-linux-gnu]
linker = "/usr/bin/clang-16"
rustflags = ["-C", "link-arg=--ld-path=/usr/bin/mold"]

Binary size

To reduce the size of the debug binary, add the following to the .cargo/config.toml file in you project.

[profile.dev]
debug = 0
strip = "debuginfo"