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] Add support for --incompatible_disallow_empty_glob #85999

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

keith
Copy link
Member

@keith keith commented Mar 20, 2024

This bazel flag, that should be flipped in an upcoming release bazelbuild/bazel#15327, fails if globs have no matches. This helps find libraries where you are accidentally not including files because of typos. This change removes the various globs that were not matching anything, and uncovered some targets that were doing nothing because their source files were deleted. There are a few cases where globs were intentionally optional in the case of loops that expanded to different potential options, so those now use allow_empty = True. This allows downstream consumers to also flip this flags for their own builds, where previously this would fail in LLVM instead.

The downside to this change is that if files are added in these relatively standard locations, manual work will have to be done to add this patterns back. If folks prefer we could instead add allow_empty = True to every glob.

@keith keith requested a review from rupprecht as a code owner March 20, 2024 19:58
@llvmbot llvmbot added the bazel "Peripheral" support tier build system: utils/bazel label Mar 20, 2024
Copy link
Member

@akuegel akuegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I think it makes sense to not allow patterns that don't match anything.

@keith keith force-pushed the users/keith/bazel/incompatible-glob branch from 604e9f5 to d6e9826 Compare March 22, 2024 16:04
This bazel flag, that should be flipped in an upcoming release
bazelbuild/bazel#15327, fails if globs have no
matches. This helps find libraries where you are accidentally not
including files because of typos. This change removes the various globs
that were not matching anything, and uncovered some targets that were
doing nothing because their source files were deleted. There are a few
cases where globs were intentionally optional in the case of loops that
expanded to different potential options, so those now use
`allow_empty = True`. This allows downstream consumers to also flip this
flags for their own builds, where previously this would fail in LLVM
instead.

The downside to this change is that if files are added in these
relatively standard locations, manual work will have to be done to add
this patterns back. If folks prefer we could instead add
`allow_empty = True` to every glob.
@keith keith force-pushed the users/keith/bazel/incompatible-glob branch from d6e9826 to 77f1c93 Compare March 22, 2024 16:32
@keith keith merged commit 72c729f into main Mar 22, 2024
4 checks passed
@keith keith deleted the users/keith/bazel/incompatible-glob branch March 22, 2024 16:51
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
This bazel flag, that should be flipped in an upcoming release
bazelbuild/bazel#15327, fails if globs have no
matches. This helps find libraries where you are accidentally not
including files because of typos. This change removes the various globs
that were not matching anything, and uncovered some targets that were
doing nothing because their source files were deleted. There are a few
cases where globs were intentionally optional in the case of loops that
expanded to different potential options, so those now use `allow_empty =
True`. This allows downstream consumers to also flip this flags for
their own builds, where previously this would fail in LLVM instead.

The downside to this change is that if files are added in these
relatively standard locations, manual work will have to be done to add
this patterns back. If folks prefer we could instead add `allow_empty =
True` to every glob.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants