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 should not build/test targets inside output_base if output_base is in source tree #22909

Open
peakschris opened this issue Jun 27, 2024 · 1 comment
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged

Comments

@peakschris
Copy link

peakschris commented Jun 27, 2024

Description of the bug:

When we build/test with bazel in CI, we run with this command:

bazel --output_base=output test //...

However, if any external deps contain test targets, these are picked up by the build, evaluated in the context of outer workspace, and fail.

ERROR: Skipping '//...': error loading package under directory '': error loading package 'output/external/our_rules~/tests/lib/libb': cannot load '//:tools/defs.bzl': no such file

The question is: should the directory that bazel creates with --output_base be automatically ignored in build/test steps if it's inside the workspace?

Which category does this issue belong to?

Core

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which operating system are you running Bazel on?

windows

What is the output of bazel info release?

bazel 7.2.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 ?

No response

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

@github-actions github-actions bot added the team-Core Skyframe, bazel query, BEP, options parsing, bazelrc label Jun 27, 2024
@peakschris
Copy link
Author

peakschris commented Jun 27, 2024

This does not workaround the issue:

bazel --output_base=output test //... --deleted_packages=output

A workaround is:

echo output >> .bazelignore
bazel --output_base=output test //...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Core Skyframe, bazel query, BEP, options parsing, bazelrc type: bug untriaged
Projects
None yet
Development

No branches or pull requests

4 participants