-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[FR] .bazelignore should support wildcard prefix #7093
Comments
Is somebody working on this issue? If not, I'd like to start working on a patch. |
+1 for the Angular repo.
|
+1 for all the rules_* repos, which typically have a variety of sub-repos to handle testing the rules. |
@tclem ran into an issue where he had built `semantic-source` from the `semantic-source` directory; `cabal` placed a `dist-newstyle` directory there, which was fouling up Bazel due to the fact that `cabal` generates binary files called `BUILD`, and Bazel tries to interpret these files as package configurations. Not good! We can't use a glob here because .bazelignore files don't support globbing (bazelbuild/bazel#7093), so it suffices to ignore all the projects' `dist-newstyle` directories so that no one runs into this again.
@tclem ran into an issue where he had built `semantic-source` from the `semantic-source` directory; `cabal` placed a `dist-newstyle` directory there, which was fouling up Bazel due to the fact that `cabal` generates binary files called `BUILD`, and Bazel tries to interpret these files as package configurations. Not good! We can't use a glob here because .bazelignore files don't support globbing (bazelbuild/bazel#7093), so it suffices to ignore all the projects' `dist-newstyle` directories so that no one runs into this again.
also related #13807 |
Is this a dup of #8106? |
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
Experience report: Like others, we have a monorepo where developers run Even with these precautions, we run into issues after the repo structure has changed upstream and a developer does I acknowledge that the root cause here is really that we put non-source files into the source tree, but we are not aware of a practical way to avoid that (short of building our own IDE plugins). Wildcards in the |
This creates a new `pnpm-workspace.yaml` which makes it install `node_modules/` in all the `packages/*` directories. This wasn't necessary before because `rules_prerender` and `@rules_prerender/declarative_shadow_dom` don't have any external dependencies, but it is necessary to install package-specific dependencies. Also updates `tsconfig.json` to work for any `@rules_prerender/*` packages instead of just `@rules_prerender/declarative_shadow_dom`. `.bazelignore` needs to be updated as well, but doesn't support globs unfortunately (see bazelbuild/bazel#7093). `node_modules/` verification was also incorrectly being done on the user `.bazelignore` file, rather than `@rules_prerender`'s `.bazelignore` when loaded as an external workspace. Used a `Label()` constructor to fix that.
This creates a new `pnpm-workspace.yaml` which makes it install `node_modules/` in all the `packages/*` directories. This wasn't necessary before because `rules_prerender` and `@rules_prerender/declarative_shadow_dom` don't have any external dependencies, but it is necessary to install package-specific dependencies. Also updates `tsconfig.json` to work for any `@rules_prerender/*` packages instead of just `@rules_prerender/declarative_shadow_dom`. `.bazelignore` needs to be updated as well, but doesn't support globs unfortunately (see bazelbuild/bazel#7093). `node_modules/` verification was also incorrectly being done on the user `.bazelignore` file, rather than `@rules_prerender`'s `.bazelignore` when loaded as an external workspace. Used a `Label()` constructor to fix that.
This creates a new `pnpm-workspace.yaml` which makes it install `node_modules/` in all the `packages/*` directories. This wasn't necessary before because `rules_prerender` and `@rules_prerender/declarative_shadow_dom` don't have any external dependencies, but it is necessary to install package-specific dependencies. Also updates `tsconfig.json` to work for any `@rules_prerender/*` packages instead of just `@rules_prerender/declarative_shadow_dom`. `.bazelignore` needs to be updated as well, but doesn't support globs unfortunately (see bazelbuild/bazel#7093). `node_modules/` verification was also incorrectly being done on the user `.bazelignore` file, rather than `@rules_prerender`'s `.bazelignore` when loaded as an external workspace. Used a `Label()` constructor to fix that.
This creates a new `pnpm-workspace.yaml` which makes it install `node_modules/` in all the `packages/*` directories. This wasn't necessary before because `rules_prerender` and `@rules_prerender/declarative_shadow_dom` don't have any external dependencies, but it is necessary to install package-specific dependencies. Also updates `tsconfig.json` to work for any `@rules_prerender/*` packages instead of just `@rules_prerender/declarative_shadow_dom`. `.bazelignore` needs to be updated as well, but doesn't support globs unfortunately (see bazelbuild/bazel#7093). `node_modules/` verification was also incorrectly being done on the user `.bazelignore` file, rather than `@rules_prerender`'s `.bazelignore` when loaded as an external workspace. Used a `Label()` constructor to fix that.
My team would really appreciate this feature. We're having issues right now because we're running into "infinite symlink expansion detected" when Bazel traverses into Additionally, we're running into the same sort of issue with the If we do a broad |
+1 to this. Ran into this in the node_modules context, similar to @Toxaris, but probably a little simpler of a failure mode - rxjs is one dep of ours that uses some third party bazel rules, which crash any bazel queries that use I would love if .bazelignore worked more like .gitignore - e.g. support .gitignore syntax and/or support distributed .bazelignore files. (With the latter, we could make a yarn plugin that adds node_modules/.bazelignore whenever we yarn install - but the plugin approach obviously doesn't generalize to other folks' problems) |
any chance of getting this prioritized? seems like this would be an easy thing to fix and a good experience win for users of .bazelignore. |
Hey! Is there any ongoing effort in getting this implemented? |
When working in a project that has parallel CMake support via |
Any updates? |
Hi folks! Sorry I no longer have time to complete this. Please feel free to take a stab if interested. Thanks! |
Description of the feature request:
Currently
.bazelignore
supports only full relative path prefix without any wildcardsI have many
node_modules
subfolders in my repo that I want to ignore.With
.gitignore
I'd just need to put:node_modules
and it will be ignored by git.With
.bazelignore
I need to specify each folder by it's full relative path from workspace root.I suggest to adjust behavior to the way
.gitignore
and save our users the trouble of collecting all folders.What operating system are you running Bazel on?
We tested it on linux with bazel 0.20.0 and 0.21.0
The text was updated successfully, but these errors were encountered: