Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Sep 20, 2024
1 parent 944c01e commit a1b7761
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ pub struct Output {
pub finalized_dependencies: Option<FinalizedDependencies>,
/// The finalized dependencies from the cache (if there is a cache
/// instruction)
#[serde(skip_serializing_if = "Option::is_none")]
pub finalized_cache_dependencies: Option<FinalizedDependencies>,
/// The finalized sources for this output. Contain the exact git hashes for
/// the sources that are used to build this output.
Expand Down
31 changes: 24 additions & 7 deletions src/variant_render.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
use std::collections::{BTreeMap, HashSet};

use crate::{
recipe::{
hash::HashInfo, recipe::{
custom_yaml::Node,
parser::{Dependency, PinCompatible, PinSubpackage},
ParsingError, Recipe,
},
selectors::SelectorConfig,
used_variables::used_vars_from_expressions,
variant_config::{ParseErrors, VariantConfig, VariantError},
}, selectors::SelectorConfig, used_variables::used_vars_from_expressions, variant_config::{ParseErrors, VariantConfig, VariantError}
};

/// All the raw outputs of a single recipe.yaml
Expand Down Expand Up @@ -100,6 +97,13 @@ pub(crate) fn stage_0_render(
Ok(stage0_renders)
}

struct DiscoveredOutput {
/// The recipe of this output
recipe: Recipe,
/// The variant values of this output
variant: BTreeMap<String, String>,
}

/// Stage 1 render of a single recipe.yaml
#[derive(Debug)]
pub struct Stage1Render {
Expand All @@ -116,6 +120,7 @@ pub(crate) fn stage_1_render(
variant_config: &VariantConfig,
) -> Result<Vec<Stage1Render>, VariantError> {
let mut stage_1_renders = Vec::new();
let mut discovered_outputs = Vec::new();

// TODO we need to add variables from the cache here!
for r in stage0_renders {
Expand Down Expand Up @@ -149,11 +154,19 @@ pub(crate) fn stage_1_render(
_ => {}
}
}

let hash = HashInfo::from_variant(&used_filtered, parsed_recipe.build().noarch());

let build_string = parsed_recipe
.build()
.string()
.resolve(&hash, parsed_recipe.build().number)
.into_owned();

extra_vars_per_output.push(additional_variables);
}

// Create the additional combinations and attach the whole variant x outputs to the stage 1 render

let mut all_vars = extra_vars_per_output
.iter()
.fold(HashSet::new(), |acc, x| acc.union(x).cloned().collect());
Expand All @@ -171,6 +184,10 @@ pub(crate) fn stage_1_render(
});
}
}
println!("{:?}", stage_1_renders);

for render in &stage_1_renders {
println!("{:?}\n\n=====\n\n", render);
}

Ok(stage_1_renders)
}

0 comments on commit a1b7761

Please sign in to comment.