google / tcmalloc

Apache License 2.0
4.41k stars 480 forks source link

[bazel] Restore compatibility with --incompatible_disallow_empty_glob #239

Closed fhanau closed 4 months ago

fhanau commented 6 months ago

Background Bazel defines a --incompatible_disallow_empty_glob flag that is used to disallow glob statements that resolve to an empty set of files. The flag is currently off-by-default, set to be flipped in a future Bazel version. I work on a project that has already enabled the flag for forward compatibility and uses tcmalloc as a dependency.

Issue Tcmalloc used to work with --incompatible_disallow_empty_glob enabled, but bb80955d added several empty globs, which breaks the build with the flag enabled. This PR drops the empty globs, restoring compatibility. It also enables the flag in .bazelrc so this won't break again – that part is optional, I'd still be happy if the fix itself gets integrated.

fhanau commented 4 months ago

Would love to get a review for this – happy to only land the changes in tcmalloc/BUILD and tcmalloc/internal/BUILD if you are unfamiliar with the flag.

ckennelly commented 4 months ago

Can you sync past https://github.com/google/tcmalloc/commit/cba1aeabdc1dba9e12cd69bb577b0f3391bbc62e? Several of these globs are now non-empty.

fhanau commented 4 months ago

Can you sync past cba1aea? Several of these globs are now non-empty.

Rebased the PR – you're right, only one glob still needs to be updated.

ckennelly commented 4 months ago

This has been merged with d36a84392b633dc337e7fd5656d7aa8fe1005832.

fhanau commented 4 months ago

Great, thank you!