diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 6f688c9d4..45c9308c7 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -50,10 +50,6 @@ jobs: yum remove -y openssl-devel zlib-devel || true yum install -y protobuf-devel protobuf-compiler tmate - - name: Sync source deps - run: | - python ./sync_deps.py - - name: Python deps run: | pip install "numpy<2" pyyaml "pybind11[global]==2.10.3" nanobind diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index a727778b8..0b9a0c9f2 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -57,10 +57,6 @@ jobs: run: | brew install ccache ninja - - name: Sync source deps - run: | - python ./sync_deps.py - - name: Python deps run: | pip install "numpy<2" pyyaml "pybind11[global]==2.10.3" nanobind diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index 080ff1c51..a6228bf46 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -65,10 +65,6 @@ jobs: with: python-version: '3.11' - - name: Sync source deps - run: | - python ./sync_deps.py - - name: Python deps run: | pip install "numpy<2" pyyaml "pybind11[global]==2.10.3" nanobind diff --git a/.gitmodules b/.gitmodules index 235562936..67a096370 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,3 +18,8 @@ [submodule "third_party/openssl"] path = third_party/openssl url = https://github.com/viaduck/openssl-cmake.git + shallow = true +[submodule "third_party/iree"] + path = third_party/iree + url = https://github.com/iree-org/iree.git + shallow = true diff --git a/build_tools/ci/build_test_cpp.sh b/build_tools/ci/build_test_cpp.sh index 0382601aa..6f7a820aa 100644 --- a/build_tools/ci/build_test_cpp.sh +++ b/build_tools/ci/build_test_cpp.sh @@ -4,7 +4,7 @@ set -eux -o errtrace this_dir="$(cd $(dirname $0) && pwd)" repo_root="$(cd $this_dir/../.. && pwd)" -iree_dir="$(cd $repo_root/../iree && pwd)" +iree_dir="$(cd $repo_root/third_party/iree && pwd)" build_dir="$repo_root/iree-build" install_dir="$repo_root/iree-install" mkdir -p "$build_dir" diff --git a/sync_deps.py b/sync_deps.py deleted file mode 100644 index 149b11533..000000000 --- a/sync_deps.py +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env python -### AUTO-GENERATED: DO NOT EDIT -### Casual developers and CI bots invoke this to do the most -### efficient checkout of dependencies. -### Cross-repo project development should use the -### 'shark-workspace' dev tool for more full featured setup. -### Update with: shark-workspace pin - -PINNED_VERSIONS = { - "iree": "60b65f30c932eaf967922785253a85a1aa14cebb", -} - -ORIGINS = { - "iree": "https://github.com/iree-org/iree.git", -} - -SUBMODULES = {"iree"} - -EXCLUDED_SUBMODULES = {"third_party/torch-mlir"} - - -### Update support: - -import argparse -import re -import shlex -import subprocess -from pathlib import Path - - -def main(): - parser = argparse.ArgumentParser(description="Source deps sync") - parser.add_argument( - "--exclude-submodule", - nargs="*", - help="Exclude submodules by regex (relative to '{project}:{path})", - default=(), - ) - parser.add_argument( - "--exclude-dep", nargs="*", help="Excludes dependencies by regex" - ) - parser.add_argument( - "--depth", type=int, default=0, help="Fetch revisions with --depth" - ) - parser.add_argument( - "--submodules-depth", type=int, default=0, help="Update submodules with --depth" - ) - args = parser.parse_args() - - workspace_dir = Path(__file__).resolve().parent.parent - for repo_name, revision in PINNED_VERSIONS.items(): - # Exclude this dep? - exclude_repo = False - for exclude_pattern in args.exclude_dep or (): - if re.search(exclude_pattern, repo_name): - exclude_repo = True - if exclude_repo: - print(f"Excluding {repo_name} based on --exclude-dep") - continue - - print(f"Syncing {repo_name}") - repo_dir = workspace_dir / repo_name - if not repo_dir.exists(): - # Shallow clone - print(f" Cloning {repo_name}...") - repo_dir.mkdir() - run(["init"], repo_dir) - run(["remote", "add", "origin", ORIGINS[repo_name]], repo_dir) - # Checkout detached head. - fetch_args = ["fetch"] - if args.depth > 0: - fetch_args.extend(["--depth=1"]) - fetch_args.extend(["origin", revision]) - run(fetch_args, repo_dir) - run(["-c", "advice.detachedHead=false", "checkout", revision], repo_dir) - if repo_name in SUBMODULES: - print(f" Initializing submodules for {repo_name}") - cp = run( - ["submodule", "status"], repo_dir, silent=True, capture_output=True - ) - submodules = [] - for submodule_status_line in cp.stdout.decode().splitlines(): - submodule_status_parts = submodule_status_line.split() - submodule_path = submodule_status_parts[1] - exclude_submodule = False - for exclude_pattern in args.exclude_submodule + tuple( - EXCLUDED_SUBMODULES - ): - if re.search(exclude_pattern, f"{repo_name}:{submodule_path}"): - exclude_submodule = True - if exclude_submodule: - print(f" Excluding {submodule_path} based on --exclude-submodule") - continue - submodules.append(submodule_path) - - update_args = ["submodule", "update", "--init"] - if args.submodules_depth > 0: - update_args.extend(["--depth", "1"]) - update_args.extend(["--"]) - update_args.extend(submodules) - print(update_args) - run(update_args, repo_dir) - - -def run( - args, cwd, *, capture_output: bool = False, check: bool = True, silent: bool = False -): - args = ["git"] + args - args_text = " ".join([shlex.quote(arg) for arg in args]) - if not silent: - print(f" [{cwd}]$ {args_text}") - cp = subprocess.run(args, cwd=str(cwd), capture_output=capture_output) - if check and cp.returncode != 0: - addl_info = f":\n({cp.stderr.decode()})" if capture_output else "" - raise RuntimeError( - f"Git command failed: {args_text} (from {cwd})" f"{addl_info}" - ) - return cp - - -if __name__ == "__main__": - main() diff --git a/third_party/iree b/third_party/iree new file mode 160000 index 000000000..60b65f30c --- /dev/null +++ b/third_party/iree @@ -0,0 +1 @@ +Subproject commit 60b65f30c932eaf967922785253a85a1aa14cebb