Skip to content

Commit

Permalink
Reintroduce Optional output_paths to be compatible with python implem…
Browse files Browse the repository at this point in the history
…entation
  • Loading branch information
Erin van der Veen committed Feb 19, 2024
1 parent db7a54b commit aac7dfb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,16 @@ fn process(
// check if the build_input has already be processed
let done = {
let mut collected_paths = collected_paths.lock().unwrap();
!collected_paths.insert(build_input.output_path.clone())
match &build_input.output_path {
None => {
log::warn!(
"Found a derivation without an output_path: {:?}",
build_input
);
false
}
Some(output_path) => !collected_paths.insert(output_path.clone()),
}
};

if done {
Expand Down
4 changes: 2 additions & 2 deletions src/nix/describe_derivation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::error::{Error, Result};
pub struct DerivationDescription {
pub attribute_path: String,
pub derivation_path: Option<String>,
pub output_path: String,
pub output_path: Option<String>,
pub outputs: Vec<Output>,
pub name: String,
pub parsed_name: ParsedName,
Expand Down Expand Up @@ -65,7 +65,7 @@ pub struct License {
pub struct BuiltInput {
pub attribute_path: String,
pub build_input_type: String,
pub output_path: String,
pub output_path: Option<String>,
}

pub fn describe_derivation(
Expand Down

0 comments on commit aac7dfb

Please sign in to comment.