Skip to content

Commit

Permalink
[#68657] Add git URL rewrite for moved repos
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Torhan <[email protected]>
  • Loading branch information
m-torhan committed Nov 13, 2024
1 parent 56746ac commit bf833d5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ image: $CI_IMAGE

variables:
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: none
GIT_SUBMODULE_UPDATE_FLAGS: --jobs `nproc`
IREE_HOST_BIN_DIR: "/opt/iree_compiler/bin"
RISCV_TOOLCHAIN_ROOT: "/opt/toolchain_iree_rv32imf"
RENODE_PATH: "/opt/renode"
Expand All @@ -19,16 +21,13 @@ stages:
- build
- tests

.submodule_update_recursive: &submodule_update_recursive
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
GIT_SUBMODULE_UPDATE_FLAGS: --jobs `nproc`
.prepare_submodules_recursive: &prepare_submodules_recursive |-
build_tools/configure_git_url_rewrite.sh
git submodule update --init --recursive

.submodule_update_normal: &submodule_update_normal
GIT_SUBMODULE_STRATEGY: normal

.submodule_update_none: &submodule_update_none
GIT_SUBMODULE_STRATEGY: none
.prepare_submodules_normal: &prepare_submodules_normal |-
build_tools/configure_git_url_rewrite.sh
git submodule update --init

.build_prepare: &build_prepare |-
build_tools/configure_cmake.sh -G Ninja
Expand All @@ -43,7 +42,6 @@ clang_format:
<<: *ace
<<: *common_only
stage: lint
variables: *submodule_update_none
before_script:
- *minimal_build_prepare
script:
Expand All @@ -53,8 +51,8 @@ clang_tidy:
<<: *ace
<<: *common_only
stage: lint
variables: *submodule_update_normal
before_script:
- *prepare_submodules_normal
- *minimal_build_prepare
script:
- git -C third-party/iree-rv32-springbok submodule update --init
Expand All @@ -64,8 +62,8 @@ build:
<<: *ace
<<: *common_only
stage: build
variables: *submodule_update_recursive
before_script:
- *prepare_submodules_recursive
- *build_prepare
script:
- cmake --build build/build-riscv
Expand All @@ -78,8 +76,8 @@ i2c_accelerometer_build:
<<: *ace
<<: *common_only
stage: build
variables: *submodule_update_recursive
before_script:
- *prepare_submodules_recursive
- *i2c_accelerometer_build_prepare
script:
- cmake --build build/build-riscv
Expand All @@ -92,7 +90,6 @@ unit_tests:
<<: *ace
<<: *common_only
stage: tests
variables: *submodule_update_none
before_script:
- *minimal_build_prepare
script:
Expand All @@ -106,8 +103,8 @@ renode_tests:
<<: *ace
<<: *common_only
stage: tests
variables: *submodule_update_normal
before_script:
- *prepare_submodules_normal
- *minimal_build_prepare
- git -C third-party/kenning lfs pull
- python3 -m pip install ./third-party/kenning
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ python3 -m pip install iree-compiler~=20230209.425 iree-runtime~=20230209.425 ir
### Building the runtime

> **NOTE:** Some of the repositories used as submodules were moved.
> As the used IREE version have old URLs, it is required to add URL rewrites to git.
> This can be done with prepared bash script:
> ```bash
> ./build_tools/configure_git_url_rewrite.sh
> ```
Before building the binary, download a pre-compiled RV32 LLVM toolchain and IREE compiler.
To download it, scripts included in `iree-rv32-springbok` submodule located in `third-party/iree-rv32-springbok/build_tools` directory can be used.
To do so, run the following commands in the project's root directory:
Expand Down
6 changes: 6 additions & 0 deletions build_tools/configure_git_url_rewrite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Those rewrites are required as some repos were moved

git config --global url."https://github.com/tensorflow/mlir-hlo".insteadOf "https://github.com/iree-org/iree-mhlo-fork.git"
git config --global url."https://github.com/iree-org/llvm-project.git".insteadOf "https://github.com/iree-org/iree-llvm-fork.git"

0 comments on commit bf833d5

Please sign in to comment.