Initialize rust-analyzer submodule on bootstrap
This commit is contained in:
parent
082e4ca497
commit
2878f98672
2 changed files with 11 additions and 2 deletions
|
@ -1147,6 +1147,10 @@ class RustBuild(object):
|
||||||
"library/backtrace",
|
"library/backtrace",
|
||||||
"library/stdarch"
|
"library/stdarch"
|
||||||
]
|
]
|
||||||
|
# If build.vendor is set in config.toml, we must update rust-analyzer also.
|
||||||
|
# Otherwise, the bootstrap will fail (#96456).
|
||||||
|
if self.use_vendored_sources:
|
||||||
|
submodules.append("src/tools/rust-analyzer")
|
||||||
filtered_submodules = []
|
filtered_submodules = []
|
||||||
submodules_names = []
|
submodules_names = []
|
||||||
for module in submodules:
|
for module in submodules:
|
||||||
|
|
|
@ -609,7 +609,7 @@ impl Build {
|
||||||
/// This avoids contributors checking in a submodule change by accident.
|
/// This avoids contributors checking in a submodule change by accident.
|
||||||
pub fn maybe_update_submodules(&self) {
|
pub fn maybe_update_submodules(&self) {
|
||||||
// WARNING: keep this in sync with the submodules hard-coded in bootstrap.py
|
// WARNING: keep this in sync with the submodules hard-coded in bootstrap.py
|
||||||
const BOOTSTRAP_SUBMODULES: &[&str] = &[
|
let mut bootstrap_submodules: Vec<&str> = vec![
|
||||||
"src/tools/rust-installer",
|
"src/tools/rust-installer",
|
||||||
"src/tools/cargo",
|
"src/tools/cargo",
|
||||||
"src/tools/rls",
|
"src/tools/rls",
|
||||||
|
@ -617,6 +617,11 @@ impl Build {
|
||||||
"library/backtrace",
|
"library/backtrace",
|
||||||
"library/stdarch",
|
"library/stdarch",
|
||||||
];
|
];
|
||||||
|
// As in bootstrap.py, we include `rust-analyzer` if `build.vendor` was set in
|
||||||
|
// `config.toml`.
|
||||||
|
if self.config.vendor {
|
||||||
|
bootstrap_submodules.push("src/tools/rust-analyzer");
|
||||||
|
}
|
||||||
// Avoid running git when there isn't a git checkout.
|
// Avoid running git when there isn't a git checkout.
|
||||||
if !self.config.submodules(&self.rust_info) {
|
if !self.config.submodules(&self.rust_info) {
|
||||||
return;
|
return;
|
||||||
|
@ -632,7 +637,7 @@ impl Build {
|
||||||
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
|
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
|
||||||
let submodule = Path::new(line.splitn(2, ' ').nth(1).unwrap());
|
let submodule = Path::new(line.splitn(2, ' ').nth(1).unwrap());
|
||||||
// avoid updating submodules twice
|
// avoid updating submodules twice
|
||||||
if !BOOTSTRAP_SUBMODULES.iter().any(|&p| Path::new(p) == submodule)
|
if !bootstrap_submodules.iter().any(|&p| Path::new(p) == submodule)
|
||||||
&& channel::GitInfo::new(false, submodule).is_git()
|
&& channel::GitInfo::new(false, submodule).is_git()
|
||||||
{
|
{
|
||||||
self.update_submodule(submodule);
|
self.update_submodule(submodule);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue