Every .bzl file must have a corresponding package, but X does not have one
See original GitHub issueDescription of the problem / feature request:
Twice in the last two days when returning to rebuild a Bazel project, I’ve seen an error about it being unable to find the .bzl file for rules_cc rules. I think this has to do with the implicit loading of rules_cc by Bazel, as you’ll notice that nowhere is that file mentioned in the repository (https://sourcegraph.com/search?q=repo:^github\.com/google/llvm-bazel%24+“cc:defs.bzl”&patternType=regexp).
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
As this is a non-deterministic thing, it’s a bit hard to reproduce. It seems to happen basically every time I fetch new commits in https://github.com/google/iree or https://github.com/google/llvm-bazel
What operating system are you running Bazel on?
Linux Debian
What’s the output of bazel info release
?
Happens with Bazel 3.3.1 and 3.7.1
What’s the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?
$ git remote get-url origin ; git rev-parse main ; git rev-parse HEAD
git@github.com:GMNGeoffrey/llvm-bazel.git
e463a75a963dc583ef1ccc6122aceaaabd5b8e09
e463a75a963dc583ef1ccc6122aceaaabd5b8e09
Have you found anything relevant by searching the web?
No
Issue Analytics
- State:
- Created 3 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
Every .bzl file must have a corresponding package, but '@npm ...
I am working on integrating Bazel into an Angular ...
Read more >0e66ef31d611b9fe5b762bc7b36...
... not use the distribution since it failed with "Every .bzl file must have a corresponding package, but '@rules_cc//:internal_deps.bzl' does not have one....
Read more >Concepts and terminology - Bazel 4.2.1
Source files in the workspace are organized in a nested hierarchy of packages, where each package is a directory that contains a set...
Read more >bazel-gazelle - Go Packages
Gazelle is not an official Google product. ... If you are using a `WORKSPACE.bazel` file, you will need to specify that using: .....
Read more >bazelbuild/bazel-gazelle
Repository rules are Bazel rules that can be used in WORKSPACE files to ... If build files are not already present, it can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@GMNGeoffrey
Just add the
strip_prefix
will solve your problem.And I think it is how bazel works indeed. If you don’t add
strip_prefix
, bazel will download thehttp_archive
https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz to a folder namedbazel-skylib-1.0.2
. When you want to load something from that folder, you might have to do something like@bazel-skylib//bazel-skylib-1.0.2/...
.What do you think ?
This happens to me just about every time I fetch new stuff from the repository at this point.