CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
68 lines
1.9 KiB
Python
68 lines
1.9 KiB
Python
#!/usr/bin/env python3
|
|
# Copyright Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""Generate or verify artifact_subprojects.json manifest."""
|
|
|
|
import argparse
|
|
import json
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
REPO_ROOT = Path(__file__).parent.parent
|
|
MANIFEST_PATH = Path(__file__).parent / "artifact_subprojects.json"
|
|
|
|
CMAKE_ARGS = [
|
|
"-GNinja",
|
|
"-DTHEROCK_AMDGPU_FAMILIES=gfx1100", # Required by cmake, but doesn't affect manifest
|
|
"-DTHEROCK_ENABLE_ALL=ON",
|
|
"-DTHEROCK_BUNDLE_SYSDEPS=OFF",
|
|
"-DTHEROCK_ENABLE_LIBHIPCXX=OFF",
|
|
]
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--verify", action="store_true")
|
|
args = parser.parse_args()
|
|
|
|
with tempfile.TemporaryDirectory(prefix="therock-manifest-") as tmp_dir:
|
|
print(f"Running cmake configure in {tmp_dir}...")
|
|
result = subprocess.run(
|
|
["cmake", "-B", tmp_dir, "-S", str(REPO_ROOT)] + CMAKE_ARGS,
|
|
capture_output=True,
|
|
text=True,
|
|
)
|
|
if result.returncode != 0:
|
|
print(f"CMake failed: {result.stderr}", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
generated = Path(tmp_dir) / "artifact_subprojects.json"
|
|
if not generated.exists():
|
|
print("Manifest not generated", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
with generated.open() as f:
|
|
new_manifest = json.load(f)
|
|
|
|
if args.verify:
|
|
with MANIFEST_PATH.open() as f:
|
|
old_manifest = json.load(f)
|
|
if new_manifest == old_manifest:
|
|
print("Manifest is up-to-date.")
|
|
else:
|
|
print(
|
|
"Manifest is stale. Run: python build_tools/generate_subproject_manifest.py"
|
|
)
|
|
sys.exit(1)
|
|
else:
|
|
shutil.copy(generated, MANIFEST_PATH)
|
|
print(f"Updated {MANIFEST_PATH}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|