From 731e0f5b076ef53aa0d7dbc0da17d1d145966353 Mon Sep 17 00:00:00 2001 From: John Naulty Date: Sat, 28 Nov 2020 17:51:47 -0800 Subject: [PATCH] [stack-base] update npm to build gitea Use `debian-backports` to update npm from `5.8.0+ds6-4+deb10u2` to `6.14.8+ds-1~bpo10+1`. Why: To help fix an issue encountered when building the `images/gitea.tar` artifact, which was failing to build because of an npm install error. See https://github.com/hashbang/stack/issues/4 for more information. What/How: Add backported packages from the debian-backports repository to build with a newer version of npm. Resolved issue by following the documented debian backport instructions: https://backports.debian.org/Instructions/ and adding the repos to the `update-packages.sh` script NPM Package References: - buster npm package: https://packages.debian.org/buster/npm - buster-backports npm package: https://packages.debian.org/buster-backports/npm Testing: - clean images `rm -f images/*.tar` - build image: `make images/gitea.tar` - verify image builds :) --- images/stack-base/Dockerfile | 2 ++ images/stack-base/files/etc/apt/packages.list | 27 ++++++++++++++----- images/stack-base/files/etc/apt/sources.list | 8 +++--- .../files/usr/local/bin/update-packages | 2 ++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/images/stack-base/Dockerfile b/images/stack-base/Dockerfile index f68784e..8339e96 100644 --- a/images/stack-base/Dockerfile +++ b/images/stack-base/Dockerfile @@ -12,6 +12,8 @@ ADD files / RUN apt-install +RUN apt update && apt-get -y -t buster-backports install "npm" + RUN enable-faketime RUN useradd -ms /bin/bash build diff --git a/images/stack-base/files/etc/apt/packages.list b/images/stack-base/files/etc/apt/packages.list index 0b032d6..1c321e7 100644 --- a/images/stack-base/files/etc/apt/packages.list +++ b/images/stack-base/files/etc/apt/packages.list @@ -1,9 +1,3 @@ -libpq5=11.9-0+deb10u1 -libpq-dev=11.9-0+deb10u1 -haskell-stack=1.7.1-3 -flex=2.6.4-6.2 -bison=2:3.3.2.dfsg-1 -musl-tools=1.1.21-2 adduser=3.118 apt=1.8.2.1 autoconf=2.69-11 @@ -15,6 +9,7 @@ bash=5.0-4 binutils=2.31.1-16 binutils-common:amd64=2.31.1-16 binutils-x86-64-linux-gnu=2.31.1-16 +bison=2:3.3.2.dfsg-1 bsdutils=1:2.33.1-0.1 build-essential=12.6 bzip2=1.0.6-9.2~deb10u1 @@ -40,6 +35,7 @@ fakeroot=1.23-1 fdisk=2.33.1-0.1 file=1:5.35-4+deb10u1 findutils=4.6.0+git+20190209-2 +flex=2.6.4-6.2 g++=4:8.3.0-1 g++-8=8.3.0-6 gcc=4:8.3.0-1 @@ -70,6 +66,7 @@ gpgv=2.2.12-1+deb10u1 grep=3.3-1 gyp=0.1+20180428git4d467626-3 gzip=1.9-3 +haskell-stack=1.7.1-3 hostname=3.21 init-system-helpers=1.56+nmu1 iproute2=4.20.0-2 @@ -92,6 +89,7 @@ libattr1:amd64=1:2.4.48-4 libaudit-common=1:2.8.4-3 libaudit1:amd64=1:2.8.4-3 libbinutils:amd64=2.31.1-16 +libbison-dev:amd64=2:3.3.2.dfsg-1 libblkid1:amd64=2.33.1-0.1 libbrotli1:amd64=1.0.7-2 libbsd0:amd64=0.9.1-2 @@ -127,6 +125,8 @@ libfaketime:amd64=0.9.7-3 libfdisk1:amd64=2.33.1-0.1 libffi6:amd64=3.2.1-9 libfile-fcntllock-perl=0.22-3+b5 +libfl-dev:amd64=2.6.4-6.2 +libfl2:amd64=2.6.4-6.2 libgcc-8-dev:amd64=8.3.0-6 libgcc1:amd64=1:8.3.0-6 libgcrypt20:amd64=1.8.4-5 @@ -134,7 +134,9 @@ libgdbm-compat4:amd64=1.18.1-4 libgdbm6:amd64=1.18.1-4 libglib2.0-0:amd64=2.58.3-2+deb10u2 libglib2.0-data=2.58.3-2+deb10u2 +libgmp-dev:amd64=2:6.1.2+dfsg-4 libgmp10:amd64=2:6.1.2+dfsg-4 +libgmpxx4ldbl:amd64=2:6.1.2+dfsg-4 libgnutls30:amd64=3.6.7-4+deb10u5 libgomp1:amd64=8.3.0-6 libgpg-error0:amd64=1.35-1 @@ -175,8 +177,10 @@ libmodule-find-perl=0.13-1 libmodule-scandeps-perl=1.27-1 libmount1:amd64=2.33.1-0.1 libmpc3:amd64=1.1.0-1 +libmpdec2:amd64=2.4.2-2 libmpfr6:amd64=4.0.2-1 libmpx2:amd64=8.3.0-6 +libncurses-dev:amd64=6.1+20181013-2+deb10u2 libncurses6:amd64=6.1+20181013-2+deb10u2 libncursesw6:amd64=6.1+20181013-2+deb10u2 libnetfilter-conntrack3:amd64=1.0.7-1 @@ -200,15 +204,20 @@ libpam0g:amd64=1.3.1-5 libpcre2-8-0:amd64=10.32-5 libpcre3:amd64=2:8.39-12 libperl5.28:amd64=5.28.1-6+deb10u1 +libpq-dev=11.9-0+deb10u1 +libpq5:amd64=11.9-0+deb10u1 libproc-processtable-perl=0.56-1 libpsl5:amd64=0.20.2-2 libpython-stdlib:amd64=2.7.16-1 libpython2-stdlib:amd64=2.7.16-1 libpython2.7-minimal:amd64=2.7.16-2+deb10u1 libpython2.7-stdlib:amd64=2.7.16-2+deb10u1 +libpython3-stdlib:amd64=3.7.3-1 +libpython3.7-minimal:amd64=3.7.3-2+deb10u2 +libpython3.7-stdlib:amd64=3.7.3-2+deb10u2 libquadmath0:amd64=8.3.0-6 -libreadline7:amd64=7.0-5 libreadline-dev:amd64=7.0-5 +libreadline7:amd64=7.0-5 librtmp1:amd64=2.4+20151223.gitfa8646d.1-2 libsasl2-2:amd64=2.1.27+dfsg-1+deb10u1 libsasl2-modules:amd64=2.1.27+dfsg-1+deb10u1 @@ -248,6 +257,7 @@ libxext6:amd64=2:1.3.3-1+b2 libxml2:amd64=2.9.4+dfsg1-7+b3 libxmuu1:amd64=2:1.1.2-2+b3 libxtables12:amd64=1.8.2-4 +libyaml-0-2:amd64=0.2.1-1 libzstd1:amd64=1.3.8+dfsg-3 linux-libc-dev:amd64=4.19.152-1 login=1:4.5-1.1 @@ -527,7 +537,10 @@ python2-minimal=2.7.16-1 python2.7=2.7.16-2+deb10u1 python2.7-minimal=2.7.16-2+deb10u1 python3=3.7.3-1 +python3-minimal=3.7.3-1 python3-yaml=3.13-2 +python3.7=3.7.3-2+deb10u2 +python3.7-minimal=3.7.3-2+deb10u2 readline-common=7.0-5 runc=1.0.0~rc6+dfsg1-3 sed=4.7-1 diff --git a/images/stack-base/files/etc/apt/sources.list b/images/stack-base/files/etc/apt/sources.list index 441f78a..e5819dd 100644 --- a/images/stack-base/files/etc/apt/sources.list +++ b/images/stack-base/files/etc/apt/sources.list @@ -1,6 +1,8 @@ deb http://deb.debian.org/debian buster main -deb http://snapshot.debian.org/archive/debian/20201125T000000Z buster main +deb http://snapshot.debian.org/archive/debian/20201129T000000Z buster main deb http://security.debian.org/debian-security buster/updates main -deb http://snapshot.debian.org/archive/debian-security/20201125T000000Z buster/updates main +deb http://snapshot.debian.org/archive/debian-security/20201129T000000Z buster/updates main deb http://deb.debian.org/debian buster-updates main -deb http://snapshot.debian.org/archive/debian/20201125T000000Z buster-updates main +deb http://snapshot.debian.org/archive/debian/20201129T000000Z buster-updates main +deb http://deb.debian.org/debian buster-backports main +deb http://snapshot.debian.org/archive/debian/20201129T000000Z buster-backports main diff --git a/images/stack-base/files/usr/local/bin/update-packages b/images/stack-base/files/usr/local/bin/update-packages index ae09293..8117c56 100755 --- a/images/stack-base/files/usr/local/bin/update-packages +++ b/images/stack-base/files/usr/local/bin/update-packages @@ -16,6 +16,8 @@ deb http://security.debian.org/debian-security buster/updates main deb http://snapshot.debian.org/archive/debian-security/${snapshot_date} buster/updates main deb http://deb.debian.org/debian buster-updates main deb http://snapshot.debian.org/archive/debian/${snapshot_date} buster-updates main +deb http://deb.debian.org/debian buster-backports main +deb http://snapshot.debian.org/archive/debian/${snapshot_date} buster-backports main EOF dpkg -l | awk '{ if ($1 == "ii") print $2 "=" $3 }' > /etc/apt/packages.list