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
allow relative paths (from conan.conf) in env variable #3675
Conversation
conans/client/conf/__init__.py
Outdated
@@ -290,8 +290,8 @@ def default_profile(self): | |||
ret = os.environ.get("CONAN_DEFAULT_PROFILE_PATH", None) | |||
if ret: | |||
if not os.path.isabs(ret): | |||
raise ConanException("Environment variable 'CONAN_DEFAULT_PROFILE_PATH' must point " | |||
"to an absolute path.") | |||
ret = os.path.abspath(os.path.join(os.path.dirname(self.filename), ret)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not resolve to the default "profiles" folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, check last commit
Although now I don't like the private import to avoid the circular import error... here I should know only about conan.conf
, and now I know things related to ClientCache
😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be solved. I think you can let the ConanClientConfigParser.default_profile()
to return the unprocessed default profile path value, and then manage the full path, both for the conan.conf and the env-var in the ClientCache.default_profile_path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then we don't know if the default_profile comes from the environment variable or not, and we cannot check if it exists consistently (@lasote and I agree that if it comes from the env variable the file is required to exist).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get the env-var in ClientCache.default_profile_path
allow relative paths (from conan.conf) in env variable
Changelog: Feature: The environment variable CONAN_DEFAULT_PROFILE_PATH allows the user to define the path (existing) to the default profile that will be used by Conan.