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

@lasote
Copy link
Contributor

@lasote lasote 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 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]
Copy link
Contributor Author

@lasote lasote Nov 15, 2018

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

Copy link
Contributor Author

@lasote lasote Nov 15, 2018

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]
Copy link
Member

@jgsogo jgsogo Nov 19, 2018

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.

Copy link
Member

@memsharded memsharded Nov 19, 2018

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.

Copy link
Contributor Author

@lasote lasote Nov 19, 2018

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]
Copy link
Member

@memsharded memsharded Nov 19, 2018

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
Copy link
Member

@danimtb danimtb commented Nov 19, 2018

Agree with the reviews. Please @lasote take a look

@lasote lasote dismissed jgsogo’s stale review Nov 19, 2018

Check now please

jgsogo
jgsogo approved these changes Nov 19, 2018
Copy link
Member

@jgsogo jgsogo 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
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 Nov 19, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
* 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants