From 82506966648f51beb88df58412c948b27d0a406c Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 6 Apr 2021 11:20:19 +0200 Subject: [PATCH] ansible: add libcap-dev package to Linux distros This commit adds the libcap-dev package to linux distributions to support the usage of Linux capabilities in Node.js. Fixes: https://github.com/nodejs/build/issues/2599 Refs: https://github.com/nodejs/node/pull/37727 --- ansible/roles/baselayout/vars/main.yml | 20 +++++++++---------- .../docker/templates/alpine311.Dockerfile.j2 | 3 ++- .../docker/templates/alpine312.Dockerfile.j2 | 3 ++- .../docker/templates/ubi81.Dockerfile.j2 | 3 +++ .../docker/templates/ubuntu1604.Dockerfile.j2 | 3 ++- .../ubuntu1604_arm_cross.Dockerfile.j2 | 3 ++- .../docker/templates/ubuntu1804.Dockerfile.j2 | 3 ++- .../ubuntu1804_arm_cross.Dockerfile.j2 | 3 ++- .../ubuntu1804_sharedlibs.Dockerfile.j2 | 3 ++- 9 files changed, 27 insertions(+), 17 deletions(-) diff --git a/ansible/roles/baselayout/vars/main.yml b/ansible/roles/baselayout/vars/main.yml index ee48acdda..48527e296 100644 --- a/ansible/roles/baselayout/vars/main.yml +++ b/ansible/roles/baselayout/vars/main.yml @@ -41,11 +41,11 @@ packages: { # centos-release-scl is required to enable SCLo but we do it manually in # partials/repo/centos7.yml for arm64 centos7_arm64: ['git,python3'], # git2u not available for aarch64 (yet) - centos7_x64: ['devtoolset-6-libatomic-devel,git222,centos-release-scl,python3'], - centos7_ppc64: ['cmake3,devtoolset-6-libatomic-devel,glib2-devel,git,python3'], + centos7_x64: ['devtoolset-6-libatomic-devel,git222,centos-release-scl,python3,libcap-devel'], + centos7_ppc64: ['cmake3,devtoolset-6-libatomic-devel,glib2-devel,git,python3,libcap-devel'], centos7: [ - 'bzip2-devel,openssl-devel,ccache,gcc-c++,devtoolset-6,sudo,zlib-devel,libffi-devel,devtoolset-8,devtoolset-8-libatomic-devel', + 'bzip2-devel,openssl-devel,ccache,gcc-c++,devtoolset-6,sudo,zlib-devel,libffi-devel,devtoolset-8,devtoolset-8-libatomic-devel,libcap-devel', ], aix: [ @@ -57,23 +57,23 @@ packages: { ], debian8: [ - 'ccache,git,gcc-4.9,g++-4.9,libfontconfig1,binutils-2.26,sudo', + 'ccache,git,gcc-4.9,g++-4.9,libfontconfig1,binutils-2.26,sudo,libcap-dev', ], debian9: [ - 'gcc-6,g++-6,ccache,git,curl,libfontconfig1,apt-transport-https,ca-certificates,sudo', + 'gcc-6,g++-6,ccache,git,curl,libfontconfig1,apt-transport-https,ca-certificates,sudo,libcap-dev', ], debian10: [ - 'gcc-8,g++-8,ccache,git,curl,libfontconfig1,apt-transport-https,ca-certificates,sudo,python3-pip', + 'gcc-8,g++-8,ccache,git,curl,libfontconfig1,apt-transport-https,ca-certificates,sudo,python3-pip,libcap-dev', ], fedora: [ - 'bzip2,ccache,gcc-c++,git,fontconfig,sudo,make', + 'bzip2,ccache,gcc-c++,git,fontconfig,sudo,make,libcap-devel', ], freebsd: [ - 'ccache,git,gmake,sudo,python3' + 'ccache,git,gmake,sudo,python3,libcap-dev' ], 'macos10.10': [ @@ -111,7 +111,7 @@ packages: { ], rhel7: [ - 'gcc-c++,sudo,git,zip,unzip,iptables-services,GConf2-devel,openssl-devel,python3', + 'gcc-c++,sudo,git,zip,unzip,iptables-services,GConf2-devel,openssl-devel,python3,libcap-devel', ], smartos: [ @@ -144,7 +144,7 @@ packages: { ], ubuntu: [ - 'ccache,git,libfontconfig1,sudo,python3-pip', + 'ccache,git,libfontconfig1,sudo,python3-pip,libcap-dev', ], ubuntu1404: [ diff --git a/ansible/roles/docker/templates/alpine311.Dockerfile.j2 b/ansible/roles/docker/templates/alpine311.Dockerfile.j2 index d5c63ff4e..42554ca38 100644 --- a/ansible/roles/docker/templates/alpine311.Dockerfile.j2 +++ b/ansible/roles/docker/templates/alpine311.Dockerfile.j2 @@ -40,7 +40,8 @@ RUN apk add --no-cache --virtual .build-deps \ bash \ automake \ libtool \ - autoconf + autoconf \ + libcap-dev RUN pip3 install tap2junit diff --git a/ansible/roles/docker/templates/alpine312.Dockerfile.j2 b/ansible/roles/docker/templates/alpine312.Dockerfile.j2 index c977bcd61..42ca329d2 100644 --- a/ansible/roles/docker/templates/alpine312.Dockerfile.j2 +++ b/ansible/roles/docker/templates/alpine312.Dockerfile.j2 @@ -38,7 +38,8 @@ RUN apk add --no-cache --virtual .build-deps \ bash \ automake \ libtool \ - autoconf + autoconf \ + libcap-dev RUN pip3 install tap2junit diff --git a/ansible/roles/docker/templates/ubi81.Dockerfile.j2 b/ansible/roles/docker/templates/ubi81.Dockerfile.j2 index 4a26499a4..033264765 100644 --- a/ansible/roles/docker/templates/ubi81.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubi81.Dockerfile.j2 @@ -25,7 +25,10 @@ RUN dnf install --disableplugin=subscription-manager -y \ python3 \ openssl-devel \ procps-ng \ + glibc-static \ && dnf --disableplugin=subscription-manager clean all +RUN git clone https://github.com/mhiramat/libcap && cd libcap && make \ + make install RUN groupadd -r -g {{ server_user_gid.stdout_lines[0] }} {{ server_user }} \ && adduser -r -m -d /home/{{ server_user }}/ \ diff --git a/ansible/roles/docker/templates/ubuntu1604.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1604.Dockerfile.j2 index 152accb0f..cf9c9ffa7 100644 --- a/ansible/roles/docker/templates/ubuntu1604.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu1604.Dockerfile.j2 @@ -22,7 +22,8 @@ RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \ curl \ python-pip \ python3-pip \ - libfontconfig1 + libfontconfig1 \ + libcap-dev RUN pip install tap2junit diff --git a/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 index 59bd90cc0..d51a73060 100644 --- a/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu1604_arm_cross.Dockerfile.j2 @@ -23,7 +23,8 @@ RUN apt-get update \ gcc-4.9-multilib \ g++-4.9-multilib \ gcc-6-multilib \ - g++-6-multilib + g++-6-multilib \ + libcap-dev RUN pip install tap2junit \ && pip3 install tap2junit diff --git a/ansible/roles/docker/templates/ubuntu1804.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1804.Dockerfile.j2 index badbf33b6..7c64ed6ff 100644 --- a/ansible/roles/docker/templates/ubuntu1804.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu1804.Dockerfile.j2 @@ -24,7 +24,8 @@ RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \ curl \ python-pip \ python3-pip \ - libfontconfig1 + libfontconfig1 \ + libcap-dev RUN pip install tap2junit diff --git a/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 index fbba85e56..aeac1f7c7 100644 --- a/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu1804_arm_cross.Dockerfile.j2 @@ -24,7 +24,8 @@ RUN apt-get update \ gcc-6-multilib \ g++-6-multilib \ gcc-8-multilib \ - g++-8-multilib + g++-8-multilib \ + libcap-dev RUN pip install tap2junit \ && pip3 install tap2junit diff --git a/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 b/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 index a30796940..9faeaa2e9 100644 --- a/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 +++ b/ansible/roles/docker/templates/ubuntu1804_sharedlibs.Dockerfile.j2 @@ -27,7 +27,8 @@ RUN apt-get update && apt-get install apt-utils -y && \ curl \ python-pip \ python3-pip \ - libfontconfig1 + libfontconfig1 \ + libcap-dev RUN pip install tap2junit