[FIX][Rust] Let docs.rs build tvm-ffi and correct the Rust setup docs - #839
Merged
Seven-Streams merged 2 commits intoOct 6, 2026
Merged
Seven-Streams merged 2 commits into
Seven-Streams merged 2 commits into
Conversation
Signed-off-by: yuchuan <yuchuan.7streams@gmail.com>
Signed-off-by: yuchuan <yuchuan.7streams@gmail.com>
tlopex
approved these changes
Oct 6, 2026
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.
The docs.rs build of
tvm-ffi0.1.14 failed(https://docs.rs/crate/tvm-ffi/0.1.14/builds/4724950):
rust/tvm-ffi/build.rsruns
tvm-ffi-configunconditionally and panics when it is missing, which isthe case on docs.rs and in
docs/conf.py, which setsDOCS_RSthe same way.Bring the script in line with
rust/tvm-ffi-sys/build.rs(#825):DOCS_RS, warn and skip the loader-path setup instead of panicking.tvm-ffi-config --libdirasan error, and report the exit status and stderr.
tvm-ffi-syswhenDOCS_RSis notset.
DOCS_RS,PATH, the loader-path variable, orbuild.rschanges, so switching the Python environment updates theLD_LIBRARY_PATHbaked intocargo runandcargo testinstead of keepingthe previous library directory.
Also fix two Rust documentation issues:
rust/README.mdclaimed the build sets the dynamic loader path forcargo runandcargo test. That only holds inside this workspace: Cargoapplies
rustc-envfrom the running package's own build script and dropsrustc-link-searchpaths outside the target directory, so downstream cratesmust set
LD_LIBRARY_PATHthemselves, including forcargo runandcargo test.docs/guides/rust_lang_guide.mdstill pointed published users attvm-ffi = "0.1.0-alpha.0"; use0.1.14.Validation: with no
tvm-ffi-configon PATH,DOCS_RS=1 cargo doc --no-deps -p tvm-ffinow succeeds with a warning (it previously panicked at build.rs:69)and a plain
cargo build -p tvm-ffistill fails, now with the installguidance. With the Python package installed,
cargo test -p tvm-ffi --test test_functionandcargo run --example load_library --features examplepass;switching PATH between two environments reruns the build script and bakes the
new library directory, and an unchanged PATH does not rerun it. pre-commit
passed on all files.