File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -535,26 +535,28 @@ def _whl_library_impl(rctx):
535535 rctx .file ("MODULE.bazel" )
536536 rctx .file ("REPO.bazel" )
537537
538+ # BUILD files interfere with globbing and Bazel package boundaries.
539+ _remove_files (rctx , "BUILD" , "BUILD.bazel" )
540+ rctx .file ("BUILD.bazel" , build_file_contents )
541+
542+ if enable_pipstar and enable_pipstar_extract :
543+ if hasattr (rctx , "repo_metadata" ):
544+ return rctx .repo_metadata (reproducible = True )
545+
546+ return None
547+
548+ def _remove_files (rctx , * basenames ):
538549 paths = list (rctx .path ("." ).readdir ())
539550 for _ in range (10000000 ):
540551 if not paths :
541552 break
542553 path = paths .pop ()
543554
544- # BUILD files interfere with globbing and Bazel package boundaries.
545- if path .basename in ("BUILD" , "BUILD.bazel" ):
555+ if path .basename in basenames :
546556 rctx .delete (path )
547557 elif path .is_dir :
548558 paths .extend (path .readdir ())
549559
550- rctx .file ("BUILD.bazel" , build_file_contents )
551-
552- if enable_pipstar and enable_pipstar_extract :
553- if hasattr (rctx , "repo_metadata" ):
554- return rctx .repo_metadata (reproducible = True )
555-
556- return None
557-
558560def _generate_entry_point_contents (
559561 module ,
560562 attribute ,
You can’t perform that action at this time.
0 commit comments