You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 5, 2024. It is now read-only.
chore(integration-tests): change build.rs to pull submodules (#1723)
### Description
Change integration-tests/build.rs to fetch OZ submodule automatically.
### Type of change
- [X] Bug fix (non-breaking change which fixes an issue)
### Rationale
I propose to change
[integration-tests/build.rs](https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/main/integration-tests/build.rs)
to automatically fetch OZ contracts submodule, so that initial
rust-analyzer indexation works without errors. Right now it's necessary
to fetch the submodule manually or by running
[integration-tests/run.sh](https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/main/integration-tests/run.sh).
### How Has This Been Tested?
This feature is hard to test neither with unit-tests nor with
integration-tests, so it was tested locally, on a new & clean repo and
worked without any errors.
### Open question
A completed spawned process returns its `exit-status`/code, so possibly
it's a good tone to check if it's successful (exit code = 0); though the
command is clear and straightforward - that's why I decided not to do
that.
<hr>
### PR code explanation
This PR contains:
- Adding new error kind to `BuildError` enum:
```rust
/// Failed to pull OZ submodule from github
#[error("FailedToPullSubmodule({0:})")]
FailedToPullSubmodule(String),
```
- Process spawn to fetch submodule (the same as in
[integration-tests/run.sh](https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/main/integration-tests/run.sh#L94):
```rust
std::process::Command::new("git")
.args([
"submodule",
"update",
"--init",
"--recursive",
"--checkout",
"contracts/vendor",
])
.spawn()
.and_then(|mut child| child.wait())
.map_err(|err| BuildError::FailedToPullSubmodule(err.to_string()))?;
```
0 commit comments