Skip to content

Genquery: cycle in dependency graph #2522

@UebelAndre

Description

@UebelAndre

It seems using genquery on any Rust targets leads to failures due to a cycle in the dependency graph. The diff below can be used to repro the issue and get the output that follows.

diff --git a/crate_universe/BUILD.bazel b/crate_universe/BUILD.bazel
index 370dc5c3..ffb18c11 100644
--- a/crate_universe/BUILD.bazel
+++ b/crate_universe/BUILD.bazel
@@ -76,6 +76,12 @@ rust_binary(
     deps = [":cargo_bazel"],
 )

+genquery(
+    name = "genquery",
+    scope = [":cargo_bazel_bin"],
+    expression = "deps(:cargo_bazel_bin)",
+)
+
 alias(
     name = "bin",
     actual = ":cargo_bazel_bin",
~/Code/rules_rust (main ✗) bazel build //crate_universe:genquery
ERROR: /Users/user/Code/rules_rust/util/process_wrapper/BUILD.bazel:31:36: in rust_binary_without_process_wrapper rule //util/process_wrapper:process_wrapper: cycle in dependency graph:
    //crate_universe:genquery (e5528793e6772dcf5ff2b9774ea78fbb21b115ab96d65cadb8cb5b68206d2fe6)
    //crate_universe:genquery (577c459edef5fa899d167957b8c740aeb5edc881970dd81d94adeef309381026)
    //crate_universe:cargo_bazel_bin
.-> //util/process_wrapper:process_wrapper
|   //util/import:import
|   //util/import:import_macro_label
|   //util/import:import_macro
|   //util/import:import_macro_impl
`-- //util/process_wrapper:process_wrapper
ERROR: Analysis of target '//crate_universe:genquery' failed; build aborted

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions