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

Fix problem with Win10 shell #560

Merged
merged 7 commits into from Jan 4, 2022
Merged

Conversation

FlorianWilhelm
Copy link
Member

@FlorianWilhelm FlorianWilhelm commented Dec 30, 2021

This fixes the problem with the Windows shell in issue #556. The basic solution is to add some more environment variables as stolen from setuptools-scm's utils.do_ex and in case of Windows try to find out if it is better to call a command with shell=True or shell=False. It seems that this differs from time to time.

Note: Only review and merge after having merged PR #559 into master as I needed to rebase it on #559 so the diff is actual way smaller.

@FlorianWilhelm FlorianWilhelm added the bug Something isn't working label Dec 30, 2021
@coveralls
Copy link

coveralls commented Dec 30, 2021

Pull Request Test Coverage Report for Build 4659659180081152

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.007%) to 97.437%

Totals Coverage Status
Change from base Build 6240881219993600: 0.007%
Covered Lines: 1679
Relevant Lines: 1712

💛 - Coveralls

@abravalheri
Copy link
Collaborator

abravalheri commented Jan 4, 2022

Just for my own tracking, this URL should give us the diff between the 2 branches instead of the comparison with master:

fix-556-debugging...fix-556-win-shellcommand


Edit: without thinking much, I rebased the other PR and removed its branch, which ruined this strategy... The best would be merging it and leaving the branch open until this PR was closed... Now I have to rebase and fix conflicts 😝

Copy link
Collaborator

@abravalheri abravalheri left a comment

Choose a reason for hiding this comment

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

I rebased the PR, and it should be ready to merge once the CI passes.

I am just curious about some behaviours.

# ^ CI setup does not aggregate Windows coverage
for cmd in ["git.cmd", "git.exe"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand from this removal that "git.cmd" is no longer necessary, and that we expect any distribution of git for Windows to add a .exe to the PATH, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I was actually trying to find git.cmd by googling but had no luck. There is a "git CMD" but no "git.cmd" so maybe it was a mistake? Also setuptools-scm doesn't seem to be doing this, so at least we would fail both.

for cmd in ["git.cmd", "git.exe"]:
git = ShellCommand(cmd, **args)
for shell in (True, False):
git = ShellCommand("git.exe", shell=shell, **args)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am very curious to understand what is happening for the command with shell=True to be failing...

Would be a problem with file names?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, I am also very curious about this. We only now that one of @ksteptoe's two Windows machines seem to have a problem with the shell setup. Somehow an & is added but I have no good explanation for that. I think it will be impossible to figure this out without access to the machine. Also I am no Windows (Power)shell expert.

@abravalheri
Copy link
Collaborator

Thank you very much @FlorianWilhelm for debugging and solving this problem even without access to a Windows environment. That was epic!

❤️ 💜 💚 💛 💙

@abravalheri abravalheri merged commit e66e969 into master Jan 4, 2022
@abravalheri abravalheri deleted the fix-556-win-shellcommand branch January 4, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants