Skip to content

Commit 4f50dcb

Browse files
OSS-Fuzz Teamcopybara-github
authored andcommitted
index_build: Clear existing /indexes if it exists.
To enable re-indexing on a container that already had indexing done previously. Otherwise we might run into issues (e.g. indexer complaining files already exist). PiperOrigin-RevId: 780042087
1 parent 0714250 commit 4f50dcb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

infra/base-images/base-builder/indexer/index_build.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ def clear_out():
553553

554554
def main():
555555
logging.basicConfig(level=logging.INFO)
556-
INDEXES_PATH.mkdir(exist_ok=True)
557556

558557
parser = argparse.ArgumentParser(description='Index builder.')
559558
parser.add_argument(
@@ -617,6 +616,11 @@ def main():
617616
)
618617
args = parser.parse_args()
619618

619+
# Clear existing indexer artifacts.
620+
if INDEXES_PATH.exists():
621+
shutil.rmtree(INDEXES_PATH)
622+
INDEXES_PATH.mkdir()
623+
620624
# Clean up the existing OUT by default, otherwise we may run into various
621625
# build errors.
622626
if not args.no_clear_out:

0 commit comments

Comments
 (0)