-
Notifications
You must be signed in to change notification settings - Fork 981
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
BugFix: allow run_in_windows_bash
in MSYS/Cygwin
#8506
Conversation
Signed-off-by: SSE4 <[email protected]>
@@ -635,7 +635,7 @@ def run_in_windows_bash(conanfile, bashcmd, cwd=None, subsystem=None, msys_mingw | |||
It requires to have MSYS2, CYGWIN, or WSL | |||
""" | |||
env = env or {} | |||
if platform.system() != "Windows": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cygwin also returns "Windows" here, could be only Msys will be different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't check Cygwin (may check tomorrow), msys returns a different value for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix seems fine anyway, it was just an observation. Would you like to check something more, or can it be merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the completeness.
Cygwin:
sse4@DESKTOP-LAD63V0 ~
$ python -c "import platform; print(platform.system())"
CYGWIN_NT-10.0-18363
MSYS2:
sse4@DESKTOP-LAD63V0 MSYS ~
$ python -c "import platform; print(platform.system())"
MSYS_NT-10.0-18363
MinGW32 (MSYS2):
sse4@DESKTOP-LAD63V0 MINGW32 ~
$ python -c "import platform; print(platform.system())"
MINGW32_NT-10.0-18363
MinGW64 (MSYS2):
sse4@DESKTOP-LAD63V0 MINGW64 ~
$ python -c "import platform; print(platform.system())"
MINGW64_NT-10.0-18363
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curiously, it seems it can change, I am not sure why:
Cygwin:
$ python -c "import platform; print(platform.system())"
Windows
In any case, doesn't seem relevant, if it can change in other computers, need to take it into account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably not a python from a Cygwin itself. run which python
to check.
if it's /usr/bin/python
, then it's cygwin's one.
if it's something like /cygdrive/c/users...
, then it's installed in the main Windows system.
I think this can be merged, but I would like to note that |
checking cygwin, it seems to be not enough:
I guess the error is in
which allows the build to start. |
@SSE4 How would you like to proceed? Fixing those things in this PR? |
nope, this deserves its own PR, and I want to write some tests for |
related to #8476
running
AutoToolsBuildEnvironment(self, win_bash=True)
in MSYS2 results in an error:the fix allows
run_in_windows_bash
to work in sub-systems as well.Changelog: BugFix: Allow
run_in_windows_bash
in MSYS/Cygwin.Docs: omit
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.