Workspace has sysroot errors: missing a core library

未关闭
#4,222 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
rust

调研方向

从 bazel run @rules_rust//tools/rust_analyzer:setup -- vscode 工作流以及报告中显示路径下生成的 rust-analyzer sysroot 开始。调查 sysroot 看起来缺少 core 的原因,以及为什么在仅使用 Bazel 的设置中 rust-analyzer 会建议使用 rustup;当该警告能够被可靠地复现并解释,或不再错误地出现时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

needs-triage rust-analyzer

Description

I'm using

bazel run @rules_rust//tools/rust_analyzer:setup -- vscode

to populate the rust-analyzer shims. I'm driving them from Emacs, and today I noticed a new message I haven't seen before:

[eglot] Server reports (type=2): Workspace /Users/mg/src/monorepo has sysroot errors: sysroot at /private/var/tmp/_bazel_mg/89452110e8744fab7faf12b87814819e/external/rules_rust++rust+rust_analyzer_1.95.0_tools/lib/rustlib/src/library is missing a core library, try running rustup component add rust-src to possibly fix this [3 times]

Reproduction steps

I'm unfortunately not sure how to reproduce this. Despite the error, I am still able to jump to definition.

I restarted my Emacs, re-opened a Rust file in my checkout and I didn't get the error this time. I can jump around, even into stdlib, and still no error.

So I'm mostly recording it here in case others see it.

Impact

It seems this doesn't actually impact the functionality.

It is confusing, though, especially the message about running rustup which is not applicable to a Bazel-only workflow 😄

Bazel and rules_rust version

Bazel 9.1.1, rules_rust 0.73.0

主要语言
Starlark
星标
857
派生
701
平均合并
4 天 7 小时
30 天内合并 PR
46

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bazelbuild/rules_rust 的其他 Issue

查看 bazelbuild/rules_rust 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。