Errors from cargo build.rs script do not appear in vscode problem view when command line cargo build fails as expected #18999
Unanswered
bruceskingle
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am developing a code generator as a rust build script.
Errors and warnings in rust code appear in the Problems view of vscode and the output of
cargo build
, as expected.Errors generated by build.rs are detected by
cargo build
and cause the build to fail:The unused variable warning above appears in the vscode problems view, but the errors and warnings from build.rs do not.
build.rs is reporting errors by emitting lines like
on stdout.
The builder crate and a test crate for it are both in a cargo workspace and vscode sees the whole workspace.
If a change is made to the source of the builder crate vscode re-runs the builder on file save and changes in the generated code (in $OUT_DIR) appear as expected.
As far as I can tell, everything is working as expected except that warnings and errors from build.rs don't show up in the Problems view of vscode, even if build.rs panics vscode does not display any error or warning.
I am on the latest stable versions of rust, cargo and the vscode rust analyser extension.
I have tried making build.rs exit 0, exit non-zero and panic.
I have googled for known problems without success.
Does anyone have any idea what the problem is? Has anyone made errors from build.rs appear in the Problems view of vscode?
Beta Was this translation helpful? Give feedback.
All reactions