-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
No way to tell .bazelignore to ignore all folders of the given name #8106
Comments
@alexeagle This issue will be a problem for rules_nodejs users after bazel-contrib/rules_nodejs#704 lands since every yarn_install & npm_install rule will create a node_modules folder somewhere in the user's WORKSPACE that will be ignored by git by default but not by bazel. |
Indeed, this is a problem. Expected behavior, from working with other tools that have a ".ignore" file, would be that |
This sounds like a reasonable request. I'm a bit worried that it might be too easy to accidentally exclude a directory, and wonder if the use of a wildcard syntax on anchored patterns might help make it more explicit. But then again, it's probably better to be consistent with .gitignore syntax. |
+1 to this |
This is a duplicate of #7093 |
Another discovery: Is Bazel not ignoring the |
Bazel removed `managed_directories` feature on Bazel@HEAD, see: [1]. Design document is here: [2]. Also extend the .bazelignore and add explicitly the path to the node_modules directories. Note, that Bazel currently doesn't support the same semantic as .gitignore. For more details see this issue: [3] and this issue specific to rules_nodejs: [4]. [1] bazelbuild/bazel#15463 [2] https://docs.google.com/document/d/1u9V5RUc7i6Urh8gGfnSurxpWA7JMRtwCi1Pr5BHeE44/edit [3] bazelbuild/bazel#7093 [4] bazelbuild/bazel#8106 Release-Notes: skip Change-Id: I5dc582e05e4116064fc06d438d4b8a8b57b6bb8d
Closing as dup of #7093. |
Description of the problem / feature request:
A
.bazelignore
pattern such asonly ignores the
node_modules
folder at the root level where the.bazelignore
file is. This means that in nodejs projects, every singlenode_modules
folder needs to be explicitly listed in.bazelignore
.Not ignoring a node_modules folder can lead to unexpected build errors as these folders contain downloaded npm dependencies that may contain BUILD files that should be ignored.
node_modules
folders are almost always all untracked and ignored in.gitignore
so there are often left around in subdirectories when changing git branches and these are not easily noticed as they are ignored by git.Feature requests: what underlying problem are you trying to solve with this feature?
Have
.bazelignore
patterns that don't start with/
match in any directory. This would match the behavior of.gitignore
. For example:What operating system are you running Bazel on?
OSX
What's the output of
bazel info release
?release 0.24.0
Any other information, logs, or outputs that you want to share?
For reference:
The text was updated successfully, but these errors were encountered: