Skip to content
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

WIP: new variant resolving / rendering #1122

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

wolfv
Copy link
Member

@wolfv wolfv commented Oct 16, 2024

This is an attempt to separate things better into "stage 1" and "stage 2" rendering.

Stage 1:

Get all used variables from Jinja and conditional expressions and then render these out for all combinations that are found based on the variant config. This already creates a number of different combinations.

Stage 2:

From the rendered recipes (no more Jinja, conditionals) we need to get all the requirements at build/link time and create additional variants.

Stage 3:

Topologically sort and de-duplicate outputs (with multiple outputs, these renders might create duplicate outputs, for example if you have a C library and multiple variants for Python bindings).

Note to self:

We need to make sure that we keep this logic from main:

                // We also replace `-` with `_` in the keys for better compatibility
                // with conda-build and because then we can set them directly as env vars
                // and the same for `.` because we want to be able to set them as env vars directly
                let used_filtered = used_filtered
                    .into_iter()
                    .map(|(k, v)| (k.replace("-", "_"), v))
                    .map(|(k, v)| (k.replace(".", "_"), v))
                    .collect::<BTreeMap<_, _>>();

@wolfv
Copy link
Member Author

wolfv commented Oct 21, 2024

Note: missing in this PR are updated handling of - and . in used variables :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant