Update Node.js from 16 to 18
Lately, we have started updating our Node.js version from 16 to 18.16 across all used projects in GitLab.
Omnibus packages also are in the scope of that update and we encountered a problem. We package GitLab for LTS and a bit old Linux distributions such as Ubuntu 18.04 or Amazon Linux or CentOS 7.
These Linux distributions have GLIBC version:
-
Amazon Linux 2:
info:
❯ docker run registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/staging/amazonlinux_2_arm64:builder- latest cat /etc/os-release NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/"
GLIBC version:
❯ docker run registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/staging/amazonlinux_2_arm64:builder-latest ldd --version ldd (GNU libc) 2.26
See failed job here https://gitlab.com/gitlab-org/gitlab-omnibus-builder/-/jobs/4323236726
-
Ubuntu 18:04
info:
❯ docker run registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/staging/ubuntu_18.04:builder-latest cat /etc/os-release WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested NAME="Ubuntu" VERSION="18.04.6 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.6 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic
GLIBC version:
❯ docker run registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/staging/ubuntu_18.04:builder-latest ldd --version WARNING: The requested image's platform (linux/amd64) does not match the detected host platform. (linux/arm64/v8) and no specific platform was requested ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27
See failed job here - https://gitlab.com/gitlab-org/gitlab-omnibus-builder/-/jobs/4323225155
- CentOS 7 and Ubuntu 16.04 have the same problem.
Old GLIBC version is our blocker here.
We can try to workaround that by compiling Node.js from sources but we need Python => 3.6 for that which some distributions do not have. And to workaround Python requirement we can use portable Python installation: https://github.com/indygreg/python-build-standalone or https://github.com/codrsquad/portable-python. One major downside from compiling Node.js from sources is increased CI time. On average machine it takes about 1 hour to compile it.