-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust-project check
cannot emit compile errors, only warnings, when used with system_rust_toolchain
#402
Comments
Ugh, I should've documented this a little better, but the path you pass to
That doesn't seem great, but I haven't looked too closely at this detail. Also, why do you consider those settings to be legacy? |
Lol, I made an almost identical patch to rust analyzer to try it out. It does go! Re the absolute paths, yeah I had figured that out, just didn't write them that way in the issue for whatever reason. Rust analyzer gives you absolute paths anyway, but it did need a doc on the command line probably. I worked out that if you patch prelude to apply failure_filter = True to the RustToolchainInfo provider, then rust-project works. So that proved the configs weren't being applied otherwise. Grepping the buck2 codebase for failure_filter also showed this. I referred to those configs as legacy because they're documented under the legacy path in the docs https://buck2.build/docs/legacy/files-and-directories/dot-buckconfig/. I'm sure I also read somewhere, probably an issue on here, that much of the buckconfig is deprecated in favour of using platforms and constraints. I would guess they are still in use internally because so much code was using them from buck v1. Edit, as of half an hour ago: https://buck2.build/docs/rfcs/drafts/cfg-modifiers/api/ It would certainly be possible to configure the toolchain using a constraint for failure_filter. You would probably need the constraint to be applied in both the target and exec platforms so as to compile proc macros with failure filter as well (once the new plugins work lands for those and they become exec deps). |
Heh, yeah. I could've sworn I deliberately hid the
Gotcha, that's useful to know.
I didn't consider the interactions there, but I don't think you're wrong. I think the main issue with |
Observed:
$ rust-project check path/to/file.rs # (no output)
Failure path:
path/to/file.rs
contains a syntax error.rust-project check path/to/file.rs
executesprelude//rust/rust-analyzer/check.bxl:check
with some additional command line args including"-c=rust.failure_filter=true" "-c=rust.incremental=true"
owner()
cquery//path/to:lib[diag.json]
system_rust_toolchain
. The legacy config settings from step 2 are not read anywhere. The rust rules try to readtoolchain_info.failure_filter
but it is always false because it is never given a value anywhere, you can't even set it manually onsystem_rust_toolchain
.Is the solution to create create
config_setting
s for these and use them for thesystem_rust_toolchain
defaults?The text was updated successfully, but these errors were encountered: