question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Every .bzl file must have a corresponding package, but X does not have one

See original GitHub issue

Description 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:closed
  • Created 3 years ago
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

2reactions
vnghiacommented, Jan 7, 2021

@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 the http_archive https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz to a folder named bazel-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 ?

2reactions
GMNGeoffreycommented, Dec 15, 2020

This happens to me just about every time I fetch new stuff from the repository at this point.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found