Repository navigation
fix(docs): find cargo's target directory through cargo metadata - #8
Merged
Merged
Conversation
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/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/build-docs.shanddocs/examples/sidecar-demo.shnow askcargo metadatafor the target directory, and the docs workflow builds withCARGO_TARGET_DIRoutside the checkout.target/under the checkout, where cargo puts neither binaries nor API docs whenCARGO_TARGET_DIRor 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 atdemo_key.cargo metadata, which resolvesCARGO_TARGET_DIR,CARGO_BUILD_TARGET_DIRand a configuredbuild.target-dir. The docs job now builds that way. With the target directory outside the checkout the docs job's steps pass anddocs/src/outputis unchanged, as it is with the defaulttarget/.The branch has a towncrier fragment.