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

feat: new variant resolving / rendering #1122

Merged
merged 34 commits into from
Dec 9, 2024

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 :)

@wolfv wolfv force-pushed the new-variant-resolve branch from 4efa5d8 to facbedc Compare December 1, 2024 11:25
@wolfv wolfv changed the title WIP: new variant resolving / rendering feat: new variant resolving / rendering Dec 9, 2024
@wolfv wolfv enabled auto-merge (squash) December 9, 2024 14:15
@wolfv wolfv merged commit 2c7f0e9 into prefix-dev:main Dec 9, 2024
16 checks passed
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