File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -471,8 +471,26 @@ def _whl_library_impl(rctx):
471471 ],
472472 )
473473
474- rctx .file ("BUILD.bazel" , build_file_contents )
474+ # Delete these in case the wheel had them. They generally don't cause
475+ # a problem, but let's avoid the chance of that happening.
476+ rctx .file ("WORKSPACE" )
477+ rctx .file ("WORKSPACE.bazel" )
478+ rctx .file ("MODULE.bazel" )
479+ rctx .file ("REPO.bazel" )
480+
481+ paths = [rctx .path ("." ).readdir ()]
482+ for _ in range (10000000 ):
483+ if not paths :
484+ break
485+ path = paths .pop ()
486+
487+ # BUILD files interfere with globbing and Bazel package boundaries.
488+ if path .basename in ("BUILD" , "BUILD.bazel" ):
489+ rctx .delete (path )
490+ elif path .is_dir :
491+ paths .extend (path .readdir ())
475492
493+ rctx .file ("BUILD.bazel" , build_file_contents )
476494 return
477495
478496def _generate_entry_point_contents (
You can’t perform that action at this time.
0 commit comments