Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5241122
native_module: put ~/.cargo/bin on the auto-build PATH when cargo is …
jeff-hykin Aug 30, 2026
112c9d5
Revert "native_module: put ~/.cargo/bin on the auto-build PATH when c…
jeff-hykin Aug 30, 2026
0d216be
native modules: build the rust workspace crates through the repo flake
jeff-hykin Aug 30, 2026
4cd942a
Merge remote-tracking branch 'origin/main' into _flake_work
jeff-hykin Aug 31, 2026
6ab3467
native modules: keep build_command a literal for the publish gate
jeff-hykin Aug 31, 2026
7a4f671
native modules: drop the build_command comments
jeff-hykin Aug 31, 2026
e4eb3f8
Point rust nix shells at a tiny toolchain flake
jeff-hykin Aug 31, 2026
12c5ae2
Build the rust native modules with a nix derivation
jeff-hykin Aug 31, 2026
ac844e9
Merge remote-tracking branch 'origin/main' into jeff/fix/native_build…
jeff-hykin Aug 31, 2026
6d274a2
Update the workspace cargoHash for main's Cargo.lock bump
jeff-hykin Sep 1, 2026
8a9dc1a
Let each native module declare its own build inputs
jeff-hykin Sep 1, 2026
d08156f
Find the native module deps.nix files instead of listing them
jeff-hykin Sep 1, 2026
d06824e
Vendor the rust workspace from Cargo.lock instead of an aggregate hash
jeff-hykin Sep 1, 2026
7d19b37
Revert "Vendor the rust workspace from Cargo.lock instead of an aggre…
jeff-hykin Sep 1, 2026
5def8fd
Record why cargoLock.lockFile cannot replace the aggregate hash
jeff-hykin Sep 1, 2026
7ea8f45
Merge remote-tracking branch 'origin/main' into jeff/fix/native_build…
jeff-hykin Sep 1, 2026
701453c
Re-paste cargoHash for the Cargo.lock main brought in
jeff-hykin Sep 1, 2026
8b4e3fa
Build native modules with crate2nix instead of one cargoHash
jeff-hykin Sep 1, 2026
c70d595
Build the example native modules too
jeff-hykin Sep 1, 2026
3f6653f
Stop committing crate-hashes.json
jeff-hykin Sep 1, 2026
776cb45
Pin cargo, not just crate2nix, when regenerating Cargo.nix
jeff-hykin Sep 1, 2026
0e1d204
Describe crate-config.nix as the placeholder it actually is
jeff-hykin Sep 1, 2026
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
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,33 @@ jobs:
- name: Bake e2e tests
run: uv run pytest -m bake_e2e dimos/cli/bake/test_bake_e2e.py --no-cov

cargo-nix-current:
# Cargo.nix is generated from Cargo.lock and gives every crate its own
# derivation, which is what lets one module rebuild without the others.
# It is the successor to an aggregate `cargoHash`, and the reason it is an
# improvement is this job: a stale generated file is a diff CI can print,
# where a stale hash was a number a human had to re-paste from a failed
# build. Note this fires on lock changes from main too, because CI builds
# the merge commit.
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read # For checkout

steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Nix
run: bash docker/ros/install-nix.sh
- name: Regenerate Cargo.nix
run: bin/regen-cargo-nix
- name: Fail if the committed Cargo.nix is stale
run: |
if ! git diff --exit-code -- Cargo.nix; then
echo "::error::Cargo.nix is out of date — run bin/regen-cargo-nix and commit the result"
exit 1
fi

cpp:
timeout-minutes: 30
runs-on: ubuntu-latest
Expand Down Expand Up @@ -949,6 +976,7 @@ jobs:
needs:
- lint
- rust
- cargo-nix-current
- cpp
- md-babel
- web
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ build/
result
result-*

# crate2nix's prefetch cache. Deliberately not committed: its keys are scoped
# to a git dependency's *branch* with no rev, so a committed copy goes stale
# the moment that branch moves. Cargo.nix already carries the hashes.
crate-hashes.json

# Editor and OS files
.vscode/
.DS_Store
Expand Down
26 changes: 18 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,21 @@ repos:
rev: v4.6.0
hooks:
- id: check-case-conflict
# These three rewrite bytes, so they are kept off files that must stay
# byte-identical to something outside this repo: patches (upstream
# diffs), and Cargo.nix, which bin/regen-cargo-nix reproduces verbatim
# and the cargo-nix-current CI job diffs. crate2nix ends it with a blank
# line; reformatting it here would fail that job on every run, because
# CI does not run these hooks.
- id: trailing-whitespace
language: python
types: [text]
exclude: \.patch$ # patch files contain intentional trailing whitespace
exclude: &verbatim-files (\.patch$|^Cargo\.nix$)
- id: end-of-file-fixer
exclude: \.patch$ # keep patch files byte-identical to upstream diffs
exclude: *verbatim-files
- id: mixed-line-ending
args: [--fix=lf]
exclude: \.patch$ # keep patch files byte-identical to upstream diffs
exclude: *verbatim-files
- id: check-json
exclude: ^misc/DimSim/public/sims/ # LFS-tracked
- id: check-toml
Expand Down Expand Up @@ -137,7 +143,7 @@ repos:
- id: cargo-fmt
name: cargo fmt
entry: |
bash -c '
nix develop path:nix/rust -c bash -c '
set -euo pipefail
git ls-files "*Cargo.toml" | while read -r m; do
cargo locate-project --manifest-path "$m" --workspace --message-format plain
Expand All @@ -152,14 +158,18 @@ repos:
- id: cargo-clippy
name: cargo clippy
entry: |
bash -c '
nix develop path:nix/rust -c bash -c '
set -euo pipefail
git ls-files "*Cargo.toml" | while read -r m; do
cargo locate-project --manifest-path "$m" --workspace --message-format plain
done | sort -u | while read -r root; do
# A crate with its own flake carries system deps the root shell lacks.
if [ -f "$(dirname "$root")/flake.nix" ]; then
nix develop "path:$(dirname "$root")" -c cargo clippy --manifest-path "$root" --workspace --all-targets -- -D warnings
dir=$(dirname "$root")
# A module crate with its own flake carries system deps the toolchain
# shell lacks. The repo-root flake is skipped on purpose: a flake ref
# copies its whole source tree into the store, and that tree is the
# entire repository.
if [ "$dir" != "$(git rev-parse --show-toplevel)" ] && [ -f "$dir/flake.nix" ]; then
nix develop "path:$dir" -c cargo clippy --manifest-path "$root" --workspace --all-targets -- -D warnings
else
cargo clippy --manifest-path "$root" --workspace --all-targets -- -D warnings
fi
Expand Down
Loading
Loading