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

Feature/fix vcvars filter known #3941

Merged
merged 3 commits into from Nov 19, 2018

Conversation

Projects
None yet
4 participants
@lasote
Copy link
Contributor

commented Nov 15, 2018

Changelog: Bugfix: Fixed bug in vcvars_dict tool when using filter_known_paths argument.

  • Refer to the issue that supports this Pull Request. Closes #3940

lasote added some commits Nov 15, 2018

@lasote lasote added this to the 1.9.2 milestone Nov 15, 2018

@ghost ghost assigned lasote Nov 15, 2018

@ghost ghost added the stage: review label Nov 15, 2018

@lasote lasote requested review from memsharded and jgsogo Nov 15, 2018

path = new_env.get("PATH", "").split(";")
path = [entry for entry in path if relevant_path(entry)]
new_env["PATH"] = ";".join(path)
path_key = ([name for name in new_env.keys() if "path" == name.lower()] or ["PATH"])[0]

This comment has been minimized.

Copy link
@lasote

lasote Nov 15, 2018

Author Contributor

The new_env["PATH"] is always a list, not a string (first bug)

This comment has been minimized.

Copy link
@lasote

lasote Nov 15, 2018

Author Contributor

The name of the variable PATH could be in a different casing Path or path or PATH so check the correct one. (second bug)

path = new_env.get("PATH", "").split(";")
path = [entry for entry in path if relevant_path(entry)]
new_env["PATH"] = ";".join(path)
path_key = ([name for name in new_env.keys() if "path" == name.lower()] or ["PATH"])[0]

This comment has been minimized.

Copy link
@jgsogo

jgsogo Nov 19, 2018

Member

This will add "PATH" variable (empty) if it was not already there. Remove the or ... and check for path_key in order to add it to new_env or not in the following lines.

This comment has been minimized.

Copy link
@memsharded

memsharded Nov 19, 2018

Contributor

Yes, but that was the previous behavior too. If we think that it shouldn't be added, that might be a breaking feature and a new issue for Conan 2.0 should be filed.

This comment has been minimized.

Copy link
@lasote

lasote Nov 19, 2018

Author Contributor

It is a bug and not a big deal I think. I'm removing the assignment when path is empty.

path = new_env.get("PATH", "").split(";")
path = [entry for entry in path if relevant_path(entry)]
new_env["PATH"] = ";".join(path)
path_key = ([name for name in new_env.keys() if "path" == name.lower()] or ["PATH"])[0]

This comment has been minimized.

Copy link
@memsharded

memsharded Nov 19, 2018

Contributor

Yes, but that was the previous behavior too. If we think that it shouldn't be added, that might be a breaking feature and a new issue for Conan 2.0 should be filed.

@danimtb

This comment has been minimized.

Copy link
Member

commented Nov 19, 2018

Agree with the reviews. Please @lasote take a look

Check now please

@jgsogo

jgsogo approved these changes Nov 19, 2018

Copy link
Member

left a comment

Is breaking, but not much (I would say it was a bug, too) . I'm ok with the changes.

@lasote lasote merged commit aae64bf into conan-io:release/1.9.2 Nov 19, 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 Nov 19, 2018

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

Feature/fix vcvars filter known (conan-io#3941)
* before win

* added test

* Avoid empty path
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.