diff --git a/.github/workflows/multi_arch_build_native_windows_packages.yml b/.github/workflows/multi_arch_build_native_windows_packages.yml index e97cdda683c..9583a0d8934 100644 --- a/.github/workflows/multi_arch_build_native_windows_packages.yml +++ b/.github/workflows/multi_arch_build_native_windows_packages.yml @@ -104,6 +104,8 @@ jobs: ROCM_VERSION: ${{ inputs.rocm_version }} MSI_VERSION: ${{ inputs.msi_version }} PACKAGES: ${{ inputs.packages }} + ARTIFACTS_OUTPUT_DIR: ${{ github.workspace }}/artifacts + ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/artifacts MSI_DIR: ${{ github.workspace }}/msi-output RELEASE_TYPE: ${{ inputs.release_type }} steps: @@ -128,11 +130,22 @@ jobs: - name: Install WiX Toolset v4 run: dotnet tool install --global wix --version "4.*" - # The generator installs two driver-supplied System32 DLLs (amdhip64_6.dll, + - name: Fetch Windows artifacts + run: | + python build_tools/artifact_manager.py fetch \ + --run-id="${ARTIFACT_RUN_ID}" \ + --run-github-repo="${ARTIFACT_GITHUB_REPO}" \ + --platform=windows \ + --stage=all \ + --generic-only \ + --exclude-components=dbg,dev,doc,run,test \ + --output-dir="${ARTIFACTS_OUTPUT_DIR}" + + # The generator requires two driver-supplied System32 DLLs (amdhip64_6.dll, # amd_comgr_2.dll) that are DVC-tracked under - # rocm-systems/shared/amdgpu-windows-interop/legacy/ rather than committed - # to git, and fails if they are missing. Initialize the rocm-systems - # submodule at this checkout's pinned commit and materialize its DVC files. + # rocm-systems/shared/amdgpu-windows-interop/legacy/. Initialize the + # rocm-systems submodule at this checkout's pinned commit and materialize + # its DVC files. - name: Fetch rocm-systems DVC files timeout-minutes: 10 run: | @@ -147,8 +160,7 @@ jobs: # knowledge of the package-to-filename mapping. python build_tools/packaging/windows/generate_msi_wxs.py \ --packages "${PACKAGES}" \ - --run-id "${ARTIFACT_RUN_ID}" \ - --run-github-repo "${ARTIFACT_GITHUB_REPO}" \ + --artifact-dir "${ARTIFACTS_DIR}" \ --package-version "${MSI_VERSION}" \ --display-version "${ROCM_VERSION}" \ --output-dir "${MSI_DIR}" diff --git a/.github/workflows/multi_arch_ci_windows.yml b/.github/workflows/multi_arch_ci_windows.yml index 89adcc6e66d..b581a7ce8f9 100644 --- a/.github/workflows/multi_arch_ci_windows.yml +++ b/.github/workflows/multi_arch_ci_windows.yml @@ -193,6 +193,7 @@ jobs: uses: ./.github/workflows/multi_arch_build_native_windows_packages.yml with: artifact_run_id: ${{ github.run_id }} + artifact_github_repo: ${{ github.repository }} rocm_version: ${{ inputs.rocm_package_version }} msi_version: ${{ inputs.rocm_msi_package_version }} # Only the runtime package is published in CI artifacts today; core's diff --git a/build_tools/github_actions/detect_external_repo_config.py b/build_tools/github_actions/detect_external_repo_config.py index aac598a8cd8..74ed08edfe3 100644 --- a/build_tools/github_actions/detect_external_repo_config.py +++ b/build_tools/github_actions/detect_external_repo_config.py @@ -56,7 +56,10 @@ "cmake_source_var": "THEROCK_ROCM_SYSTEMS_SOURCE_DIR", "submodule_path": "rocm-systems", "skip_submodules": ["rocm-systems"], - "dvc_projects": ["external-rocm-systems"], + # --dvc-projects replaces fetch_sources.py's default project list rather + # than extending it, so "rocm-libraries" is listed explicitly to pull the + # rocSPARSE/hipSPARSE test matrices ClientMatrices.cmake needs. + "dvc_projects": ["external-rocm-systems", "rocm-libraries"], }, "rocgdb": { "cmake_source_var": "THEROCK_ROCGDB_SOURCE_DIR", diff --git a/build_tools/github_actions/tests/dvc_external_repo_test.py b/build_tools/github_actions/tests/dvc_external_repo_test.py index 9a9f3ae8d6e..3373d24a49f 100644 --- a/build_tools/github_actions/tests/dvc_external_repo_test.py +++ b/build_tools/github_actions/tests/dvc_external_repo_test.py @@ -36,11 +36,13 @@ def test_rocm_systems_has_dvc_projects(self): "rocm-systems config must have dvc_projects for wsl-rocdxg builds", ) - # Verify it contains external-rocm-systems + # "rocm-libraries" is required for the rocSPARSE/hipSPARSE test matrices: + # --dvc-projects replaces fetch_sources.py's default list rather than + # extending it, so dropping it breaks the math-libs stage. self.assertEqual( config["dvc_projects"], - ["external-rocm-systems"], - "dvc_projects should contain external-rocm-systems path", + ["external-rocm-systems", "rocm-libraries"], + "dvc_projects should contain external-rocm-systems and rocm-libraries", ) def test_rocm_systems_has_all_required_keys(self): diff --git a/build_tools/packaging/windows/generate_msi_wxs.py b/build_tools/packaging/windows/generate_msi_wxs.py index 1c5ee82a258..713c2fed3eb 100644 --- a/build_tools/packaging/windows/generate_msi_wxs.py +++ b/build_tools/packaging/windows/generate_msi_wxs.py @@ -432,6 +432,19 @@ def parse_args() -> argparse.Namespace: action="store_true", help="List available package names and exit.", ) + parser.add_argument( + "--artifact-dir", + type=Path, + default=None, + metavar="PATH", + help=( + "Path to a directory of already-extracted artifacts. When set, " + "the generator uses these artifacts directly and skips any fetch " + "(--run-id and --build-root are ignored). Use this when the " + "workflow fetches artifacts in a dedicated step before calling " + "the generator." + ), + ) parser.add_argument( "--run-id", default=None, @@ -753,10 +766,15 @@ class WixDocument: def resolve_artifact_dir(args: argparse.Namespace) -> Path: """Return the directory of extracted artifacts for the selected source. - Fetches from the CI run when --run-id is set (once; the fetch is not - package-specific), otherwise points at the local build tree. Callers that - build several packages should resolve this once and reuse it. + Resolution order: + 1. --artifact-dir: caller already fetched; use as-is (no network I/O). + 2. --run-id: fetch from S3 via artifact_manager.py. + 3. --build-root: local CMake build tree. + + Callers that build several packages should resolve this once and reuse it. """ + if getattr(args, "artifact_dir", None) is not None: + return args.artifact_dir if args.run_id: return fetch_artifacts( run_id=args.run_id,