koalaman / shellcheck

ShellCheck, a static analysis tool for shell scripts
https://www.shellcheck.net
GNU General Public License v3.0
36.45k stars 1.78k forks source link

Fix builders for Linux #2942

Closed jansorg closed 7 months ago

jansorg commented 8 months ago

This reduces the size of the Linux x86_64 binary from 15 megabytes to 5.8 megabytes and fixes the build for Linux aarch64.

Building with alpine:latest creates a binary of 29 megabytes, but when building with alpine:3.16 it's just 5.8 megabytes. I'm not sure, though, what piece of GHC, GCC/LLVM, etc. is causing the increased size. The published build of ShellCheck 0.10.0 is 15 megabytes, instead of the expected 29 megabyes using the builder of this repo. Perhaps the container was still cached and based on an older version of alpine?

Attempting to build for Linux aarch64 failed with this message. Ubuntu Kinetic is not provided with updates anmore. I'm not sure why the Linux binary for aarch64 is so much larger than for x86_64 (31 megabytes), but it's probably nothing I can fix. The Linux aarch64 binary of ShellCheck 0.9.0 is about 20.5 megabytes.

Step 8/19 : RUN apt-get update && apt-get install -y ghc alex happy automake autoconf build-essential curl qemu-user-static
 ---> Running in 435bd345ec51
Ign:1 http://archive.ubuntu.com/ubuntu kinetic InRelease
Ign:2 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease
Ign:3 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Err:4 http://archive.ubuntu.com/ubuntu kinetic Release
  404  Not Found [IP: 185.125.190.36 80]
Err:5 http://archive.ubuntu.com/ubuntu kinetic-updates Release
  404  Not Found [IP: 185.125.190.36 80]
Err:6 http://archive.ubuntu.com/ubuntu kinetic-backports Release
  404  Not Found [IP: 185.125.190.36 80]
Ign:7 http://security.ubuntu.com/ubuntu kinetic-security InRelease
Err:8 http://security.ubuntu.com/ubuntu kinetic-security Release
  404  Not Found [IP: 91.189.91.83 80]
Reading package lists...
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-updates Release' does not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu kinetic-backports Release' does not have a Release file.
E: The repository 'http://security.ubuntu.com/ubuntu kinetic-security Release' does not have a Release file.
koalaman commented 7 months ago

Very nice, thanks!

Non-x86 archs being significantly bigger is also my experience, but I've never investigated why. The builder images being out of date is a really good point, they're built and pushed occasionally and should at least be updated before releases. I'm adding it to the release checklist for next time.