From 6121450b146d29e9807116fbadc463aef69c9148 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Sep 2026 21:06:33 +0000 Subject: [PATCH] Give CI the ndarray sibling its own cargo config demands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both new jobs fail before compiling anything: error: failed to load source for dependency `ndarray` Caused by: unable to update /home/runner/work/a2ui-rs/ndarray `.cargo/config.toml` patches the `AdaWorldAPI/ndarray` git coordinate to `path = "../ndarray"`, so every cargo invocation in this repository — `cargo fmt` included, since it resolves the workspace through `cargo metadata` — looks for a sibling checkout. That file calls itself a local development override the shipped build never sees, and it is right about the Railway image, whose Dockerfile copies only the manifests and `crates/`. It is wrong about CI. The file is committed, so a runner checks it out and cargo honours it. Nothing had ever run cargo here before this week, which is why the assumption held until the gate arrived to test it. Deleting the override to suit CI would discard a deliberate operator ruling — prefer the local fork source over a fetch — so the jobs give CI the sibling instead. `actions/checkout` cannot write outside $GITHUB_WORKSPACE, so this repository goes into a named subdirectory with `ndarray` beside it, the shape lance-graph's own `style.yml` already uses. Each `setup-rust-toolchain` gains `rust-src-dir`. That is not incidental: `defaults.run.working-directory` governs `run:` steps only, so without it the action reads no `rust-toolchain.toml` and installs `stable` rather than the pin — the same trap this sweep hit in lance-graph-java, caught there by a test. Verified in the layout CI now reproduces: `cargo metadata` resolves, which is the step that was failing, and `cargo fmt --all --check` is clean. Clippy and the test suite are CI's to measure — the workspace pulls a wgpu fork and is larger than this machine can build. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01AGVLyRZNEKKBSfBDJfbY3V --- .github/workflows/lint.yml | 64 +++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0512f8f..9e6e741 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,14 +12,48 @@ concurrency: permissions: contents: read +# `.cargo/config.toml` in this repository carries +# +# [patch."https://github.com/AdaWorldAPI/ndarray"] +# ndarray = { path = "../ndarray" } +# +# so every cargo invocation here — including `cargo fmt`, which resolves the +# workspace through `cargo metadata` — redirects the `ndarray` git coordinate +# to a SIBLING checkout and fails without one. That file describes itself as a +# local development override that the shipped build never sees, and it is right +# about the Railway image, whose Dockerfile copies only the manifests and +# `crates/`. It is wrong about CI: the file is committed, so a runner checks it +# out and cargo honours it. +# +# Rather than delete a deliberate operator ruling ("prefer the local/fork source +# over the registry, always") to suit CI, the jobs below give CI the sibling the +# override expects. `actions/checkout` cannot write outside `$GITHUB_WORKSPACE`, +# so this repository is checked out into a NAMED subdirectory and `ndarray` +# beside it — the same shape `AdaWorldAPI/lance-graph`'s own `style.yml` uses. jobs: format: runs-on: ubuntu-latest timeout-minutes: 15 + defaults: + run: + working-directory: a2ui-rs steps: - uses: actions/checkout@v4 + with: + path: a2ui-rs + - name: Checkout AdaWorldAPI/ndarray (sibling the .cargo patch points at) + uses: actions/checkout@v4 + with: + repository: AdaWorldAPI/ndarray + path: ndarray - uses: actions-rust-lang/setup-rust-toolchain@v1 with: + # `defaults.run.working-directory` applies to `run:` steps only, never + # to action steps — this one executes from $GITHUB_WORKSPACE, where the + # checkout is a subdirectory and no toolchain file is visible, and would + # silently install `stable` instead of the pin. `rust-src-dir` is the + # input that points it at the checkout. + rust-src-dir: a2ui-rs # No `toolchain:` input — the action reads `rust-toolchain.toml`, so the # pinned version lives in exactly ONE place. components: rustfmt, clippy @@ -28,25 +62,47 @@ jobs: clippy: runs-on: ubuntu-latest timeout-minutes: 30 + defaults: + run: + working-directory: a2ui-rs steps: - uses: actions/checkout@v4 + with: + path: a2ui-rs + - name: Checkout AdaWorldAPI/ndarray (sibling the .cargo patch points at) + uses: actions/checkout@v4 + with: + repository: AdaWorldAPI/ndarray + path: ndarray - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - # No `toolchain:` input — the action reads `rust-toolchain.toml`, so the - # pinned version lives in exactly ONE place. + rust-src-dir: a2ui-rs components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 + with: + workspaces: a2ui-rs - run: cargo clippy --all-targets -- -D warnings test: runs-on: ubuntu-latest timeout-minutes: 30 + defaults: + run: + working-directory: a2ui-rs steps: - uses: actions/checkout@v4 + with: + path: a2ui-rs + - name: Checkout AdaWorldAPI/ndarray (sibling the .cargo patch points at) + uses: actions/checkout@v4 + with: + repository: AdaWorldAPI/ndarray + path: ndarray - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - # No `toolchain:` input — the action reads `rust-toolchain.toml`, so the - # pinned version lives in exactly ONE place. + rust-src-dir: a2ui-rs components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 + with: + workspaces: a2ui-rs - run: cargo test --workspace