bazel-contrib / bazel-contrib/bazel-lib
[Bug]: key "freebsd_amd64" not found in dictionary
- Dominant language
- Starlark
- Stars
- 182
- Forks
- 134
- Avg merge
- 1d 46m
- Merged PRs (30d)
- 1
Description
### What happened?
I added an `http_archive` that loads this repository transitively. In one of the function calls, it uses [copy_directory_platform_repo](https://github.com/aspect-build/bazel-lib/blob/main/lib/private/copy_directory_toolchain.bzl), but raises the error in the title.
This happens because [COPY_DIRECTORY_PLATORMS](https://github.com/aspect-build/bazel-lib/blob/8fa21275181371b38f76ef30d0aa14006a2b472b/lib/private/copy_directory_toolchain.bzl#L12) has the key `freebsd_amd64`, but `COPY_DIRECTORY_INTEGRITY` used [here](https://github.com/aspect-build/bazel-lib/blob/8fa21275181371b38f76ef30d0aa14006a2b472b/lib/private/copy_directory_toolchain.bzl#L170) and declared [here](https://github.com/aspect-build/bazel-lib/blob/main/tools/versions.bzl) does not.
### Version
Dev architecture: MacOS arm64
```
bazel --version
bazel 6.3.2-homebrew
```
Tool that I want to install:
```
http_archive(
name = "aspect_rules_js",
sha256 = "77c4ea46c27f96e4aadcc580cd608369208422cf774988594ae8a01df6642c82",
strip_prefix = "rules_js-1.32.2",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.32.2/rules_js-v1.32.2.tar.gz",
)
```
`aspect_bazel_lib` loaded transitively:
```
http_archive(
name = "aspect_bazel_lib",
sha256 = "44f4f6d1ea1fc5a79ed6ca83f875038fee0a0c47db4f9c9beed097e56f8fad03",
strip_prefix = "bazel-lib-1.34.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.34.0/bazel-lib-v1.34.0.tar.gz",
)
```
The error happens when `bazel sync`ing.
The version downloaded there is different from the latest one here, but I think the code would yield the same error given that the key does not exist.
### How to reproduce
```shell
WORKSPACE
http_archive(
name = "aspect_rules_js",
sha256 = "77c4ea46c27f96e4aadcc580cd608369208422cf774988594ae8a01df6642c82",
strip_prefix = "rules_js-1.32.2",
url = "https://github.com/aspect-build/rules_js/releases/download/v1.32.2/rules_js-v1.32.2.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
```
OS: MacOS arm64 (Apple M2 Max)
```
Contributor guide
Research direction
Read lib/private/copy_directory_toolchain.bzl, especially COPY_DIRECTORY_PLATFORMS and the lookup around line 170, then inspect tools/versions.bzl for COPY_DIRECTORY_INTEGRITY. Reproduce the failure with the supplied WORKSPACE and bazel sync; done means the freebsd_amd64 entry is handled without the dictionary error.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100