bazel-contrib / bazel-contrib/bazel-lib

File corruption via `CopyFile` action

Open
#1,282 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
182
Forks
134
Avg merge
1d 46m
Merged PRs (30d)
1

Description

We noticed two cases where instead of proper files, we got files with the expected size, but just null bytes as their content after a copy operation using `CopyFile`. In both cases, this happened for protobuf compilation via rules_proto_grpc, which depends on the old aspect_bazel_lib 2.x releases.
`CopyFile` for the 2.x releases references coreutils version 0.1.0 instead of 0.5.0. We patched aspect_bazel_lib locally to use 0.5.0 for now, but I am wondering whether I should open a pull request to update aspect_bazel_lib to coreutils 0.5.0 or 0.9.0. For bazel_lib, I have already opened https://github.com/bazel-contrib/bazel-lib/pull/1270.

I unfortunately don't have a reliable reproducer to confirm that coreutils 0.5.0 or 0.9.0 properly fix the underlying root cause.

Contributor guide

Open the contributing guide

Research direction

Start at the CopyFile action and inspect how aspect_bazel_lib 2.x references coreutils 0.1.0, comparing it with 0.5.0 and 0.9.0. Reproduce the protobuf compilation case through rules_proto_grpc if possible, and consider it done when copied files contain their expected data rather than null bytes.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.