Uh oh!
There was an error while loading. Please reload this page.
Fix download of Windows Python toolchain on Linux - #769
Conversation
jesseschalken
commented
Aug 1, 2022
I may need some help with the CI failure. The error is from I don't see how this PR could have caused this, and I don't have a mac to test it on. |
UebelAndre
commented
Aug 1, 2022
Perhaps this is a flake? But MacOS is a case-insensitive filesystem by default so it can't distinguish the difference between |
jesseschalken
commented
Aug 2, 2022
Isn't that what this PR does? https://github.com/bazelbuild/rules_python/pull/769/files#diff-2772f4c795e29614d2ca3c7f3302d558abe63bae2379d65285bcdf12e4ea469fR112 |
UebelAndre
commented
Aug 2, 2022
Ah yes, I misread the lines changed. Would you be willing to rebase and see if the failure is a flake? |
I think I found the issue and it's that if you glob for diff --git a/python/repositories.bzl b/python/repositories.bzl
index 8bb8a9c..a1fd4cd 100644
--- a/python/repositories.bzl+++ b/python/repositories.bzl@@ -131,6 +131,29 @@ def _python_repository_impl(rctx):
python_bin = "python.exe" if ("windows" in platform) else "bin/python3"
+ if "windows" in platform:+ glob_include = [+ "*.exe",+ "*.dll",+ "bin/**",+ "DLLs/**",+ "extensions/**",+ "include/**",+ "Lib/**",+ "libs/**",+ "Scripts/**",+ "share/**",+ ]+ else:+ glob_include = [+ "bin/**",+ "extensions/**",+ "include/**",+ "lib/**",+ "libs/**",+ "share/**",+ ]+
build_content = """\
# Generated by python/repositories.bzl
@@ -141,18 +164,7 @@ package(default_visibility = ["//visibility:public"])
filegroup(
name = "files",
srcs = glob(
- include = [- "*.exe",- "*.dll",- "bin/**",- "DLLs/**",- "extensions/**",- "include/**",- "lib/**",- "libs/**",- "Scripts/**",- "share/**",- ],+ include = {glob_include},
# Platform-agnostic filegroup can't match on all patterns.
allow_empty = True,
exclude = [
@@ -206,6 +218,7 @@ py_runtime_pair(
py3_runtime = ":py3_runtime",
)
""".format(
+ glob_include = json.encode(glob_include),
python_path = python_bin,
python_version = python_short_version,
)
|
8507872 to
50ab2c6Compare…g up lib twice (as Lib) on macOS
jesseschalken
commented
Aug 2, 2022
@UebelAndre Good spot. That fixed it. Thanks! |
UebelAndre
commented
Aug 2, 2022
@groodt Do you have time to take a look at this one this week as well? |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
python_repositoryrule crashes with:Failed to make interpreter installation read-only. 'chmod' error msg: chmod: cannot access 'lib': No such file or directorybecause thelibdirectory is actually calledLibLibdirectory causing no builtin libraries to be found when running the cross compiledpy_binary.Issue Number: N/A
What is the new behavior?
python_repositoryrule implementation doesn't crash.Libdirectory is included correctly.Does this PR introduce a breaking change?
Other information