From 464ae610e29af1a340fe46a0592788a2b37b74f4 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Tue, 7 Jan 2025 17:41:53 +0100 Subject: [PATCH] Fix removing MODULE.bazel file (#2154) Addressing https://github.com/bazelbuild/bazel-central-registry/pull/3538#issuecomment-2575643477 --- buildkite/bazel-central-registry/bcr_presubmit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildkite/bazel-central-registry/bcr_presubmit.py b/buildkite/bazel-central-registry/bcr_presubmit.py index 6119f801c0..21040d66c0 100755 --- a/buildkite/bazel-central-registry/bcr_presubmit.py +++ b/buildkite/bazel-central-registry/bcr_presubmit.py @@ -28,6 +28,7 @@ import sys import subprocess import shutil +import stat import time import urllib.request import zipfile @@ -251,6 +252,7 @@ def prepare_test_module_repo(module_name, module_version, overwrite_bazel_versio module_dot_bazel = source_root.joinpath("MODULE.bazel") # In case the existing MODULE.bazel has no write permission. if module_dot_bazel.exists(): + os.chmod(module_dot_bazel, stat.S_IWRITE) os.remove(module_dot_bazel) shutil.copy(checked_in_module_dot_bazel, module_dot_bazel)