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.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

jgsogo
jgsogo previously requested changes Nov 19, 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 commented Nov 19, 2018

Agree with the reviews. Please @lasote take a look

@lasote lasote dismissed jgsogo’s stale review November 19, 2018 13:41

Check now please

Copy link
Contributor

@jgsogo jgsogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@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
* 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
Development

Successfully merging this pull request may close these issues.

None yet

4 participants