Skip to content

fix(docs): find cargo's target directory through cargo metadata - #8

Merged
HaoZeke merged 2 commits into
mainfrom
fix/demo-target-dir
Nov 16, 2026
Merged

HaoZeke merged 2 commits into
mainfrom
fix/demo-target-dir

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

scripts/build-docs.sh and docs/examples/sidecar-demo.sh now ask cargo metadata for the target directory, and the docs workflow builds with CARGO_TARGET_DIR outside the checkout.

  • The scripts read target/ under the checkout, where cargo puts neither binaries nor API docs when CARGO_TARGET_DIR or a configured target-dir points elsewhere. The demo then ran stale binaries or none, and with the target directory outside the checkout the docs job stopped at demo_key.
  • The scripts take the target directory from cargo metadata, which resolves CARGO_TARGET_DIR, CARGO_BUILD_TARGET_DIR and a configured build.target-dir. The docs job now builds that way. With the target directory outside the checkout the docs job's steps pass and docs/src/output is unchanged, as it is with the default target/.

The branch has a towncrier fragment.

sidecar-demo.sh runs the binaries from target/debug under the checkout
and build-docs.sh copies the API docs from target/doc, where cargo puts
neither when CARGO_TARGET_DIR or a configured target-dir points
elsewhere. The demo then runs stale binaries or none: with the target
directory outside the checkout, build-docs.sh stops with status 127 at
demo_key, the sidecar transcript is emptied and no API docs reach the
book. The docs job now builds that way, which fails until the scripts
ask cargo where its target directory is.
sidecar-demo.sh and build-docs.sh take the target directory from
cargo metadata, which resolves CARGO_TARGET_DIR, CARGO_BUILD_TARGET_DIR
and a configured build.target-dir the way the builds before them did, as
the workflows already read Cargo.toml with python3. The demo runs the
binaries regen-doc-output.sh just built and the book gets the API docs
cargo doc just wrote. With the target directory outside the checkout
the docs job's steps pass and docs/src/output is unchanged, as it is
with the default target/.
@HaoZeke
HaoZeke merged commit 3ef2d99 into main Nov 16, 2026
6 checks passed
@HaoZeke
HaoZeke deleted the fix/demo-target-dir branch November 16, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant