bazelbuild / bazelbuild/bazel

mod graph --output graph generates invalid graphviz data when using --extension_info repos

Open
#26,552 1 comment 0 reactions 1 assignee Claimed by @meteorcloudy View on GitHub
P2 team-ExternalDeps type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

It looks like it might be losing track of subgraphs, and forgetting to close them?

### Which category does this issue belong to?

_No response_

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

```bash
git clone --depth 1 https://github.com/bazelbuild/bazel
cd bazel
bazel mod graph --extension_info repos --output graph | dot -Tpdf > /tmp/meow.pdf
```
you get:
```
Error: : syntax error in line 856
```

A snippet of the output is:
```dot
subgraph "cluster_@@//:MODULE.bazel%//src/main/res:winsdk_configure.bzl winsdk_configure" {
label="@@//:MODULE.bazel%//src/main/res:winsdk_configure.bzl winsdk_configure"
"@@//:MODULE.bazel%//src/main/res:winsdk_configure.bzl winsdk_configure%local_config_winsdk" [ label="local_config_winsdk" ]
"" -> "@@//:MODULE.bazel%//src/main/res:winsdk_configure.bzl winsdk_configure%local_config_winsdk"
subgraph "cluster_@@//:MODULE.bazel%//src/test/shell/bazel:list_source_repository.bzl list_source_repository" {
label="@@//:MODULE.bazel%//src/test/shell/bazel:list_source_repository.bzl list_source_repository"
"@@//:MODULE.bazel%//src/test/shell/bazel:list_source_repository.bzl list_source_repository%local_bazel_source_list" [ label="local_bazel_source_list" ]
"" -> "@@//:MODULE.bazel%//src/test/shell/bazel:list_source_repository.bzl list_source_repository%local_bazel_source_list"
```

### Which operating system are you running Bazel on?

linux

### What is the output of `bazel info release`?

release 8.3.1

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.