Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: spurious write_source_file test failures with RBE #482

Closed
shahms opened this issue Jul 24, 2023 · 1 comment
Closed

[Bug]: spurious write_source_file test failures with RBE #482

shahms opened this issue Jul 24, 2023 · 1 comment
Labels
bug Something isn't working untriaged Requires traige

Comments

@shahms
Copy link

shahms commented Jul 24, 2023

What happened?

I have a bit of an awkward vendoring setup where we want to copy remote protocol buffer files to the local source tree and commit the generated Go alongside it (so the repository can be built via go build). This mostly works fine, except I occasionally see (apparently) spurious test failures when using RBE to build the test. Specifically, I see:

INFO: From Testing //third_party/bazel:proto_srcs_sync_test:
==================== Test output for //third_party/bazel:proto_srcs_sync_test:
ERROR: cannot compare a directory "third_party/bazel/proto_srcs" against a file "third_party/bazel/src"
================================================================================

The test runs fine if built locally (surviving even a bazel clean) and when manually inspecting the files in question in the execroot, both appear to be directories and not files.

Version

Development (host) and target OS/architectures:
Debian rodete-based Linux distribution

Output of bazel --version: bazel 6.2.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

http_archive(
    name = "aspect_bazel_lib",
    sha256 = "d488d8ecca98a4042442a4ae5f1ab0b614f896c0ebf6e3eafff363bcc51c6e62",
    strip_prefix = "bazel-lib-1.33.0",
    url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.33.0/bazel-lib-v1.33.0.tar.gz",
)

load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

aspect_bazel_lib_dependencies()

Language(s) and/or frameworks involved:

How to reproduce

It's really (frustatingly) inconsistent. I have nearly identical setup for Rust protobufs that has never exhibited the behavior. But the BUILD snippet which causes problems is:


copy_to_directory(
    name = "proto_srcs",
    srcs = [
        # We need to include the Gazelle-generated BUILD files in the original bundle to avoid test failures.
        "//third_party/bazel/src/main/java/com/google/devtools/build/lib/buildeventstream/proto:BUILD",
        "//third_party/bazel/src/main/java/com/google/devtools/build/lib/packages/metrics:BUILD",
        "//third_party/bazel/src/main/protobuf:BUILD",
        "@io_bazel_files//:proto_srcs",
    ],
    include_external_repositories = ["io_bazel_files"],
    replace_prefixes = {
        "src/": "",
        "third_party/bazel/": "",
    },
    visibility = ["//visibility:private"],
)

write_source_file(
    name = "proto_srcs_sync",
    in_file = ":proto_srcs",
    out_file = "src",
    visibility = ["//visibility:private"],
)


### Any other information?

_No response_
@shahms shahms added the bug Something isn't working label Jul 24, 2023
@github-actions github-actions bot added the untriaged Requires traige label Jul 24, 2023
@mattem
Copy link
Contributor

mattem commented Sep 22, 2023

Fixed by #531

@mattem mattem closed this as completed Sep 22, 2023
@github-project-automation github-project-automation bot moved this to ✅ Done in Open Source Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Requires traige
Projects
None yet
Development

No branches or pull requests

2 participants