Skip to content

investigate build size difference #62

@jdrouet

Description

@jdrouet

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigationSomething I don't understand, that needs explanation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions