Skip to content

rust-project check cannot emit compile errors, only warnings, when used with system_rust_toolchain #402

@cormacrelf

Description

@cormacrelf

Observed:

$ rust-project check path/to/file.rs

# (no output)

Failure path:

  1. A rust library can have an error in it. Imagine path/to/file.rs contains a syntax error.
  2. rust-project check path/to/file.rs executes prelude//rust/rust-analyzer/check.bxl:check with some additional command line args including "-c=rust.failure_filter=true" "-c=rust.incremental=true"
  3. The file is resolved to a bunch of targets that include it using the owner() cquery
  4. Those targets are built with the diag.json subtarget, e.g. //path/to:lib[diag.json]
  5. The failure_filter machinery is not engaged at all for system_rust_toolchain. The legacy config settings from step 2 are not read anywhere. The rust rules try to read toolchain_info.failure_filter but it is always false because it is never given a value anywhere, you can't even set it manually on system_rust_toolchain.
  6. Those builds fail because of the syntax error in file.rs
  7. No artifacts are found for those builds because the builds weren't prevented from failing
  8. The bxl can't see the diag.json artifacts
  9. Empty output.

Is the solution to create create config_settings for these and use them for the system_rust_toolchain defaults?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions