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
Member

@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 Oct 8, 2018
@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

@memsharded memsharded Oct 8, 2018

This does not resolve to the default "profiles" folder.

Copy link
Member Author

@jgsogo jgsogo Oct 8, 2018

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

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
Member Author

@jgsogo jgsogo Oct 8, 2018

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

@memsharded memsharded Oct 8, 2018

Get the env-var in ClientCache.default_profile_path

@memsharded memsharded merged commit 37bb742 into conan-io:develop Oct 8, 2018
2 checks passed
2 checks passed
@conanci
continuous-integration/jenkins/pr-head This commit looks good
Details
license/cla Contributor License Agreement is signed.
Details
@ghost ghost removed the stage: review label Oct 8, 2018
@jgsogo jgsogo deleted the issue/3193-2 branch Oct 8, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this issue 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
Linked issues

Successfully merging this pull request may close these issues.

3 participants