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
This is a fun one. While I know cross is supposed to be used for cross-compiling (which invokes its own Docker process), I am trying to build the arm64 image directly via buildx. If you attempt to cross-compile Lighthouse on an x64 box via the following:
The problem ends up being a possible bug in libgit2 itself, which cargo uses as part of updating the submodules. This is well-documented by the Rust community already and there's a simple workaround for it which they describe in that issue: tell cargo to use the git CLI for pulling submodules instead of the git library itself.
I have a PR coming that will resolve it with a simple (optional) build-arg in the Dockerfile to remedy this, though one could probably argue that making this the default behavior would fix the issue and wouldn't adversely affect the standard Lighthouse build process.
Version
v4.5.0 and likely many versions prior; the bug was first reported in 2022.
Present Behaviour
Building the image results in an out-of-memory error and the build process gets killed.
Expected Behaviour
Building the image should complete successfully.
Steps to resolve
PR pending, it'll reference this issue once it's in.
The text was updated successfully, but these errors were encountered:
…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 <[email protected]>
Description
This is a fun one. While I know
cross
is supposed to be used for cross-compiling (which invokes its own Docker process), I am trying to build thearm64
image directly viabuildx
. If you attempt to cross-compile Lighthouse on an x64 box via the following:It will get stuck pulling the submodules for a few minutes while QEMU eats all of the system's RAM:
The problem ends up being a possible bug in
libgit2
itself, whichcargo
uses as part of updating the submodules. This is well-documented by the Rust community already and there's a simple workaround for it which they describe in that issue: tellcargo
to use the git CLI for pulling submodules instead of the git library itself.I have a PR coming that will resolve it with a simple (optional) build-arg in the Dockerfile to remedy this, though one could probably argue that making this the default behavior would fix the issue and wouldn't adversely affect the standard Lighthouse build process.
Version
v4.5.0
and likely many versions prior; the bug was first reported in 2022.Present Behaviour
Building the image results in an out-of-memory error and the build process gets killed.
Expected Behaviour
Building the image should complete successfully.
Steps to resolve
PR pending, it'll reference this issue once it's in.
The text was updated successfully, but these errors were encountered: