diff --git a/site_scons/mongo/pip_requirements.py b/site_scons/mongo/pip_requirements.py index 2d0b77f82f327..51a031c4bb680 100644 --- a/site_scons/mongo/pip_requirements.py +++ b/site_scons/mongo/pip_requirements.py @@ -62,11 +62,15 @@ def raiseSuggestion(ex, pip_pkg): f" buildscripts/poetry_sync.sh -p '{executable}'\n" ) + # Remove ANSI escape codes from the output + ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') + clean_output = ansi_escape.sub('', poetry_dry_run_proc.stdout) + # String match should look like the following # Package operations: 2 installs, 3 updates, 0 removals, 165 skipped match = re.search( r"Package operations: (\d+) \w+, (\d+) \w+, (\d+) \w+, (\d+) \w+", - poetry_dry_run_proc.stdout, + clean_output, ) verbose("Requirements list:") verbose(poetry_dry_run_proc.stdout) diff --git a/site_scons/site_tools/integrate_bazel.py b/site_scons/site_tools/integrate_bazel.py index 6fe033f4cfb1d..031c7a4874b5b 100644 --- a/site_scons/site_tools/integrate_bazel.py +++ b/site_scons/site_tools/integrate_bazel.py @@ -494,6 +494,7 @@ def bazel_build_thread_func(env, log_dir: str, verbose: bool, ninja_generate: bo if ninja_generate: for file in glob.glob("bazel-out/**/*.gen_source_list", recursive=True): + os.chmod(file, stat.S_IWRITE) os.remove(file) extra_args += ["--build_tag_filters=scons_link_lists"] bazel_cmd = Globals.bazel_base_build_command + extra_args + ["//src/..."]