fix(repo setup): Skip aliases for unloaded toolchains#1473
fix(repo setup): Skip aliases for unloaded toolchains#1473rickeylev merged 1 commit intobazel-contrib:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
ed59285 to
b646894
Compare
rickeylev
left a comment
There was a problem hiding this comment.
mostly lgtm, just move the platforms constant out of the generated defs.bzl
python/private/toolchains_repo.bzl
Outdated
|
|
||
| host_platform = "{host_platform}" | ||
| interpreter = "@{py_repository}_{host_platform}//:{python3_binary_path}" | ||
| PLATFORMS = [ |
There was a problem hiding this comment.
Please take this out of defs.bzl -- defs.bzl is a public entry point, and this isn't a detail we want to make part of our public API.
Instead, it can be inlined in build_contents directly:
_plaforms = [
{loaded_platforms}
]
There was a problem hiding this comment.
IMO the selection of platforms is valuable information, but I am not sure if this is the right form to make that available. So, I am fine with removing it.
There was a problem hiding this comment.
Changed as suggested.
CHANGELOG.md
Outdated
| * Skip aliases for unloaded toolchains. Toolchains without a checksum are skipped | ||
| in the repo load phase. These skipped repos now don't have aliases in the toolchains repo. | ||
| This is relevant when working with older python versions that don't have full platform | ||
| support. |
There was a problem hiding this comment.
| * Skip aliases for unloaded toolchains. Toolchains without a checksum are skipped | |
| in the repo load phase. These skipped repos now don't have aliases in the toolchains repo. | |
| This is relevant when working with older python versions that don't have full platform | |
| support. | |
| * Skip aliases for unloaded toolchains. Some Python versions that don't have full | |
| platform support, and referencing their undefined repositories can break operations | |
| like `bazel query rdeps(...)`. |
|
CI is unhappy, but it's not immediately apparent why. It gives me the feeling there might be a syntax error somewhere? Or maybe what's happening is the BUILD file is trying to load defs.bzl before something defs.bzl needs is ready? Maybe removing that |
Toolchains without a checksum are skipped in python_register_toolchain. This commit also skips the creation of aliases to those toolchains. Closes bazel-contrib#1472
b646894 to
4f3af59
Compare
|
@rickeylev I have addressed your concerns. CI is happy now, even without knowing the root cause of the original failures. Could you please re-review? |
Some platforms don't contain every version, e.g. s390x doesn't have 3.8, which is
indicated by a missing sha256 value. When this happens, no repository for the runtime
is created (
python_repositoryrule).Similar logic needs to be in the toolchains setup logic because otherwise a reference
to an undefined repository exists in the select() expression of the aliases. Because those
references are lazily evaluated, they don't always cause a problem, but do mean that
query operations (e.g.,
rdeps()) can't work and the order of entries is important(which is surprising).
Closes #1472