-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x build -h -v
panics since #104952
#106165
Comments
x build -h -v
panics since https://github.com/rust-lang/rust/pull/104952x build -h -v
panics since #104952
oh, also I changed the error message locally a bit: diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index f84fcd21cfc..5aff33a2fb8 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1400,7 +1396,7 @@ fn in_tree_crates(&self, root: &str, target: Option<TargetSelection>) -> Vec<&Cr
let mut list = vec![INTERNER.intern_str(root)];
let mut visited = HashSet::new();
while let Some(krate) = list.pop() {
- let krate = &self.crates[&krate];
+ let krate = self.crates.get(&krate).unwrap_or_else(|| panic!("metadata missing for {krate}: {:?}", self.crates));
ret.push(krate);
for dep in &krate.deps {
if !self.crates.contains_key(dep) { before that change it was
|
the problem is that I changed Lines 566 to 591 in 5e656ba
|
I don't like the options here :/ either we start updating submodules on usage: Lines 354 to 356 in fca8290
or we stop showing a list of all crates on -h -v . both of those seem unfortunate.
once again it would be really nice if cargo didn't require all submodules to be checked out to have even the slightest bit of metadata about the workspace :/ |
I think updating the submodules is the least hacky fix here, as much as I dislike it. |
Fix panic on `x build --help --verbose` See rust-lang#106165 for a detailed description of what went wrong here. This also makes the panic message a little more informative in case it happens again.
ah yes, it needs to delay calling |
Can you open a new issue? |
Opened at #106313 |
Code
I tried this code:
I expected to see this happen: A list of all crates that can be built.
Instead, this happened:
Version it worked on
It most recently worked on: 8ad447c
Version with regression
88c58e3 / #104952
Backtrace
Backtrace
The text was updated successfully, but these errors were encountered: