bazelbuild / bazelbuild/bazel

Bazel `fetch` on bazel sources crashes on debian_* modules

Open
#19,736 0 comments 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 16h
Merged PRs (30d)
72

Description

### Description of the bug:

`bazel fetch src:bazel_nojdk` fails with

ERROR: .../bazel/third_party/BUILD:486:20: no such package '@[unknown repo 'debian_java_deps' requested from @]//': The repository '@[unknown repo 'debian_java_deps' requested from @]' could not be resolved: No repository visible as '@debian_java_deps' from main repository and referenced by '//third_party:netty'

ERROR: .../bazel/third_party/grpc-java/BUILD:71:18: no such package '@[unknown repo 'debian_bin_deps' requested from @]//': The repository '@[unknown repo 'debian_bin_deps' requested from @]' could not be resolved: No repository visible as '@debian_bin_deps' from main repository and referenced by '//third_party/grpc-java:grpc-java-plugin'

It is however possible to fetch all the dependencies with the trick from https://github.com/bazelbuild/bazel/issues/13847:

bazel --output_base=$PWD/bazel-output-base \

aquery src:bazel_nojdk \
--distdir=$PWD/bazel-dist-dir --repository_cache=$PWD/bazel-repository-cache

Oddly enough, `query` (which is closer to `fetch` than `aquery` and `cquery`) does work:

bazel --output_base=$PWD/bazel-output-base \

aquery src:bazel_nojdk \
--distdir=$PWD/bazel-dist-dir --repository_cache=$PWD/bazel-repository-cache

So the problem is in `fetch`, or in bazel codebase, but it seems that some projects need a configuration to be queryable.

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

I think you should be able to reproduce this issue by

1. checkout bazel sources @ 7.0.0-pre.20230917.3
2. run `bazel-6.3.2 fetch src:bazel_nojdk`

Note that the issue is in bazel 6.3.2, not 7.0.0 (but maybe still in 7.0.0)

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

NixOS

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

release 6.3.2- (@non-git)

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

It's bazel_6 from nixpkgs, built here: https://hydra.nixos.org/build/236318603. /nix/store/cmx3ikvl09ycd4f8vnw6r5zqd2qnliyj-bazel-6.3.2 to be precise.

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

```text
For the 7.0.0 checkout, it is

git@github.com:bazelbuild/bazel.git
c61b0e1347f5d40ba0b526661bf5a5bc09e6ccfb
7a8dc50dfee0e441996acee804a4e3a6fc96f615
```

### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No, I think it is the same core issue as https://github.com/bazelbuild/bazel/issues/13847

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