Skip to content

Linux build update#1460

Merged
Steven Gagniere (sgagniere) merged 26 commits intomainfrom
linux-build-update
Dec 10, 2022
Merged

Linux build update#1460
Steven Gagniere (sgagniere) merged 26 commits intomainfrom
linux-build-update

Conversation

@sgagniere
Copy link
Member

Checklist

  1. [CRUCIAL] Is the change for CP or CCloud functionalities that are already live in prod?
    • yes: ok

What

Changed the base image for building the Linux glibc arm64 binary/archive on amd64 laptops. The current version builds inside of an arm64 CentOS 7 image using emulation, which is very slow. The new version builds inside of an amd64 Ubuntu Bionic image using a arm64 cross compiler, reducing build time to around 70 to 80 seconds, down from 12+ minutes.

A few notes:

  • Currently, the amd64 binary is built with glibc 2.17 and the arm64 binary is built with glibc 2.28.
  • glibc is backwards compatible but not forwards compatible: binaries compiled on older versions will run on machines with newer versions.
    • The new image (cross-)builds the arm64 version with glibc 2.27. This is fine; it's an expansion of supported systems.
    • This is also why the amd64 version is still built with the CentOS image in this PR: the binary would not be expected to work for users whose machines have glibc 2.17 through 2.26.
  • The consequence of removing emulation on amd64 laptops is doubling emulation on arm64 laptops.
    • Some if-else statements in build_linux_glibc.sh and release.mk have been added to instead use an arm64-based image to build the arm64 binary/archive, so that M1 laptops only have to emulate to build the amd64 binary/archive.

The image changes are:
amd64 laptops:

  • cli-centos-base-amd64 to cli-centos-base-amd64:2.0 (2.0 removesgolicense, which we aren't using anymore and wasn't used in this build anyway)
  • cli-centos-base-arm64 to cli-ubuntu-base-arm64:latest
    arm64 laptops:
  • cli-centos-base-arm64 to cli-ubuntu-base-arm64:m1 (if/when docker manifest makes it out of experimental, we can revisit this and roll both images into the same tag to simplify this)

Also did a bit of cleanup: removed windows override in the glibc goreleaser files and removed the S3FOLDER variable from the gorelease-linux-glibc targets since both are unused in the build.

References

N/A

Test & Review

Checked that the binaries built in the new images run in the current images (glibc compatibility check) and that the produce/consume commands work

@sgagniere Steven Gagniere (sgagniere) requested a review from a team as a code owner October 11, 2022 00:50
@sgagniere Steven Gagniere (sgagniere) deleted the linux-build-update branch December 10, 2022 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants