-
Notifications
You must be signed in to change notification settings - Fork 359
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] [conan2] [config] How do I specify a path containing "~" in global.conf? #3670
Comments
The global.conf is rendered as a Jinja template, so you can customize it in quite a few ways. While most of these are undocumented features and they might change in the future, you can use the power of the full Some examples:
|
@shoeffner Thank you. I had problems with the
I wish this were documented somewhere. I don't feel that Conan users should need to understand the internals of how a simple configuration file is formatted by some third-party Python package. This is not normal in my experience with Linux and Windows config files, and the ability to use |
This is documented in https://docs.conan.io/2/reference/config_files/global_conf.html#configuration-file-template The reason why this file has been made a jinja template is because users requested the possibility of having more power in conan configuration files (profiles too), including variables, if-conditionals and for-loops. It didn't make sense to invent a custom syntax for it, so we decided to use a popular template engine which is jinja2 in Python. Could we consider the question responded and close it? (thanks very much @shoeffner!) Or maybe do you want to suggest some improvements to the docs? Thanks! |
I meant the We can close this ticket. I'd write a PR to update the documentation, but I don't even know enough to write something useful. |
It is, but it is true that very succintly:
It is also true that most of the examples of jinja are in the We could add a couple of examples and links to the |
What is your question?
I'm on Conan 2.2.2, trying to find a workaround for #3732 on Windows. I can bake certificates into a file and then reference it in global.conf.
However, on both Windows and Linux, Conan is very picky about the directory string. It doesn't recognize the meaning of the tilde:
It also doesn't recognize environment variables:
And relative paths don't work either (with both files in the same directory):
If I manually type out the full path, then things work:
But this doesn't make for an easily generalizable system that works out of the box for all devs and CI systems.
I then thought about setting the configuration value from a bash script, letting bash expand the path. But I see that Conan2 no longer supports
conan config set foo=bar
. Between this and #3732 I'm getting frustrated with the removal of critical features I was using in Conan 1.61.0.Finally I tried looking into the Jinja2 API to see if I could construct a path that way, using the double-braces templating. But I got lost very quickly in that as I've never used it before.
Windows 10 and Ubuntu 22.04
Conan 2.2.2
gcc and msbuild
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: