Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel build issue #44

Open
DhamodharanG-ai opened this issue Sep 28, 2024 · 3 comments
Open

Bazel build issue #44

DhamodharanG-ai opened this issue Sep 28, 2024 · 3 comments

Comments

@DhamodharanG-ai
Copy link

I am new to use Bazel universe,

After cloning the repo, I tried to run: bazel build ...:all

But I got the following error:

ERROR: Skipping '...:all': error loading package under directory '': error loading package 'externals/llvm-project/utils/bazel/llvm-project-overlay/mlir/unittests': Every .bzl file must have a corresponding package, but '//mlir:tblgen.bzl' does not have one. Please create a BUILD file in the same or any parent directory. Note that this BUILD file does not need to do anything except exist.

@j2kun
Copy link
Owner

j2kun commented Sep 29, 2024

I think the most recent push of the PDLL article might have landed the tutorial at a bad upstream LLVM commit hash. I cannot reproduce this myself but I see a different, perhaps related issue. I will try bumping it to a more recent commit and see if that resolves the issue.

In the meantime, if you're working on a specific tutorial, you could check out the commit for that tutorial instead. E.g., checkout 031e5fe for the verifiers tutorial

@j2kun
Copy link
Owner

j2kun commented Sep 29, 2024

ah I see the problem. The CMake build added the externals directory, which is conflicting with the glob in bazel build ...:all because the external LLVM from that directory includes bazel files.

You can get around this by just building a specific target, either bazel build //tools:tutorial-opt for the main binary, or else bazel test //tests/...:all for tests.

I will try to find a better fix.

@j2kun
Copy link
Owner

j2kun commented Sep 29, 2024

I found a slightly better fix: adding --deleted_packages=externals to .bazelrc. Try updating to the latest commit of this repository and running bazel build ...:all again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants