-
Notifications
You must be signed in to change notification settings - Fork 990
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
[question] test variable substitution in profiles #11730
Comments
Maybe drop our custom made variable substitution in favor of jinja templates ones? |
no way |
Why not? |
it's useful, clean and easy to understand syntax, compare to obscure and hard to read jinja2 templates |
But now we have 2 mechanisms to do the same thing, which is undesired, it would make sense to keep only 1 of them, probably the most flexible, generic and "standard" one. In that sense, jinja, even if the syntax is less terse, is more standard than our variable substitution. It is also not that clean, the way they can propagate and overwrite over multiple composed profiles or included() profiles is less than evident and can lead to confusion. I was thinking of simplifying this bit also. |
Lets try a POC how a profile looks like with Jinja variable substitution |
Simple example doing a bit of inheriting and variables declaring (already working): profile_vars at {% set bar = "Bar-baridad" %} foo at {% import "profile_vars" as vars %}
{% set foo = "default" %}
include({{ foo }})
[conf]
user.foo.bar = "{{ vars.bar }}"
Running an install with the profile (conan-including the default profile): conan install . --profile foo
-------- Input profiles --------
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=apple-clang
compiler.cppstd=gnu98
compiler.libcxx=libc++
compiler.version=13
os=Macos
[conf]
user.foo.bar="Bar-baridad"
So I would say, the current |
Yes, I think I would drop support for our own variable replacement and use jinja syntax only for this. Leave the |
can we consider keeping the old support? there are a lot of existing profiles that use it, it would be a significant effort to re-write them, plus all the tutorials, examples, etc. |
We want only one way to do things and jinja does it perfectly. It doesn't make any sense to keep the support for a custom one. That is one big purpose of Conan 2, simplify and grow solid and better. |
Closed by #12152 |
Look into revisiting the expected behaviours with regards to variable substitution in profiles
The text was updated successfully, but these errors were encountered: