-
Notifications
You must be signed in to change notification settings - Fork 543
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(bzlmod): Fixing Windows Python Interpreter symlink issues #1265
fix(bzlmod): Fixing Windows Python Interpreter symlink issues #1265
Conversation
76e1fe5
to
863dc7e
Compare
81fa3a1
to
0f08282
Compare
When using Windows you cannot run the symlink directly. Because of how symlinks work in Windows we need to use the path realink. Unlike Linux and OSX we cannot execute the Python symlink directly. Windows throws an error "-1073741515", when we execute the symlink directory. This error means that the Python binary cannot find dlls. This is because the symlink that we create is not in the same folder as the dlls. This commit introduces code that resolves the actual location of the interpreter using the path realink when we are running bzlmod and Windows.
0f08282
to
98b51ab
Compare
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.
Just doc and ux improvements, otherwise lgtm
@@ -699,7 +708,7 @@ def _whl_library_impl(rctx): | |||
) | |||
|
|||
if result.return_code: | |||
fail("whl_library %s failed: %s (%s)" % (rctx.attr.name, result.stdout, result.stderr)) | |||
fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code)) |
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.
Since we're here...
fail("whl_library %s failed: %s (%s) error code: '%s'" % (rctx.attr.name, result.stdout, result.stderr, result.return_code)) | |
fail(("whl_library '{name}' failed: wheel_installer failed\n" + | |
"command: {args}\n" + | |
"error code: {error_code}\n" + | |
"===== stdout ====={stdout}\n" + | |
"===== stderr ====={stderr}\n=====").format( | |
name = rctx.attr.name, | |
command = args, | |
code=result.return_code, | |
stdout=result.stdout, | |
stderr=result.stderr | |
)) |
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.
Did you test this code?
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.
no. i'm fine if you want to skip it for now.
Making English better. Co-authored-by: Richard Levasseur <richardlev@gmail.com>
When using Windows you cannot run the symlink directly.
Because of how symlinks work in Windows we need to path realpath resolve the link.
Unlike Linux and OSX we cannot execute the Python symlink directly. Windows throws an error "-1073741515", when we execute the symlink directory. This error means that the Python binary cannot find dlls. This is because the symlink that we create is not in the same folder as the dlls.