bazelbuild / bazelbuild/bazel

Patterns for `--deleted_packages`.

Open
#28,844 0 comments 1 reaction 0 assignees View on GitHub
team-Loading-API type: feature request undecided
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

I propose a pattern (or a prefix match) for `--deleted_packages`.

```
--deleted_packages=foo/bar/...
```

Note this is different than .bazelignore/ignore_directories(), because it does not restrict glob().

### Which category does this issue belong to?

Configurability

### What underlying problem are you trying to solve with this feature?

This is useful anytime you want Bazel to skip interpreting BUILD files, but not ignore other contents.

---

It can be useful to reach across every file in the repo.

1. Linting
2. E2E tests on Bazel itself

To do this, I create a repo that symlinks the workspace, and then use `--deleted_packages` to effectively deleted all the BUILD files from the repo. I can add a root BUILD to the repo that can glob() anything.

The `--deleted_packages` winds up quite long.

---

Another case is adding code from other projects without having any part of their BUILDs affect things. Either because they are poorly written, or they are for another system (Buck).

Being able to *delete all package definitions below a certain point -- while still having access to the files* -- is a valuable escape hatch.

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

_No response_

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

_No response_

### 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` ?

```text

```

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

Research direction

Start by tracing how the --deleted_packages option is parsed and how deleted packages affect BUILD-file interpretation. Define the behavior for a prefix pattern such as foo/bar/... while preserving access to other files and glob() results; no specific files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.