bazel-contrib / bazel-contrib/rules_oci
Bazel warning regarding deprecated `@@bazel_tools//src/conditions:host_windows_x64_constraint` being used by `oci_image`
- Dominant language
- Starlark
- Stars
- 423
- Forks
- 213
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
We recently noticed this warning from bazel:
```
WARNING: /path/to/BUILD.bazel:82:10: in _write_file rule //:docker_write_cmd: target '//:docker_write_cmd' depends on deprecated target '@@bazel_tools//src/conditions:host_windows_x64_constraint': No longer used by Bazel and will be removed in the future. Migrate to toolchains or define your own version of this setting.
```
the line in `BUILD.bazel` is an `oci_image` rule:
```bzl
load("@rules_oci//oci:defs.bzl", "oci_image")
...
oci_image( # <- this is line 82
name = "docker",
base = BASE_IMAGE,
cmd = [
"/go/bin/foo",
],
tars = [
":bin",
],
workdir = WORKDIR,
)
...
```
We are using rules_oci 2.2.6 with bazel 8.3.1.
Contributor guide
Research direction
Start with the oci_image rule at line 82 of BUILD.bazel and reproduce the warning using rules_oci 2.2.6 with Bazel 8.3.1. Trace which dependency introduces the deprecated host_windows_x64_constraint and verify that the resulting configuration no longer emits the warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100