一句话:系统分析 Rust 编译器不稳定特性的使用与生态影响,并构建编译失败恢复工具。
Rust 编译器通过不稳定特性(RUF)扩展功能,但这些特性可能被移除并导致编译失败,影响还会沿传递依赖扩散至整个生态。此前研究多关注 Rust 代码安全,缺乏对 RUF 使用与影响的系统分析。本文提出精确提取 RUF 的技术,并精确解析包依赖以量化生态影响;随后设计并实现 RUF 编译失败恢复工具。作者分析了整个 Rust 生态的 59 万个包版本和 1.4 亿条传递依赖,发现生态使用 1000 个不同 RUF,最多 44% 包版本受其影响,最多 12% 包版本编译失败;所提工具可恢复最多 90% 的失败。
Rust programming language is gaining popularity rapidly in building reliable and secure systems due to its security guarantees and outstanding performance. To provide extra functionalities, the Rust compiler introduces Rust unstable features (RUF) to extend compiler functionality, syntax, and standard library support. However, these features are unstable and may get removed, introducing compilation failures to dependent packages. Even worse, their impacts propagate through transitive dependencies, causing large-scale failures in the whole ecosystem. Although RUF is widely used in Rust, previous research has primarily concentrated on Rust code safety, with the usage and impacts of RUF from the Rust compiler remaining unexplored. Therefore, we aim to bridge this gap by systematically analyzing the RUF usage and impacts in the Rust ecosystem. We propose novel techniques for extracting RUF precisely, and to assess its impact on the entire ecosystem quantitatively, we accurately resolve package dependencies. We have analyzed the whole Rust ecosystem with 590K package versions and 140M transitive dependencies. Our study shows that the Rust ecosystem uses 1000 different RUF, and at most 44% of package versions are affected by RUF, causing compiling failures for at most 12% of package versions. To mitigate wide RUF impacts, we further design and implement a RUF-compilation-failure recovery tool that can recover up to 90% of the failure. We believe our techniques, findings, and tools can help stabilize the Rust compiler, ultimately enhancing the security and reliability of the Rust ecosystem.
DOI 原文 ·
@inproceedings{paperbot11351,
title = {Demystifying Compiler Unstable Feature Usage and Impacts in the Rust Ecosystem},
author = {Chenghao Li and Yifei Wu and Wenbo Shen and Zichen Zhao and Rui Chang and Chengwei Liu and Yang Liu and Kui Ren},
booktitle = {ICSE},
year = {2024},
doi = {10.1145/3597503.3623352}
}