Skip to content

bazel cache polluted, rust_analyzer json missing "is_test" #3701

@sthornington

Description

@sthornington

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions