bazelbuild / bazelbuild/rules_rust

bazel cache polluted, rust_analyzer json missing "is_test"

Open
#3,701 3 comments 0 reactions 0 assignees View on GitHub
needs-triage rust-analyzer
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Hi folks,

We have a bazel install with a shared disk cache, and also a remote cache, using rules_rust pretty much "stock". However, the other day, when we upgraded rules_rust to something recent, a bunch of builds started failing because some json files to do with rust_analyzer artifacts were causing problems because they were missing an "is_test" field.

I kinda figure that a recent rust_analyzer update in a recent rust toolchain update added this field, and therefore things were expecting it, but that for some reason, the version of the rust toolchain selected by rules_rust by default was not included in the bazel hashes/stamps, and therefore everything was erroneously using old incompatible cached artifacts whose hash had not changed.

Is this expected? Is there a simple way to get rules_rust toolchains to stamp things including the version of the rust compiler/toolchain version so that when the rust compiler version is changed, all the cached artifacts are invalidated?

I'm, for now, going to try passing `versions = [MY_RUST_VERSION]` in the `rust_register_toolchains` to see if that adds the requisite stamping, but I am not confident that this will do the trick.... Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.