You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
@RumovZ are you interested in digging into this a bit? We could start by confirming it works correctly in a Python venv outside of Bazel, then compare what HOME/USERPROFILE/etc are set to when running run_format.py to see if the difference becomes apparent.
The reason will be displayed to describe this comment to others. Learn more.
When I run black outside bazel, $HOMEPATH and $USERPROFILE are set. These are the variables pathlib is looking for when determining the home directory. With bazel, only $HOME is set. Of course, this doesn't has to mean anything as it works fine with earlier black versions.
I don't seem to get anywhere here. Do you have a suggestion what I could try to find the issue?
The reason will be displayed to describe this comment to others. Learn more.
Does explicitly setting them in the environment of run_format.py (via env= in subprocess.run) help at all? If so, we may have a way to work around it. You could also try running bazel build with --action_env=HOMEPATH --action_env=USERPROFILE to see if that makes any difference. If neither of those help and you don't have any other quick things to test, we can just drop it for now and hope it gets resolved in black in the mean time
The reason will be displayed to describe this comment to others. Learn more.
I tried variations of .\run --action_env=USERPROFILE="C:\\msys64\\home\\Christian" with no luck. But maybe I didn't try the right syntax for Powershell.
Setting the variable in the script works fine, on the other hand. But note that the problem is not with the call in run_format.py but in hookslib.py.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into it, that seems to have helped. I had to add the same to the two run_formats as well, and gate it to Windows, but it all seems to be working now
d797900
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.
@RumovZ are you interested in digging into this a bit? We could start by confirming it works correctly in a Python venv outside of Bazel, then compare what HOME/USERPROFILE/etc are set to when running run_format.py to see if the difference becomes apparent.
d797900
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.
Will do!
d797900
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.
When I run black outside bazel, $HOMEPATH and $USERPROFILE are set. These are the variables pathlib is looking for when determining the home directory. With bazel, only $HOME is set. Of course, this doesn't has to mean anything as it works fine with earlier black versions.
I don't seem to get anywhere here. Do you have a suggestion what I could try to find the issue?
d797900
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.
Does explicitly setting them in the environment of run_format.py (via env= in subprocess.run) help at all? If so, we may have a way to work around it. You could also try running bazel build with --action_env=HOMEPATH --action_env=USERPROFILE to see if that makes any difference. If neither of those help and you don't have any other quick things to test, we can just drop it for now and hope it gets resolved in black in the mean time
d797900
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.
I tried variations of
.\run --action_env=USERPROFILE="C:\\msys64\\home\\Christian"
with no luck. But maybe I didn't try the right syntax for Powershell.Setting the variable in the script works fine, on the other hand. But note that the problem is not with the call in
run_format.py
but inhookslib.py
.d797900
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.
Thanks for looking into it, that seems to have helped. I had to add the same to the two run_formats as well, and gate it to Windows, but it all seems to be working now