Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

investigate build size difference #62

Open
jdrouet opened this issue Jul 17, 2024 · 0 comments
Open

investigate build size difference #62

jdrouet opened this issue Jul 17, 2024 · 0 comments
Labels
investigation Something I don't understand, that needs explanation

Comments

@jdrouet
Copy link
Owner

jdrouet commented Jul 17, 2024

The current build system for the linux aarch64 binary is based on using docker and qemu.
It's nice because I can build both the x86_64 binary and the aarch64 binary using the same script, without having to install cross building dependencies, that don't reflect the target machine.
But the side effect of using this is, it's slow. Really slow. Especially on Github Action. It can take up to 17min to build, which is not acceptable.

So my latest quest has been to cross build it, directly on x86_64, in order to do something similar to what's being done for the windows build: just changing the build target.
But the problem is that git-metrics relies on libssl-dev, etc. Which means, on linux, I have to install packages for another architecture. I've been addressing that, in a dockerfile, which will build on the host arch, so I should expect almost no loss of performance.

The build ended up working and I managed to build the binaries for x86_64 and aarch64. But by doing so, the size of those 2 binaries changed although I didn't change the inner code.

The weirdest part being: for x86_64, it's still being built the same way, so it should have the same size.

#61

To reproduce the builds

# with qemu
docker buildx build --platform=linux/amd64,linux/arm64 --target binary --output type=local,dest=./qemu-build .
# cross building
docker build -f cross.Dockerfile --platform=linux/amd64 --target binary --output type=local,dest=./cross-build .

binaries.zip

@jdrouet jdrouet added the investigation Something I don't understand, that needs explanation label Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigation Something I don't understand, that needs explanation
Projects
None yet
Development

No branches or pull requests

1 participant