bazelbuild / bazelbuild/rules_rust

Can't inherit a CARGO_PKG_README which was missing from the workspace

Open
#3,441 13 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Hello!

I'm running into this error when upgrading to rules rust 0.61 (from 0.57):
```
Can't inherit a CARGO_PKG_README which was missing from the workspace
```
Digged a bit, and this patch makes the build work:
```
diff --git cargo/cargo_toml_variable_extractor/main.rs cargo/cargo_toml_variable_extractor/main.rs
index 8e67307e..4562c66d 100644
--- cargo/cargo_toml_variable_extractor/main.rs
+++ cargo/cargo_toml_variable_extractor/main.rs
@@ -233,9 +233,7 @@ fn print_inheritable_path(
.join(std::path::MAIN_SEPARATOR_STR);
Some(joined)
}
- (Some(InheritableString::Inherit(_)), None) => {
- panic!("Can't inherit a {key} which was missing from the workspace")
- }
+ (Some(InheritableString::Inherit(_)), None) => None,
_ => None,
};
print_optional_env_str(out, key, maybe_path.as_deref());
```

However not sure it's what is wanted (did not really dig into the whole inheritance thing). I can open a PR as is if that what we want, but I guess it'll break some other config?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.