bazelbuild / bazelbuild/bazel

`bazel vendor` does not work as expected when using local registry.

Open
#25,503 4 comments 0 reactions 0 assignees View on GitHub
help wanted 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:

The marker file for repos with patches will have different digest if repo is located at different places.

Likely because of https://github.com/bazelbuild/bazel/blob/f805f55e929069a00b83bf2de41fe945f1cb18d2/src/main/java/com/google/devtools/build/lib/packages/RuleFormatter.java#L64

Similar to https://github.com/bazelbuild/bazel/issues/19621

### 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.

```
git clone https://github.com/boleynsu-org/monorepo A
git clone https://github.com/boleynsu-org/monorepo B
(cd A; bazel vendor //... --vendor_dir=v; cat $(ls v/*.marker | sort) >m)
(cd B; bazel vendor //... --vendor_dir=v; cat $(ls v/*.marker | sort) >m)
diff A/m B/m
```

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

Fedora 41

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

release 8.1.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

Research direction

Reproduce the differing marker files with two clones using the provided bazel vendor commands, then inspect src/main/java/com/google/devtools/build/lib/packages/RuleFormatter.java around line 64. Done means repos with patches produce the same marker digest regardless of their filesystem location; the issue does not name a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.