Skip to content

Make libdl optional in meson definition#305

Merged
rhatdan merged 1 commit into
containers:mainfrom
saschagrunert:meson-libdl
Jan 13, 2022
Merged

Make libdl optional in meson definition#305
rhatdan merged 1 commit into
containers:mainfrom
saschagrunert:meson-libdl

Conversation

@saschagrunert

@saschagrunert saschagrunert commented Oct 18, 2021

Copy link
Copy Markdown
Member

We now conditionally check for the availability of dlopen and add libdl if required.

Fixes: #298

Comment thread meson.build
language : 'c')

glib = dependency('glib-2.0')
libdl = cc.find_library('dl')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giuseppe the dependency has been added as part of #190. Do you know for which environment we required explicitly setting this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is used when conmon is built with seccomp (so with USE_SECCOMP)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, for example the nix build is using USE_SECCOMP=1 and works even with this patch. Do you think it's fine to remove it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay, I've missed this notification.

The build works fine but if we try to load a seccomp plugin then it will fail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the dependency optional, which should work.

@kloczek

kloczek commented Oct 18, 2021

Copy link
Copy Markdown

Just tested that PR:

[tkloczko@barrel SPECS]$ bg; rpmbuild -ba --clean --rmsource --rmspec --rmsource conmon.spec
-bash: bg: current: no such job
warning: Downloading https://github.com/containers/conmon//archive/v2.0.30/conmon-2.0.30.tar.gz to /home/tkloczko/rpmbuild/SOURCES/conmon-2.0.30.tar.gz
warning: Downloading https://github.com/containers/conmon//pull/305.patch#/conmon-Remove-libdl-from-meson-definition.patch to /home/tkloczko/rpmbuild/SOURCES/conmon-Remove-libdl-from-meson-definition.patch
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.y9rrF8
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ cd /home/tkloczko/rpmbuild/BUILD
+ rm -rf conmon-2.0.30
+ /usr/bin/gzip -dc /home/tkloczko/rpmbuild/SOURCES/conmon-2.0.30.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd conmon-2.0.30
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/conmon-remove_hardcoding_compiler_flags.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ /usr/bin/cat /home/tkloczko/rpmbuild/SOURCES/conmon-Remove-libdl-from-meson-definition.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f
+ RPM_EC=0
++ jobs -p

[..]

+ /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu
The Meson build system
Version: 0.59.2
Source dir: /home/tkloczko/rpmbuild/BUILD/conmon-2.0.30
Build dir: /home/tkloczko/rpmbuild/BUILD/conmon-2.0.30/x86_64-redhat-linux-gnu
Build type: native build
Project name: conmon
Project version: 2.0.30
C compiler for the host machine: /usr/bin/gcc (gcc 11.2.1 "gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)")
C linker for the host machine: /usr/bin/gcc ld.bfd 2.37-15
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program git found: YES (/usr/bin/git)
Found pkg-config: /usr/bin/pkg-config (1.8.0)
Run-time dependency glib-2.0 found: YES 2.70.0
Build targets in project: 1

Found ninja-1.10.2 at /usr/bin/ninja

[..]

Wrote: /home/tkloczko/rpmbuild/SRPMS/conmon-2.0.30-3.fc35.src.rpm
Wrote: /home/tkloczko/rpmbuild/RPMS/conmon-2.0.30-3.fc35.x86_64.rpm
Wrote: /home/tkloczko/rpmbuild/RPMS/conmon-debugsource-2.0.30-3.fc35.x86_64.rpm
Wrote: /home/tkloczko/rpmbuild/RPMS/conmon-debuginfo-2.0.30-3.fc35.x86_64.rpm

Thank you.

@saschagrunert
saschagrunert force-pushed the meson-libdl branch 2 times, most recently from 58b3283 to a7ec912 Compare October 27, 2021 11:32
@saschagrunert saschagrunert changed the title Remove libdl from meson definition Make libdl optional in meson definition Oct 27, 2021
@rhatdan

rhatdan commented Jan 11, 2022

Copy link
Copy Markdown
Member

@saschagrunert What is going on with this PR?

We now conditionally check for the availability of `dlopen` and add
`libdl` if required.

Fixes: containers#298

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@saschagrunert

Copy link
Copy Markdown
Member Author

@saschagrunert What is going on with this PR?

It just needs to be reviewed :)

@saschagrunert

Copy link
Copy Markdown
Member Author

@giuseppe PTAL

@giuseppe giuseppe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rhatdan

rhatdan commented Jan 13, 2022

Copy link
Copy Markdown
Member

LGTM

@rhatdan
rhatdan merged commit 8b2f604 into containers:main Jan 13, 2022
@saschagrunert
saschagrunert deleted the meson-libdl branch January 13, 2022 14:09
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.

2.0.30: meson fails

4 participants