* [PATCH] gstreamer: Fix reproducibility issue around libcap
@ 2020-02-19 15:23 Richard Purdie
2020-02-19 15:41 ` Alexander Kanavin
2020-02-20 11:56 ` Martin Hundebøll
0 siblings, 2 replies; 5+ messages in thread
From: Richard Purdie @ 2020-02-19 15:23 UTC (permalink / raw)
To: openembedded-core
Add an option to avoid builds depending on the presence of setcap
from the host system.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
.../gstreamer/gstreamer1.0/capfix.patch | 37 +++++++++++++++++++
.../gstreamer/gstreamer1.0_1.16.1.bb | 2 +
2 files changed, 39 insertions(+)
create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
new file mode 100644
index 00000000000..7ca3d5ad4a6
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
@@ -0,0 +1,37 @@
+Currently gstreamer configuration depends on whether setcap is found on the host
+system. Turn this into a configure option to make builds deterinistic.
+
+RP 2020/2/19
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Upstream-Status: Pending
+
+Index: gstreamer-1.16.1/libs/gst/helpers/meson.build
+===================================================================
+--- gstreamer-1.16.1.orig/libs/gst/helpers/meson.build
++++ gstreamer-1.16.1/libs/gst/helpers/meson.build
+@@ -73,7 +73,12 @@ if have_ptp
+ endif
+ endif
+
+- setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
++ setcap_feature = get_option('setcap')
++ if setcap_feature.disabled()
++ setcap = find_program('dontexist', required : false)
++ else
++ setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
++ endif
+
+ # user/group to change to in gst-ptp-helper
+ ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
+Index: gstreamer-1.16.1/meson_options.txt
+===================================================================
+--- gstreamer-1.16.1.orig/meson_options.txt
++++ gstreamer-1.16.1/meson_options.txt
+@@ -26,6 +26,7 @@ option('libunwind', type : 'feature', va
+ option('libdw', type : 'feature', value : 'auto', description : 'Use libdw to generate better backtraces from libunwind')
+ option('dbghelp', type : 'feature', value : 'auto', description : 'Use dbghelp to generate backtraces')
+ option('bash-completion', type : 'feature', value : 'auto', description : 'Install bash completion files')
++option('setcap', type : 'feature', value : 'auto', description : 'Use setcap')
+
+ # Common feature options
+ option('examples', type : 'feature', value : 'auto', yield : true)
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb
index 6b8a5a0eb01..68f5ca649fe 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb
@@ -21,6 +21,7 @@ SRC_URI = " \
file://0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch \
file://0003-meson-Add-valgrind-feature.patch \
file://0004-meson-Add-option-for-installed-tests.patch \
+ file://capfix.patch \
"
SRC_URI[md5sum] = "c505fb818b36988daaa846e9e63eabe8"
SRC_URI[sha256sum] = "02211c3447c4daa55919c5c0f43a82a6fbb51740d57fc3af0639d46f1cf4377d"
@@ -39,6 +40,7 @@ PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
PACKAGECONFIG[dw] = "-Dlibdw=enabled,-Dlibdw=disabled,elfutils"
PACKAGECONFIG[bash-completion] = "-Dbash-completion=enabled,-Dbash-completion=disabled,bash-completion"
PACKAGECONFIG[tools] = "-Dtools=enabled,-Dtools=disabled"
+PACKAGECONFIG[setcap] = "-Dsetcap=enabled,-Dsetcap=disabled,libcap"
# TODO: put this in a gettext.bbclass patch
def gettext_oemeson(d):
--
2.25.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] gstreamer: Fix reproducibility issue around libcap
2020-02-19 15:23 [PATCH] gstreamer: Fix reproducibility issue around libcap Richard Purdie
@ 2020-02-19 15:41 ` Alexander Kanavin
2020-02-19 15:45 ` Richard Purdie
2020-02-20 11:56 ` Martin Hundebøll
1 sibling, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2020-02-19 15:41 UTC (permalink / raw)
To: Richard Purdie; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 309 bytes --]
On Wed, 19 Feb 2020 at 16:24, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> +PACKAGECONFIG[setcap] = "-Dsetcap=enabled,-Dsetcap=disabled,libcap"
>
I think this should also depend on whatever native recipe provides the
setcap binary, so we don't depend on host setcap at all?
Alex
[-- Attachment #2: Type: text/html, Size: 676 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gstreamer: Fix reproducibility issue around libcap
2020-02-19 15:41 ` Alexander Kanavin
@ 2020-02-19 15:45 ` Richard Purdie
0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2020-02-19 15:45 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: OE-core
On Wed, 2020-02-19 at 16:41 +0100, Alexander Kanavin wrote:
> On Wed, 19 Feb 2020 at 16:24, Richard Purdie <
> richard.purdie@linuxfoundation.org> wrote:
> > +PACKAGECONFIG[setcap] = "-Dsetcap=enabled,-
> > Dsetcap=disabled,libcap"
>
> I think this should also depend on whatever native recipe provides
> the setcap binary, so we don't depend on host setcap at all?
Right, it needs libcap-native too, good point. I'll tweak.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gstreamer: Fix reproducibility issue around libcap
2020-02-19 15:23 [PATCH] gstreamer: Fix reproducibility issue around libcap Richard Purdie
2020-02-19 15:41 ` Alexander Kanavin
@ 2020-02-20 11:56 ` Martin Hundebøll
2020-02-20 12:00 ` Richard Purdie
1 sibling, 1 reply; 5+ messages in thread
From: Martin Hundebøll @ 2020-02-20 11:56 UTC (permalink / raw)
To: Richard Purdie, openembedded-core
Hi,
On 19/02/2020 16.23, Richard Purdie wrote:
> Add an option to avoid builds depending on the presence of setcap
> from the host system.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> .../gstreamer/gstreamer1.0/capfix.patch | 37 +++++++++++++++++++
> .../gstreamer/gstreamer1.0_1.16.1.bb | 2 +
> 2 files changed, 39 insertions(+)
> create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
>
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
> new file mode 100644
> index 00000000000..7ca3d5ad4a6
> --- /dev/null
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
> @@ -0,0 +1,37 @@
> +Currently gstreamer configuration depends on whether setcap is found on the host
> +system. Turn this into a configure option to make builds deterinistic.
> +
> +RP 2020/2/19
> +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> +Upstream-Status: Pending
> +
> +Index: gstreamer-1.16.1/libs/gst/helpers/meson.build
> +===================================================================
> +--- gstreamer-1.16.1.orig/libs/gst/helpers/meson.build
> ++++ gstreamer-1.16.1/libs/gst/helpers/meson.build
> +@@ -73,7 +73,12 @@ if have_ptp
> + endif
> + endif
> +
> +- setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
> ++ setcap_feature = get_option('setcap')
> ++ if setcap_feature.disabled()
> ++ setcap = find_program('dontexist', required : false)
> ++ else
> ++ setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
> ++ endif
I think this can be simplified by using get_option() directly for the
"required" argument:
setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap',
required : get_option('setcap'))
// Martin
> +
> + # user/group to change to in gst-ptp-helper
> + ptp_helper_setuid_user = get_option('ptp-helper-setuid-user')
> +Index: gstreamer-1.16.1/meson_options.txt
> +===================================================================
> +--- gstreamer-1.16.1.orig/meson_options.txt
> ++++ gstreamer-1.16.1/meson_options.txt
> +@@ -26,6 +26,7 @@ option('libunwind', type : 'feature', va
> + option('libdw', type : 'feature', value : 'auto', description : 'Use libdw to generate better backtraces from libunwind')
> + option('dbghelp', type : 'feature', value : 'auto', description : 'Use dbghelp to generate backtraces')
> + option('bash-completion', type : 'feature', value : 'auto', description : 'Install bash completion files')
> ++option('setcap', type : 'feature', value : 'auto', description : 'Use setcap')
> +
> + # Common feature options
> + option('examples', type : 'feature', value : 'auto', yield : true)
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb
> index 6b8a5a0eb01..68f5ca649fe 100644
> --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.16.1.bb
> @@ -21,6 +21,7 @@ SRC_URI = " \
> file://0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch \
> file://0003-meson-Add-valgrind-feature.patch \
> file://0004-meson-Add-option-for-installed-tests.patch \
> + file://capfix.patch \
> "
> SRC_URI[md5sum] = "c505fb818b36988daaa846e9e63eabe8"
> SRC_URI[sha256sum] = "02211c3447c4daa55919c5c0f43a82a6fbb51740d57fc3af0639d46f1cf4377d"
> @@ -39,6 +40,7 @@ PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
> PACKAGECONFIG[dw] = "-Dlibdw=enabled,-Dlibdw=disabled,elfutils"
> PACKAGECONFIG[bash-completion] = "-Dbash-completion=enabled,-Dbash-completion=disabled,bash-completion"
> PACKAGECONFIG[tools] = "-Dtools=enabled,-Dtools=disabled"
> +PACKAGECONFIG[setcap] = "-Dsetcap=enabled,-Dsetcap=disabled,libcap"
>
> # TODO: put this in a gettext.bbclass patch
> def gettext_oemeson(d):
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] gstreamer: Fix reproducibility issue around libcap
2020-02-20 11:56 ` Martin Hundebøll
@ 2020-02-20 12:00 ` Richard Purdie
0 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2020-02-20 12:00 UTC (permalink / raw)
To: Martin Hundebøll, openembedded-core
On Thu, 2020-02-20 at 12:56 +0100, Martin Hundebøll wrote:
> On 19/02/2020 16.23, Richard Purdie wrote:
> > Add an option to avoid builds depending on the presence of setcap
> > from the host system.
> >
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > ---
> > .../gstreamer/gstreamer1.0/capfix.patch | 37 +++++++++++++++++++
> > .../gstreamer/gstreamer1.0_1.16.1.bb | 2 +
> > 2 files changed, 39 insertions(+)
> > create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
> >
> > diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
> > new file mode 100644
> > index 00000000000..7ca3d5ad4a6
> > --- /dev/null
> > +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/capfix.patch
> > @@ -0,0 +1,37 @@
> > +Currently gstreamer configuration depends on whether setcap is found on the host
> > +system. Turn this into a configure option to make builds deterinistic.
> > +
> > +RP 2020/2/19
> > +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > +Upstream-Status: Pending
> > +
> > +Index: gstreamer-1.16.1/libs/gst/helpers/meson.build
> > +===================================================================
> > +--- gstreamer-1.16.1.orig/libs/gst/helpers/meson.build
> > ++++ gstreamer-1.16.1/libs/gst/helpers/meson.build
> > +@@ -73,7 +73,12 @@ if have_ptp
> > + endif
> > + endif
> > +
> > +- setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
> > ++ setcap_feature = get_option('setcap')
> > ++ if setcap_feature.disabled()
> > ++ setcap = find_program('dontexist', required : false)
> > ++ else
> > ++ setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
> > ++ endif
>
> I think this can be simplified by using get_option() directly for the
> "required" argument:
>
> setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap',
> required : get_option('setcap'))
Yes, that looks better. I'm no meson expert, this is the first time
I've touched it.
I'd love if it someone was able to get this resolved with upstream.
I've been trying to work on getting various things fixed upstream (e.g.
some of the perl changes) but I'm having to take a practical view in
some areas. Getting the autobuilder stable/working sanely is currently
more of a priority than getting involved in a discussion with upstream
on something I know little about :/.
I've merged this patch but if anyone wants to improve it, I'm fine with
that.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-02-20 12:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-19 15:23 [PATCH] gstreamer: Fix reproducibility issue around libcap Richard Purdie
2020-02-19 15:41 ` Alexander Kanavin
2020-02-19 15:45 ` Richard Purdie
2020-02-20 11:56 ` Martin Hundebøll
2020-02-20 12:00 ` Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.