fix(bzlmod): Fixing Windows Python Interpreter symlink issues#1265
Merged
chrislovecnm merged 2 commits intobazel-contrib:mainfrom Jun 13, 2023
Merged
fix(bzlmod): Fixing Windows Python Interpreter symlink issues#1265chrislovecnm merged 2 commits intobazel-contrib:mainfrom
chrislovecnm merged 2 commits intobazel-contrib:mainfrom
Conversation
76e1fe5 to
863dc7e
Compare
rickeylev
reviewed
Jun 13, 2023
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
rickeylev
approved these changes
Jun 13, 2023
Collaborator
rickeylev
left a comment
There was a problem hiding this comment.
Just doc and ux improvements, otherwise lgtm
|
|
||
| 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)) |
Collaborator
There was a problem hiding this comment.
Since we're here...
Suggested change
| 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 | |
| )) |
Contributor
Author
There was a problem hiding this comment.
Did you test this code?
Collaborator
There was a problem hiding this comment.
no. i'm fine if you want to skip it for now.
Making English better. Co-authored-by: Richard Levasseur <richardlev@gmail.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.