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

Projects
None yet
3 participants
@jgsogo
Copy link
Member

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

This comment has been minimized.

Copy link
@memsharded

memsharded Oct 8, 2018

Contributor

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

This comment has been minimized.

Copy link
@jgsogo

jgsogo Oct 8, 2018

Author Member

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 😕

This comment has been minimized.

Copy link
@memsharded

memsharded Oct 8, 2018

Contributor

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

This comment has been minimized.

Copy link
@jgsogo

jgsogo Oct 8, 2018

Author Member

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

This comment has been minimized.

Copy link
@memsharded

memsharded Oct 8, 2018

Contributor

Get the env-var in ClientCache.default_profile_path

@memsharded memsharded merged commit 37bb742 into conan-io:develop Oct 8, 2018

2 checks passed

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 jgsogo:issue/3193-2 branch Oct 8, 2018

grisumbras pushed a commit to grisumbras/conan that referenced this pull request Dec 27, 2018

Merge pull request conan-io#3675 from jgsogo/issue/3193-2
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
You can’t perform that action at this time.