Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: add libcap-dev package to Linux distros #2607

Closed
wants to merge 4 commits into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Apr 6, 2021

This commit adds the libcap-dev package to linux distributions to
support the usage of Linux capabilities in Node.js.

Fixes: #2599
Refs: nodejs/node#37727

ansible/roles/baselayout/vars/main.yml Outdated Show resolved Hide resolved
ansible/roles/baselayout/vars/main.yml Outdated Show resolved Hide resolved
ansible/roles/baselayout/vars/main.yml Outdated Show resolved Hide resolved
danbev added a commit to danbev/build that referenced this pull request Apr 6, 2021
This is no longer in the CI so it should be alright to remove it.

Refs: nodejs#2607
@danbev danbev mentioned this pull request Apr 6, 2021
@richardlau richardlau force-pushed the linux-libcap-install branch 2 times, most recently from 95a7d52 to 14ef549 Compare April 9, 2021 19:07
@richardlau
Copy link
Member

I've updated this on top of the recently landed PR's that touch the ansible scripts have applied it to most of the non-containered Linux systems with the exception of hosts that we currently have issues with: #2531

@richardlau
Copy link
Member

This has been applied to the CI, but a test build of nodejs/node#37727, https://ci.nodejs.org/job/node-test-pull-request/37434/, is failing on the centos, fedora and alpine hosts.

@richardlau
Copy link
Member

Perhaps at least on Fedora we need libcap-static?

[root@test-digitalocean-fedora32-x64-1 ~]# dnf list installed libcap*
Installed Packages
libcap.x86_64                                                               2.26-7.fc32                                                            @anaconda
libcap-devel.x86_64                                                         2.26-7.fc32                                                            @fedora
libcap-ng.x86_64
[root@test-digitalocean-fedora32-x64-1 ~]# dnf search libcap
Last metadata expiration check: 2:04:56 ago on Tue Apr 13 13:15:09 2021.
=============================================================== Name Exactly Matched: libcap ===============================================================
libcap.x86_64 : Library for getting and setting POSIX.1e capabilities
libcap.i686 : Library for getting and setting POSIX.1e capabilities
============================================================== Name & Summary Matched: libcap ==============================================================
libcap-devel.x86_64 : Development files for libcap
libcap-devel.i686 : Development files for libcap
libcap-ng-devel.i686 : Header files for libcap-ng library
libcap-ng-devel.x86_64 : Header files for libcap-ng library
libcap-ng-python3.x86_64 : Python3 bindings for libcap-ng library
libcap-static.i686 : Static libraries for libcap development
libcap-static.x86_64 : Static libraries for libcap development
=================================================================== Name Matched: libcap ===================================================================
libcap-ng.x86_64 : An alternate posix capabilities library
libcap-ng.i686 : An alternate posix capabilities library
libcap-ng-utils.x86_64 : Utilities for analyzing and setting file capabilities
[root@test-digitalocean-fedora32-x64-1 ~]#

libcap-static doesn't appear to be available on centos 7:

[root@test-softlayer-centos7-x64-1 ~]# yum list installed libcap*
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: mirrors.raystedman.org
 * centos-sclo-sclo: mirror.sfo12.us.leaseweb.net
 * epel: sjc.edge.kernel.org
Installed Packages
libcap.x86_64                                                                  2.22-11.el7                                                             @base
libcap-devel.x86_64                                                            2.22-11.el7                                                             @base
libcap-ng.x86_64                                                               0.7.5-4.el7                                                             @base
[root@test-softlayer-centos7-x64-1 ~]# yum search libcap
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * centos-sclo-rh: mirror.fileplanet.com
 * centos-sclo-sclo: mirror.sfo12.us.leaseweb.net
 * epel: sjc.edge.kernel.org
=================================================================== N/S matched: libcap ====================================================================
libcap-devel.i686 : Development files for libcap
libcap-devel.x86_64 : Development files for libcap
libcap-ng-devel.i686 : Header files for libcap-ng library
libcap-ng-devel.x86_64 : Header files for libcap-ng library
libcap-ng-python.x86_64 : Python bindings for libcap-ng library
compat-libcap1.i686 : Library for getting and setting POSIX.1e capabilities
compat-libcap1.x86_64 : Library for getting and setting POSIX.1e capabilities
libcap.i686 : Library for getting and setting POSIX.1e capabilities
libcap.x86_64 : Library for getting and setting POSIX.1e capabilities
libcap-ng.i686 : An alternate posix capabilities library
libcap-ng.x86_64 : An alternate posix capabilities library
libcap-ng-utils.x86_64 : Utilities for analyzing and setting file capabilities

  Name and summary matches only, use "search all" for everything.
[root@test-softlayer-centos7-x64-1 ~]#

@danbev
Copy link
Contributor Author

danbev commented Apr 14, 2021

This has been applied to the CI, but a test build of nodejs/node#37727, https://ci.nodejs.org/job/node-test-pull-request/37434/, is failing on the centos, fedora and alpine hosts.

I'll take a closer look at this now. Thanks!

@danbev
Copy link
Contributor Author

danbev commented Apr 14, 2021

Perhaps at least on Fedora we need libcap-static?

Yeah, it actually looks like this is required and I had it installed locally but don't remember installing it. I'll look into what can be done for centos and alpine.

richardlau added a commit that referenced this pull request Apr 28, 2021
This is no longer in the CI so it should be alright to remove it.

Refs: #2607

Co-authored-by: Richard Lau <rlau@redhat.com>
@danbev
Copy link
Contributor Author

danbev commented Jul 21, 2021

@richardlau I've updated nodejs/node#37727 with a suggestion that only needs the header sys/capability.h from libcap-devel. If I recall the issue with the failures were when linking with libcap and I be interested to see if nodejs/node#3772 compiles.

@richardlau
Copy link
Member

@danbev Could you rebase this and fix any merge conflicts?

This commit adds the libcap-dev package to linux distributions to
support the usage of Linux capabilities in Node.js.

Fixes: nodejs#2599
Refs: nodejs/node#37727
@danbev danbev force-pushed the linux-libcap-install branch from 519e6f2 to 8250696 Compare July 21, 2021 11:13
@danbev
Copy link
Contributor Author

danbev commented Jul 21, 2021

@richardlau I've updated this PR now 👍

@richardlau
Copy link
Member

I've applied this onto the container images and the ubuntu1804 hosts (i.e. the ones failing from https://ci.nodejs.org/job/node-test-pull-request/39198/ due to missing <sys/capability.h>). Resumed that failing CI in https://ci.nodejs.org/job/node-test-pull-request/39212/

@danbev
Copy link
Contributor Author

danbev commented Jul 22, 2021

Re-run of failing node-test-commit-linux ✔️

This commit copies /usr/include/sys/capabilities.h to the sysroot used
when cross compiling. I have no idea if this will actually work but I
tried the manually with a container and at least it compiled for me.
@danbev
Copy link
Contributor Author

danbev commented Aug 26, 2021

Closing this as think that using a syscall to avoid issues with libcap-dev dependency.

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.

Request to install libcap on Linux CI machines
3 participants