Skip to content

Commit

Permalink
package cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Lissy committed Mar 4, 2024
1 parent e747592 commit 7f52772
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/compiler/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,27 @@ impl pkg::InputsPackager for RustInputsPackager {
let dist_input_path = path_transformer.as_dist(&input_path).with_context(|| {
format!("unable to transform input path {}", input_path.display())
})?;

if input_path.ends_with("src/lib.rs") {
let cargo_toml_path = input_path
.parent()
.expect("No parent")
.parent()
.expect("No parent")
.join("Cargo.toml");
if cargo_toml_path.is_file() {
let dist_cargo_toml_path = path_transformer
.as_dist(&cargo_toml_path)
.with_context(|| {
format!(
"unable to transform input path {}",
cargo_toml_path.display()
)
})?;
tar_inputs.push((cargo_toml_path, dist_cargo_toml_path))
}
}

tar_inputs.push((input_path, dist_input_path))
}

Expand Down

0 comments on commit 7f52772

Please sign in to comment.