Skip to content

Commit fdd95e2

Browse files
stefano-garzarellaandreeaflorescu
authored andcommitted
build_container: use git cli to avoid OOM on arm64
libgit2 can consume a lot of memory when cross-compiling for arm64. As suggested here [1], let's use the git executable to prevent this issue. [1] rust-lang/cargo#10583 (comment) Fixes: #79 Signed-off-by: Stefano Garzarella <[email protected]>
1 parent b6a207b commit fdd95e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build_container.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ pip3 install --no-cache-dir pytest pexpect boto3 pytest-timeout && apt purge -y
2121
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
2222

2323
# Install cargo tools.
24-
cargo install cargo-kcov critcmp cargo-audit cargo-fuzz && rm -rf /root/.cargo/registry/
24+
# Use `git` executable to avoid OOM on arm64:
25+
# https://github.com/rust-lang/cargo/issues/10583#issuecomment-1129997984
26+
cargo --config "net.git-fetch-with-cli = true" \
27+
install cargo-kcov critcmp cargo-audit cargo-fuzz
28+
rm -rf /root/.cargo/registry/
2529

2630
# Install nightly (needed for fuzzing)
2731
rustup install --profile=minimal nightly

0 commit comments

Comments
 (0)