admin管理员组文章数量:1123586
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:
warning: unused variable: `error`
--> sparko_graphql_builder_test/build.rs:11:16
|
11 | if let Err(error) = build() {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_error`
|
= note: `#[warn(unused_variables)]` on by default
warning: `sparko_graphql_builder_test` (build script) generated 1 warning
error: [email protected]: OptionalNonNullFieldError(Pos(4:5), "float")
warning: [email protected]: Build failed with 1 errors and 0 warnings
error: failed to run custom build command for `sparko_graphql_builder_test v0.1.0 (/Users/bruce/git/sparko_graphql/sparko_graphql_builder_test)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `/Users/bruce/git/sparko_graphql/target/debug/build/sparko_graphql_builder_test-980f47bb930579b0/build-script-build` (exit status: 1)
--- stdout
cargo::rerun-if-changed=build.rs
cargo::rerun-if-changed=graphql_builder/src/lib.rs
cargo::rerun-if-changed=graphql/schema/example.graphql
cargo::rerun-if-changed=graphql/query/example/get-luke.graphql
cargo::error=OptionalNonNullFieldError(Pos(4:5), "float")
cargo::warning=Build failed with 1 errors and 0 warnings
%
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, which makes using the code generator hard (I have to run cargo build from the command line to see the errors, but there is no obvious clue that build.rs is reporting errors from inside vscode).
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?
本文标签:
版权声明:本文标题:visual studio code - Errors from cargo build.rs script do not appear in vscode problem view when command line cargo build fails 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736584602a1944994.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论