Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Feb 26, 2025
1 parent f8e37e1 commit a9c07b3
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions build_tools/fetch_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
DEFAULT_SOURCES_DIR = THEROCK_DIR / "sources"
PATCHES_DIR = THEROCK_DIR / "patches"


def is_windows() -> bool:
return platform.system() == "Windows"


def setup_repo_tool() -> Path:
"""Sets up https://gerrit.googlesource.com/git-repo/, downloading as needed."""

Expand Down Expand Up @@ -119,24 +121,27 @@ def populate_ancillary_sources(args):
needed to build. There is often something in CMake that attempts to automate it,
but it is also often broken. So we just do the right thing here as a transitionary
step to fixing the underlying software packages."""
populate_submodules_if_exists(args.dir / "rocprofiler-register")
populate_submodules_if_exists(args.dir / "rocprofiler-sdk")
populate_submodules_if_exists(args, args.dir / "rocprofiler-register")
populate_submodules_if_exists(args, args.dir / "rocprofiler-sdk")

# TODO(#36): Enable once rocprofiler-systems can be checked out on Windows
# error: invalid path 'src/counter_analysis_toolkit/scripts/sample_data/L2_RQSTS:ALL_DEMAND_REFERENCES.data.reads.stat'
# Upstream issues:
# https://github.com/ROCm/rocprofiler-systems/issues/105
# https://github.com/icl-utk-edu/papi/issues/321
if not is_windows():
populate_submodules_if_exists(args.dir / "rocprofiler-systems")
populate_submodules_if_exists(args, args.dir / "rocprofiler-systems")


def populate_submodules_if_exists(git_dir: Path):
def populate_submodules_if_exists(args, git_dir: Path):
if not git_dir.exists():
print(f"Not populating submodules for {git_dir} (does not exist)")
return
print(f"Populating submodules for {git_dir}:")
exec(["git", "submodule", "update", "--init"], cwd=git_dir)
depth_args = []
if args.depth is not None:
depth_args = ["--depth", str(args.depth)]
exec(["git", "submodule", "update", "--init"] + depth_args, cwd=git_dir)


def main(argv):
Expand Down Expand Up @@ -199,9 +204,11 @@ def main(argv):
"rocm-core",
"rocminfo",
"rocprofiler-register",
"rocprofiler-compute",
# TODO: Re-enable when used.
# "rocprofiler-compute",
"rocprofiler-sdk",
"rocprofiler-systems",
# TODO: Re-enable when used.
# "rocprofiler-systems",
"ROCR-Runtime",
],
)
Expand Down

0 comments on commit a9c07b3

Please sign in to comment.