bazel-contrib / bazel-contrib/rules_oci
oci_image: paths.relativize fails on Windows ARM64 in _maybe_wrap_launcher_for_windows
- Dominant language
- Starlark
- Stars
- 423
- Forks
- 213
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
## Description
`oci_image` fails on Windows ARM64 with a path relativization error:
```
ERROR: Analysis of target '//apps/budget-tracker/src/Handlers:pipeline_image' failed
Error in fail: Path 'external/rules_oci+/oci/private/descriptor.sh' is not beneath
'bazel-out/arm64_windows-fastbuild/bin/apps/budget-tracker/src/Handlers'
```
## Root cause
`oci/private/util.bzl:227` in `_maybe_wrap_launcher_for_windows`:
```python
launcher = paths.relativize(bash_launcher.path, win_launcher.dirname)
```
On Windows ARM64, the bash launcher path (`external/rules_oci+/oci/private/descriptor.sh`) and the output directory (`bazel-out/arm64_windows-fastbuild/bin/...`) don't share a common prefix that `bazel_skylib`'s `paths.relativize` can resolve.
## Environment
- rules_oci: 2.3.0
- Bazel: 8.x
- Host: Windows 11 ARM64
- The same code works on Linux x86_64, Linux ARM64, macOS ARM64, and Windows x86_64.
- Only Windows ARM64 (`bazel-out/arm64_windows-fastbuild`) is affected.
## Workaround
None — `oci_image` can't be used on Windows ARM64 as of v2.3.0.
Contributor guide
Research direction
Start at oci/private/util.bzl:227, in _maybe_wrap_launcher_for_windows, and reproduce the reported oci_image failure on Windows 11 ARM64 with Bazel 8.x. Verify the path handling for the bash launcher and Windows output directory; done means the pipeline_image target analyzes successfully on Windows ARM64 without the relativization error.
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
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100