diff --git a/.gitignore b/.gitignore index 4e91be94c..4326a4ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ __pycache__ /dist .repopickle_* /repoc +/.cipd_bin /.tox /.venv diff --git a/cipd_manifest.txt b/cipd_manifest.txt new file mode 100644 index 000000000..da6dd8e02 --- /dev/null +++ b/cipd_manifest.txt @@ -0,0 +1,32 @@ +# Copyright (C) 2026 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file contains version pins of a few tools used by run_tests. + +# Pin resolved versions in the repo, to reduce trust in the CIPD backend. +# +# Most of these tools are generated via builders at +# https://ci.chromium.org/p/infra/g/infra/console +# +# For these, the git revision is the one of +# https://chromium.googlesource.com/infra/infra.git. +# +# To regenerate them (after modifying this file): +# cipd ensure-file-resolve -ensure-file cipd_manifest.txt +$ResolvedVersions cipd_manifest.versions + +# Supported platforms. Feel free to add more as long as the tools work. +$VerifiedPlatform linux-amd64 linux-arm64 mac-amd64 mac-arm64 + +infra/3pp/tools/help2man/${platform} version:3@1.47.8.chromium.1 diff --git a/cipd_manifest.versions b/cipd_manifest.versions new file mode 100644 index 000000000..135f54048 --- /dev/null +++ b/cipd_manifest.versions @@ -0,0 +1,18 @@ +# This file is auto-generated by 'cipd ensure-file-resolve'. +# Do not modify manually. All changes will be overwritten. + +infra/3pp/tools/help2man/linux-amd64 + version:3@1.47.8.chromium.1 + Ftn7OHsJBffbIuK3KERGGF21oKqMmnV00B6ZKmjxKe4C + +infra/3pp/tools/help2man/linux-arm64 + version:3@1.47.8.chromium.1 + _7lsBiY7fUeLXx1UJc_LEE8H9DG7CGGM9M2gjyqB9T4C + +infra/3pp/tools/help2man/mac-amd64 + version:3@1.47.8.chromium.1 + E7Dldyd8BvjuW2ZuZy3ILNt7KNN2Cs_F_5dkwRfaL8IC + +infra/3pp/tools/help2man/mac-arm64 + version:3@1.47.8.chromium.1 + K5qjjtmIDBnibI_76qoEEgsbwzkQUGrZxbBsaUgOeisC diff --git a/man/repo-manifest.1 b/man/repo-manifest.1 index 35c7d0216..75c9fa9e1 100644 --- a/man/repo-manifest.1 +++ b/man/repo-manifest.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH REPO "1" "May 2026" "repo manifest" "Repo Manual" +.TH REPO "1" "April 2026" "repo manifest" "Repo Manual" .SH NAME repo \- repo manifest - manual page for repo manifest .SH SYNOPSIS @@ -697,7 +697,7 @@ default to which all projects in the included manifest belong. This recurses, meaning it will apply to all projects in all manifests included as a result of this element. .PP -Local Manifests +Local Manifests .PP Additional remotes and projects may be added through local manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. diff --git a/release/update_manpages.py b/release/update_manpages.py index 8bd69b6a7..ecf51bb7a 100644 --- a/release/update_manpages.py +++ b/release/update_manpages.py @@ -66,7 +66,11 @@ def main(argv: List[str]) -> int: parser = get_parser() opts = parser.parse_args(argv) - if not shutil.which("help2man"): + help2man = ["help2man"] + cipd_help2man = TOPDIR / ".cipd_bin/bin/help2man" + if cipd_help2man.exists(): + help2man = ["perl", cipd_help2man] + elif not shutil.which("help2man"): sys.exit("Please install help2man to continue.") # Let repo know we're generating man pages so it can avoid some dynamic @@ -81,7 +85,7 @@ def main(argv: List[str]) -> int: version = RepoSourceVersion() cmdlist = [ [ - "help2man", + *help2man, "-N", "-n", f"repo {cmd} - manual page for repo {cmd}", @@ -100,7 +104,7 @@ def main(argv: List[str]) -> int: ] cmdlist.append( [ - "help2man", + *help2man, "-N", "-n", "repository management tool built on top of git", diff --git a/run_tests b/run_tests index 7491ec5ae..33311f03d 100755 --- a/run_tests +++ b/run_tests @@ -157,11 +157,6 @@ def run_check_metadata(): def run_update_manpages() -> int: """Returns the exit code from release/update-manpages.""" - # Allow this to fail on CI, but not local devs. - if is_ci() and not shutil.which("help2man"): - print("update-manpages: help2man not found; skipping test") - return 0 - argv = ["--check"] log_cmd("release/update-manpages", argv) return subprocess.run( @@ -171,8 +166,24 @@ def run_update_manpages() -> int: ).returncode +def cipd_bootstrap() -> None: + """Install packages via cipd if available.""" + argv = ["ensure", "-root", ".cipd_bin", "-ensure-file", "cipd_manifest.txt"] + log_cmd("cipd", argv) + try: + subprocess.run( + ["cipd"] + argv, + check=True, + cwd=ROOT_DIR, + ) + except FileNotFoundError: + # Skip if the user doesn't have cipd from depot_tools. + return + + def main(argv): """The main entry.""" + cipd_bootstrap() checks = ( functools.partial(run_pytest, argv), functools.partial(run_pytest_py38, argv),