.bazelignore
of root repository should work on subdirectories added with new_local_repository
, but it doesn't.
Note that we have local_repo
and a folder should_be_excluded
inside.
It is excluded in the parent .bazelignore
.
But, when you query targets from @local_repo
, dirs should_be_excluded
is NOT excluded:
$ bazel query @local_repo//...
@local_repo//should_be_excluded:run
@local_repo//:run
In cases when local_repo
is not writeable, it is not possible to exclude dirs/targets from local_repo
.
- Add
bazelignore
argument tonew_local_repository
, similar tobuild_file
orbuild_file_content
. - Same as (1), but more generic: add
file_mapping
argument, which will copy/symlink files from root repository into new repository:
new_local_repository(
name = 'local_repo',
path = 'local_repo',
build_file = 'BUILD.local',
file_mapping = {
'.bazelignore.local': '.bazelignore'
}
)