Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
- For security vulnerabilities, do **not** open a public issue. Use private reporting per [SECURITY.md](../../SECURITY.md).
- For questions or usage help, please use Discussions instead.

fleet-router currently supports **Linux x86_64 only**. macOS/Windows are not supported for native builds; use the Docker image (`ghcr.io/eosrio/fleet-router`) there.
fleet-router is pure Rust and runs on Linux, macOS, and Windows (x86_64 and arm64). A prebuilt Docker image is also available (`ghcr.io/eosrio/fleet-router`).

- type: input
id: version
Expand All @@ -39,19 +39,18 @@ body:
id: os-arch
attributes:
label: OS and architecture
description: "Distribution/version and CPU architecture. Remember: only Linux x86_64 is supported."
description: "Operating system, distribution/version, and CPU architecture."
placeholder: "Ubuntu 24.04, x86_64"
validations:
required: true

- type: input
id: build-env
attributes:
label: Rust version and build toolchain (for build issues)
label: Rust version (for build issues)
description: >-
Output of `rustc --version` (MSRV is 1.85), and whether clang + libclang-dev were installed
(required by bindgen). Leave blank if this is not a build issue.
placeholder: "rustc 1.85.0; clang/libclang-dev installed: yes"
Output of `rustc --version` (MSRV is 1.95). Leave blank if this is not a build issue.
placeholder: "rustc 1.95.0"
validations:
required: false

Expand Down
55 changes: 27 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,44 @@ env:

jobs:
test:
name: Build, Test, and Lint
runs-on: ubuntu-latest
name: Build & Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4

# rs_abieos builds vendored C++ via bindgen, which needs a C++ toolchain
# and libclang at build time.
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --workspace --locked --verbose
- name: Test
run: cargo test --workspace --locked --verbose

- name: Install stable Rust
lint:
name: Format & Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Cache cargo registry and target
uses: Swatinem/rust-cache@v2

- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

- name: Build
run: cargo build --workspace --locked --verbose

- name: Test
run: cargo test --workspace --locked --verbose

msrv:
name: Minimum Supported Rust Version (1.85)
name: Minimum Supported Rust Version (1.95)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
- name: Install Rust 1.85
uses: dtolnay/rust-toolchain@1.85
- uses: actions/checkout@v5
- name: Install Rust 1.95
uses: dtolnay/rust-toolchain@1.95
- uses: Swatinem/rust-cache@v2
- name: Check (MSRV)
run: cargo check --workspace --locked
Expand All @@ -62,7 +61,7 @@ jobs:
name: Supply-chain audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: cargo-deny (advisories, bans, licenses, sources)
uses: EmbarkStudios/cargo-deny-action@v2
with:
Expand All @@ -72,6 +71,6 @@ jobs:
name: Docker image builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Build image
run: docker build -t fleet-router:ci .
48 changes: 32 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,54 @@ jobs:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Publish
run: cargo publish -p fleet-router --locked --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --locked --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

binary:
name: Build Linux release binary
runs-on: ubuntu-latest
binaries:
name: Release binary (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --locked
- name: Package (x86_64-unknown-linux-gnu)
run: tar -C target/release -czf fleet-router-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz fleet-router
- name: Create GitHub Release
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Package (Unix)
if: runner.os != 'Windows'
run: tar -C target/${{ matrix.target }}/release -czf fleet-router-${{ github.ref_name }}-${{ matrix.target }}.tar.gz fleet-router
- name: Package (Windows)
if: runner.os == 'Windows'
run: Compress-Archive -Path target/${{ matrix.target }}/release/fleet-router.exe -DestinationPath fleet-router-${{ github.ref_name }}-${{ matrix.target }}.zip
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: fleet-router-*.tar.gz
files: |
fleet-router-*.tar.gz
fleet-router-*.zip
generate_release_notes: true

docker:
name: Build and push image to GHCR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ First public release on crates.io and GitHub.

### Changed

- Build on the pure-Rust `rs_abieos` backend (`rust-backend`): fleet-router now
compiles on **Linux, macOS, and Windows** (x86_64 and arm64) with no C/C++
toolchain, `clang`, or `libclang`.
- The CLI `--version` now derives from `Cargo.toml` (`CARGO_PKG_VERSION`).
- The connection counter is now an atomic, decremented synchronously and
underflow-safely when a connection ends.
Expand Down
34 changes: 10 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,14 @@ project spaces and interactions.

## Prerequisites

fleet-router builds on **Linux x86_64 only**. The `rs_abieos` build script
panics with "Unsupported OS" on macOS and Windows. On those platforms, use the
published Docker image (`ghcr.io/eosrio/fleet-router`) instead of a native
build.
fleet-router is pure Rust and builds on **Linux, macOS, and Windows** (x86_64
and arm64) — no C/C++ toolchain, `clang`, or `libclang` required. See the
[Requirements section in the README](README.md#requirements-and-supported-platforms).

You need the following to build from source. See the
[Requirements section in the README](README.md#requirements-and-supported-platforms) for the full
rationale.
You need:

- Linux x86_64
- Rust **1.95+** (the Minimum Supported Rust Version, required by `rs_abieos`)
- `git`
- A C/C++ toolchain plus `clang` and `libclang-dev` (the `rs_abieos` build
script compiles vendored C++ and uses `bindgen`, which needs `libclang`)
- Rust **1.85+** (the Minimum Supported Rust Version — a transitive dependency
uses the 2024 edition)

On Debian/Ubuntu, install the system packages with:

```bash
sudo apt-get install -y git clang libclang-dev build-essential
```

Install Rust via [rustup](https://rustup.rs/) if you do not already have a
toolchain:
Expand All @@ -52,10 +39,8 @@ cd fleet-router
cargo build
```

The first build compiles the vendored C++ in `rs_abieos`, so expect it to take
longer than a typical Rust build. `Cargo.lock` is committed; CI and releases
build with `--locked`, so do not delete or regenerate it unless your change
intentionally updates dependencies.
`Cargo.lock` is committed; CI and releases build with `--locked`, so do not
delete or regenerate it unless your change intentionally updates dependencies.

## Testing

Expand Down Expand Up @@ -99,8 +84,9 @@ Notes:
- `cargo fmt --all` reformats your changes. CI runs `cargo fmt --all -- --check`
and fails if anything is unformatted.
- Clippy must be clean: `-D warnings` turns every warning into an error.
- CI runs these commands with `--locked` and also runs an MSRV check against
Rust 1.85, a `cargo-deny` supply-chain scan (advisories, bans, licenses,
- CI runs these commands with `--locked` across Linux, macOS, and Windows, and
also runs an MSRV check against Rust 1.95, a `cargo-deny` supply-chain scan
(advisories, bans, licenses,
sources), and a Docker image build. Keeping the three commands above green
locally covers the parts you are most likely to break.

Expand Down
Loading
Loading