最近,用于从源代码引导 Rust 编译器的工具 x.py
的默认值发生了更改。如果您经常为 Rust 做出贡献,这可能会影响您的工作流程。
做出了哪些更改?
-
现在的默认阶段取决于子命令
dist
:阶段 2build
:阶段 1test
:阶段 1doc
:阶段 0
-
阶段 1 的
rustc
工件不再由x.py build --stage 1
构建。要恢复旧的行为,请使用x.py build --stage 1 src/rustc
。build --stage 1
的新行为会构建除rustc
之外的所有内容,包括标准库、rustdoc
和各种其他工具(如果启用了这些工具)。 -
当
debug = true
时,debuginfo
现在默认为1
。之前,默认值为 2。
为什么要进行这些更改?
之前,x.py build
会构建两次 rustc
build/stage0-std
build/stage0-rustc
build/stage1-std
build/stage1-rustc
通常,贡献者只想构建一次编译器,这让他们可以快速测试他们的更改。此更改之后,这现在是默认设置
build/stage0-std
build/stage0-rustc
build/stage1-std
debuginfo = 2
会生成数 GB 的调试信息,这使得之前的 debug = true
的默认设置非常麻烦。
有关更改的详细原理以及有关所考虑的替代方案的更多信息,请参阅