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
36 changes: 36 additions & 0 deletions .github/actions/rust-toolchain/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: Apache-2.0

name: Rust toolchain
description: >-
Install the toolchain from packages/diskgraph/rust-toolchain.toml with the
runner's rustup and make it the default.
inputs:
components:
description: Additional rustup components, space separated.
required: false
default: ''
runs:
using: composite
steps:
- name: Install the pinned Rust toolchain
shell: bash
working-directory: packages/diskgraph
env:
COMPONENTS: ${{ inputs.components }}
run: |
set -euo pipefail
rustup toolchain install --profile minimal --no-self-update
toolchain="$(rustup show active-toolchain | cut -d' ' -f1)"
rustup default "$toolchain"
if [ -n "$COMPONENTS" ]; then
# shellcheck disable=SC2086 # space-separated list
rustup component add --toolchain "$toolchain" $COMPONENTS
fi
if [ "$RUNNER_OS" != Windows ]; then
echo "CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}" >> "$GITHUB_ENV"
fi
[ -n "${CARGO_INCREMENTAL+set}" ] || echo CARGO_INCREMENTAL=0 >> "$GITHUB_ENV"
[ -n "${CARGO_TERM_COLOR+set}" ] || echo CARGO_TERM_COLOR=always >> "$GITHUB_ENV"
rustc --version --verbose
4 changes: 1 addition & 3 deletions .github/workflows/_diskgraph-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ jobs:
with:
packages: lld
- if: steps.cache.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: ${{ steps.settings.outputs.RUST_TOOLCHAIN }}
uses: ./.github/actions/rust-toolchain
- if: steps.cache.outputs.cache-hit != 'true'
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/kumo-engine-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ jobs:
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
- uses: ./.github/actions/rust-toolchain
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
with:
workspaces: packages/diskgraph -> target
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/kumo-engine-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ jobs:
python scripts/stamp_version.py --check

- name: Set up Rust
# This org's Actions allowlist only permits dtolnay/rust-toolchain at
# @master or a pinned SHA, not @stable.
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master, allowlisted
with:
toolchain: stable
uses: ./.github/actions/rust-toolchain

- name: Activate installed MSVC build tools
if: ${{ runner.os == 'Windows' }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,7 @@ jobs:
timeout-minutes: 12
with:
packages: lld
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
# Pinned: a new stable clippy adds lints that fail unchanged code.
toolchain: 1.98.1
- uses: ./.github/actions/rust-toolchain
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: '3.11'
Expand Down Expand Up @@ -404,10 +401,8 @@ jobs:
timeout-minutes: 12
with:
packages: lld
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
- uses: ./.github/actions/rust-toolchain
with:
# Pinned: a new stable clippy adds lints that fail unchanged code.
toolchain: 1.98.1
components: clippy
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
Expand Down
2 changes: 2 additions & 0 deletions packages/diskgraph/diskgraph-core/src/dataset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ pub struct DatasetStatus {
/// Contract for dataset lifecycle management. Implementations may keep their
/// state purely in-memory or persist it on disk alongside the graph data.
#[async_trait]
// async-trait's generated #[must_use]; fixed in clippy 1.100.
#[allow(clippy::double_must_use)]
pub trait DatasetRegistry: Send + Sync {
/// Insert or update a dataset handle. Typically invoked at the beginning of
/// ingestion after parsing index_metadata.json.
Expand Down
2 changes: 2 additions & 0 deletions packages/diskgraph/diskgraph-core/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ impl StorageConfig {

/// Contract implemented by storage backends (local disk, remote cache, etc.).
#[async_trait]
// async-trait's generated #[must_use]; fixed in clippy 1.100.
#[allow(clippy::double_must_use)]
pub trait GraphStorage: Send + Sync {
/// Reserve disk space for a dataset. Implementations must enforce the
/// max_disk_fraction guard and fail fast if the reservation would exceed
Expand Down
7 changes: 7 additions & 0 deletions packages/diskgraph/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Pinned: a new stable clippy adds lints that fail unchanged code.
[toolchain]
channel = "1.99.1"
14 changes: 10 additions & 4 deletions scripts/diskgraph
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,25 @@ PY
}

# CI wheel build settings; the wheel cache key covers them.
WHEEL_RUST_TOOLCHAIN=1.98.1
WHEEL_RUSTFLAGS='-C target-feature=+aes,+sse2 -C link-arg=-fuse-ld=lld -C debuginfo=line-tables-only'

wheel_rust_toolchain() {
sed -n 's/^channel = "\(.*\)"$/\1/p' "${DISKGRAPH_SOURCE}/rust-toolchain.toml"
}

cmd_wheel_env() {
printf 'RUST_TOOLCHAIN=%s\nRUSTFLAGS=%s\n' "$WHEEL_RUST_TOOLCHAIN" "$WHEEL_RUSTFLAGS"
local toolchain
toolchain="$(wheel_rust_toolchain)"
printf 'RUST_TOOLCHAIN=%s\nRUSTFLAGS=%s\n' "$toolchain" "$WHEEL_RUSTFLAGS"
}

cmd_wheel_key() {
require_source
local tree settings
local tree settings toolchain
tree="$(git -C "$REPO_ROOT" rev-parse HEAD:packages/diskgraph)"
toolchain="$(wheel_rust_toolchain)"
settings="$(cmd_wheel_env | sha256sum | cut -c1-12)"
echo "diskgraph-wheel-v2-${RUNNER_OS:-$(uname -s)}-${RUNNER_ARCH:-$(uname -m)}-${tree}-rust${WHEEL_RUST_TOOLCHAIN}-${settings}"
echo "diskgraph-wheel-v2-${RUNNER_OS:-$(uname -s)}-${RUNNER_ARCH:-$(uname -m)}-${tree}-rust${toolchain}-${settings}"
}

command="${1:-}"
Expand Down
Loading