mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Switch libpfm and boost.unordered to BCR versions (#6847)
Assisted-by: Google Antigravity with Gemini
This commit is contained in:
@@ -33,48 +33,6 @@ def _query_bazel_deps(module_text: str) -> None:
|
||||
print(f" - {pkg}: Error {e}")
|
||||
|
||||
|
||||
def _query_archive_overrides(module_text: str) -> None:
|
||||
"""Query Git for `archive_override` rule versions."""
|
||||
archive_re = re.compile(
|
||||
r"archive_override\(\s*"
|
||||
r'module_name\s*=\s*"([^"]+)".*?'
|
||||
r'urls\s*=\s*\["[^"]*?github\.com/([^/]+/[^/]+?)/archive',
|
||||
re.DOTALL,
|
||||
)
|
||||
github_tags = sorted(
|
||||
[
|
||||
(m[1], f"https://github.com/{m[2]}.git")
|
||||
for m in archive_re.finditer(module_text)
|
||||
]
|
||||
)
|
||||
|
||||
print("- GitHub Tag:")
|
||||
for pkg, url in github_tags:
|
||||
try:
|
||||
output = subprocess.check_output(
|
||||
["git", "ls-remote", "--tags", url], text=True
|
||||
)
|
||||
# Find the latest tag by sorting them (excluding the ^{}
|
||||
# dereferenced tags).
|
||||
tags = [
|
||||
line.split("/")[-1]
|
||||
for line in output.splitlines()
|
||||
if not line.endswith("^{}")
|
||||
]
|
||||
|
||||
# Simple version sort (git-style) using split by common delimiters.
|
||||
tags.sort(
|
||||
key=lambda tag: [
|
||||
int(x) if x.isdigit() else x
|
||||
for x in re.split(r"(\d+)", tag)
|
||||
]
|
||||
)
|
||||
latest_tag = tags[-1] if tags else "Unknown"
|
||||
print(f" - {pkg}: {latest_tag}")
|
||||
except Exception as e:
|
||||
print(f" - {pkg}: Error {e}")
|
||||
|
||||
|
||||
def _query_git_overrides(module_text: str) -> None:
|
||||
"""Query GitHub for `git_override` rule versions."""
|
||||
git_re = re.compile(
|
||||
@@ -101,7 +59,6 @@ def main() -> None:
|
||||
module_text = f.read()
|
||||
|
||||
_query_bazel_deps(module_text)
|
||||
_query_archive_overrides(module_text)
|
||||
_query_git_overrides(module_text)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user