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

allow relative paths (from conan.conf) in env variable #3675

Merged
merged 2 commits into from Oct 8, 2018

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented Oct 8, 2018

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.

@jgsogo jgsogo added this to the 1.8 milestone Oct 8, 2018
@jgsogo jgsogo requested a review from memsharded October 8, 2018 09:01
@ghost ghost assigned jgsogo Oct 8, 2018
@ghost ghost added the stage: review label Oct 8, 2018
@@ -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))
Copy link
Member

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.

Copy link
Contributor Author

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 😕

Copy link
Member

@memsharded memsharded Oct 8, 2018

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

Copy link
Contributor Author

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

Copy link
Member

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

@memsharded memsharded merged commit 37bb742 into conan-io:develop Oct 8, 2018
@ghost ghost removed the stage: review label Oct 8, 2018
@jgsogo jgsogo deleted the issue/3193-2 branch October 8, 2018 12:01
grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018
allow relative paths (from conan.conf) in env variable
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.

Environment variable to set [general]default_profile
3 participants