Check ignored files for glob(pattern, allow_empty=False) errors and provide a hint if applicable
I spent a few hours investigating a seemingly stupid looking build issue where a glob pattern was returning an empty list even though the relevant files were present. This was because those files had been marked as being ignored using a .bazelignore file (TILed such a feature exists).
It would be useful to surface an error message like "hey, this glob was empty but there are some ignored files here" when surfacing the empty glob error.
(Aside: I couldn't tell which issue template should be used for error message improvements, so I've created a blank issue.)
Duplicate https://github.com/bazelbuild/bazel/issues/12034
I don't think this is a duplicate of https://github.com/bazelbuild/bazel/issues/12034; that issue seems to be assuming that the current behavior is a bug. My impression was that the current behavior is desirable, but the diagnostic should be improved in the empty case.
Additionally, that issue is about .bazelignore-d directories, whereas this issue isn't specific to directories.
I don't know what the correct behavior for glob should be (#12034). I will say that we shouldn't output warnings by default, unrequested. A flag for debugging empty globs might be feasible.
I will say that we shouldn't output warnings by default, unrequested
This issue is a suggestion for adding a hint to an already existing error, not for outputting a warning by default in situations which work fine today. From my original comment:
It would be useful to surface an error message like "hey, this glob was empty but there are some ignored files here" when surfacing the empty glob error. (emphasis added)
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!