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

implement stdlib Jinja function #239

Closed
h-vetinari opened this issue Oct 25, 2023 · 6 comments
Closed

implement stdlib Jinja function #239

h-vetinari opened this issue Oct 25, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@h-vetinari
Copy link

The next release of conda-build is going to contain a new function to allow expressing constraints on the c standard library version (and implementation).

We plan to use this extensively in conda-forge, because it is the key to handle packages that require newer glibc or Macos versions than our global baseline (in fact, we cannot properly move our baseline on Macos unless we have this).

Given that rattler-build is shaping up to be the next-generation build-tool for conda packages, we'll likely need the same kind of functionality in this tool eventually. I had briefly talked about this with @wolfv, and the implementation shouldn't be hard. It definitely wasn't a big deal on the conda-build side (most of that PR is docs and tests).

Xref also mamba-org/boa#379

PS. My understanding is that even with conda/ceps#54, there's still jinja functions under the hood, it would just need to have an extra dollar-sign compared to conda-build/boa, i.e. ${{ stdlib("c") }}

@ruben-arts ruben-arts added the enhancement New feature or request label Oct 30, 2023
@swarnimarun
Copy link
Contributor

This is now considered blocked on,
conda/conda-build#5053

@h-vetinari
Copy link
Author

conda/conda-build#5053 was closed a while ago, and we're soon getting to a point where conda-forge feedstocks will contain {{ stdlib("c") }} (the bug @wolfv had pointed out about the hash should now be fixed by conda/conda-build#5195).

JFYI :)

@wolfv
Copy link
Member

wolfv commented Feb 29, 2024

Hey @h-vetinari I do still think that the design of the stdlib function was partially because it's hard to change conda-build.

If you had the opportunity to design this feature free from any implementation constraints, would you still do it this way?

@h-vetinari
Copy link
Author

If you had the opportunity to design this feature free from any implementation constraints, would you still do it this way?

I won't pretend that I'll manage to give an unbiased answer, but I actually like the conceptual separation between compiler and stdlib. It's an aspect I didn't grasp for a long time, perhaps in no small part due learning about the subject matter mostly through conda(-forge), where the stdlib-aspect is hidden away behind infrastructure-magic.

In an ideal world, I'd like to be able to treat the standard library as any other host-dependence -- which we unfortunately cannot do, at least for the C stdlib, because conda isn't able to ship that --, but assuming we could successfully fake that, then the environment layering question would be an even stronger argument IMO to also reflect that in the recipe. It would also make it clearer where recipes do not need a stdlib at all (freestanding, or whatever).

I get that this arrives relatively late to the game w.r.t. conda, but I kinda think it's worth the migration pain? Not sure why I would otherwise subject myself to this, haha.

If I understand your argument correctly, then you're fully onboard with the need for the relevant knobs, but would like to just encapsulate in the compiler-intrinsic (or virtual package, or however we may call it)? The APIs I've seen for that just don't appeal to me all that much (especially since the stdlib metapackage name changes from platform to platform, forcing yet more selectors), aside from not having a transition story (due to conda limitations around selectors etc.). I guess that could still be an option for rattler or the new recipe format though?

Overall, I'm not that invested in how the implementation looks exactly, though in case of doubt, I prefer the less magic one. But I also think that - at least for conda-forge in 2024 - we don't have the luxury of postponing this until a hypothetical clean room design including transition story arrives (again, rattler may have more freedom there). AFAICT, this topic was neglected basically since inception of conda-forge and is now starting to bite hard. We really need to fix it ASAP, as in, definitely this year, and some of that work will take months even in the best case scenario.

@h-vetinari
Copy link
Author

Ah, and cross-referencing your last reply from conda/conda-build#5053, you basically said as much yourself:

I do think that for the future (ie. rattler-build) we'll have an upcoming CEP to define this feature better.

@wolfv wolfv closed this as completed Jun 4, 2024
@wolfv
Copy link
Member

wolfv commented Jun 4, 2024

Done in #892

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

No branches or pull requests

4 participants