Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CARGO_USE_GIT_CLI to the Dockerfile to work around an OOM bug dur…
…ing cross-compiling (#4828) ## Issue Addressed #4827 ## Proposed Changes This PR introduces a new build-arg to the Lighthouse Dockerfile: `CARGO_USE_GIT_CLI`. This arg will be passed into the `CARGO_NET_GIT_FETCH_WITH_CLI` [environment variable](https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli), which instructs `cargo` to use the git CLI during `fetch` operations instead of the git library. Doing so works around [a bug](rust-lang/cargo#10583) with the git library that causes it to go OOM during `fetch` operations on `arm64` platforms. The default value is `false` so this doesn't affect Lighthouse builds or the CI pipeline. Running a build with `--build-arg CARGO_USE_GIT_CLI=true` will activate it, which is necessary to cross-compile the `arm64` binary when not using `cross` (i.e., when building via the Dockerfile instead of natively if you don't have a rust environment ready to go). Special thanks to @michaelsproul for helping me repro the initial problem. Co-authored-by: Michael Sproul <micsproul@gmail.com>
- Loading branch information