rust - 如何修复`无法将jobserver管道容量从4096增加到8192;jobserver 否则可能会出现来自 cargo/rustc 的死锁错误
问题描述
在执行一些 rust 编译任务如运行cargo build
或cargo xtask install
时,偶尔编译器会崩溃并报错:
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -C link-arg=-fuse-ld=lld --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit status: 101)
--- stderr
thread 'rustc' panicked at 'failed to create jobserver: Custom { kind: PermissionDenied, error: "failed to increase jobserver pipe capacity from 4096 to 8192; jobserver otherwise might deadlock" }', compiler/rustc_data_structures/src/jobserver.rs:23:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.56.0-nightly (0035d9dce 2021-08-16) running on x86_64-unknown-linux-gnu
note: compiler flags: -C link-arg=-fuse-ld=lld --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro
query stack during panic:
end of query stack
这发生在最新的 Rust nightly 工具链上,该工具链包括截至发布时工作的 RLS,rustc 1.56.0-nightly (0035d9dce 2021-08-16)
操作系统是 Debian Linux
解决方案
此错误可能是由合并的 PR 引起的,该 PRjobserver-rs
旨在增加 Linux 上的作业服务器管道缓冲区容量:https ://github.com/alexcrichton/jobserver-rs/pull/34
这似乎造成了回归,因此在这里恢复:https ://github.com/alexcrichton/jobserver-rs/pull/35
然而,由于构建失败导致几周内没有新的 Rust nightly 被铸造出来rls
,所以这个 bug 在最新的 nightly 中仍然存在。
修复方法是每晚恢复到较旧的 rust,并等待新的每晚工作发布并提供rls
支持,其中包括恢复对jobserver-rs
.
推荐阅读
- ios - 在自定义 UIView 边框上设置渐变颜色
- jquery - 如何定位复选框标签
- java - IntelliJ - 对抛出异常的代码强加 try\catch
- c# - C# WebBrowser 控件增强保护模式
- node.js - 如何在 Dialogflow 中获得用户响应
- deployment - 如何对 nifi-famework 生成的 war 文件进行 Hot fix 部署 - NiFi
- svn - 为所有工程师阻止删除选项并仅向管理员提供相同选项的可行性
- c++ - 数据成员地址是否位于 (this) 和 (this+1) 之间?
- java - 为 ${n} 类型和 {{coinsadded}} 类型的变量创建单一模式,以便可以在字符串中找到它
- css - 远程调试时的 Safari 开发工具问题