[meta-selinux,1/2] meson-selinux.bbclass: fix meson flags for glib-2.0-native

Submitted by Mikko Rapeli on Aug. 28, 2019, 3:30 p.m. | Patch ID: 164391

Details

Message ID 1567006222-23574-1-git-send-email-mikko.rapeli@bmw.de
State New
Headers show

Commit Message

Mikko Rapeli Aug. 28, 2019, 3:30 p.m.
With latest poky master, glib-2.0-native fails to compile:

| meson.build:1:0: ERROR: Value "false" for combo option is not one of the choices. Possible choices are: "enabled",
 "disabled", "auto".

Thus use enabled and disabled when enabling and disabling flags
with meson. Now glib-2.0-native compiles again.

Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
---
 classes/meson-selinux.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/classes/meson-selinux.bbclass b/classes/meson-selinux.bbclass
index 77a763a..91c2a2b 100644
--- a/classes/meson-selinux.bbclass
+++ b/classes/meson-selinux.bbclass
@@ -1,4 +1,4 @@ 
 inherit selinux
 
 PACKAGECONFIG_append = " ${@target_selinux(d)}"
-PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,"
+PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux,"

Comments

Joe MacDonald Aug. 28, 2019, 5:19 p.m.
Hi Mikko,

Is this specifically for warrior (or thud), maybe?  The following commit
explains the current logic:

    commit bb0c9c3abcb935e4b362eb57985e1ee7fec0bfe0
    Author: Yi Zhao <yi.zhao@windriver.com>
    Date:   Wed Jun 12 15:53:20 2019 +0800
    
        glib-2.0: fix configure error for meson build
    
        In glib 2.60.x, it turns selinux into a meson feature. We should use
        '-Dselinux=enabled/disabled' rather than '-Dselinux=true/false' to
        enable/disable the feature.
    
        Add meso-enable-selinux.bbclass for this change and inherit it in
        glib-2.0 bbappend to fix the configure error.
    
        Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
        Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>

and the second patch is already present in tree:

    commit 087fe5c8144c246c6361bd8bcbd1ffd9e9b675bb
    Author: Yi Zhao <yi.zhao@windriver.com>
    Date:   Fri Aug 9 17:48:00 2019 +0800
    
        libselinux: fix build with glibc 2.30
    
        Fix build error:
        procattr.c:27:14: error: static declaration of 'gettid' follows
        non-static declaration
           27 | static pid_t gettid(void)
              |              ^~~~~~
        In file included from /buildarea/build/tmp/work/core2-64-poky-linux/libselinux/2.8-r0/recipe-sysroot/usr/include/unistd.h:1170,
                         from procattr.c:2:
        /buildarea/build/tmp/work/core2-64-poky-linux/libselinux/2.8-r0/recipe-sysroot/usr/include/bits/unistd_ext.h:34:16:
        note: previous declaration of 'gettid' was here
           34 | extern __pid_t gettid (void) __THROW;
              |                ^~~~~~
    
        Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
        Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>

This is what my current work tree looks like, for reference:

  $ repo forall -p -c git log -1 --pretty=oneline
  project meta-openembedded/
  2ebaa8df1257389161d0bee9e553c28f63e52005 python3-pyatspi: Add Dbus ATSPI recipe
  
  project meta-selinux/
  154654a6fe12206a6b9ad6d8c36a4dbe672bcc46 selinux-python: Fix dependency for ntpath
  
  project yocto-mainline/
  ca2207f418b7847ffce4b8c53a5a442e5cf461d9 commands.py: fix typo

-J.

[[yocto] [meta-selinux][PATCH 1/2] meson-selinux.bbclass: fix meson flags for glib-2.0-native] On 19.08.28 (Wed 18:30) Mikko Rapeli wrote:

> With latest poky master, glib-2.0-native fails to compile:
> 
> | meson.build:1:0: ERROR: Value "false" for combo option is not one of the choices. Possible choices are: "enabled",
>  "disabled", "auto".
> 
> Thus use enabled and disabled when enabling and disabling flags
> with meson. Now glib-2.0-native compiles again.
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
> ---
>  classes/meson-selinux.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/classes/meson-selinux.bbclass b/classes/meson-selinux.bbclass
> index 77a763a..91c2a2b 100644
> --- a/classes/meson-selinux.bbclass
> +++ b/classes/meson-selinux.bbclass
> @@ -1,4 +1,4 @@
>  inherit selinux
>  
>  PACKAGECONFIG_append = " ${@target_selinux(d)}"
> -PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,"
> +PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux,"
> -- 
> 1.9.1
> 
> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
Mikko Rapeli Aug. 29, 2019, 6:41 a.m.
Hi,

On Wed, Aug 28, 2019 at 01:19:17PM -0400, Joe MacDonald wrote:
> Hi Mikko,
> 
> Is this specifically for warrior (or thud), maybe?  The following commit
> explains the current logic:
> 
>     commit bb0c9c3abcb935e4b362eb57985e1ee7fec0bfe0
>     Author: Yi Zhao <yi.zhao@windriver.com>
>     Date:   Wed Jun 12 15:53:20 2019 +0800
>     
>         glib-2.0: fix configure error for meson build
>     
>         In glib 2.60.x, it turns selinux into a meson feature. We should use
>         '-Dselinux=enabled/disabled' rather than '-Dselinux=true/false' to
>         enable/disable the feature.
>     
>         Add meso-enable-selinux.bbclass for this change and inherit it in
>         glib-2.0 bbappend to fix the configure error.
>     
>         Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
>         Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> 
> and the second patch is already present in tree:
> 
>     commit 087fe5c8144c246c6361bd8bcbd1ffd9e9b675bb
>     Author: Yi Zhao <yi.zhao@windriver.com>
>     Date:   Fri Aug 9 17:48:00 2019 +0800
>     
>         libselinux: fix build with glibc 2.30
>     
>         Fix build error:
>         procattr.c:27:14: error: static declaration of 'gettid' follows
>         non-static declaration
>            27 | static pid_t gettid(void)
>               |              ^~~~~~
>         In file included from /buildarea/build/tmp/work/core2-64-poky-linux/libselinux/2.8-r0/recipe-sysroot/usr/include/unistd.h:1170,
>                          from procattr.c:2:
>         /buildarea/build/tmp/work/core2-64-poky-linux/libselinux/2.8-r0/recipe-sysroot/usr/include/bits/unistd_ext.h:34:16:
>         note: previous declaration of 'gettid' was here
>            34 | extern __pid_t gettid (void) __THROW;
>               |                ^~~~~~
>     
>         Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
>         Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
> 
> This is what my current work tree looks like, for reference:
> 
>   $ repo forall -p -c git log -1 --pretty=oneline
>   project meta-openembedded/
>   2ebaa8df1257389161d0bee9e553c28f63e52005 python3-pyatspi: Add Dbus ATSPI recipe
>   
>   project meta-selinux/
>   154654a6fe12206a6b9ad6d8c36a4dbe672bcc46 selinux-python: Fix dependency for ntpath
>   
>   project yocto-mainline/
>   ca2207f418b7847ffce4b8c53a5a442e5cf461d9 commands.py: fix typo

Hmm, good that same patches are already in master branch but I somehow got a
much older master branch state from remote git://git.yoctoproject.org/meta-selinux

commit a917c322c120c05fc6746fc9aca38c27398ffb4a
Author:     Yi Zhao <yi.zhao@windriver.com>
AuthorDate: Fri Apr 19 10:46:32 2019 +0800
Commit:     Joe MacDonald <joe@deserted.net>
CommitDate: Tue Apr 23 11:12:57 2019 -0400

Was also checking master-next there.

Based on time stamps in .git/modules/meta-selinux/refs/remotes/upstream/ my last fetch
was Aug 28 11:02 CET. Seems like the "libselinux: fix build with glibc 2.30"
was pushed to the server just after I had been checking for it:

commit 087fe5c8144c246c6361bd8bcbd1ffd9e9b675bb
Author:     Yi Zhao <yi.zhao@windriver.com>
AuthorDate: Fri Aug 9 17:48:00 2019 +0800
Commit:     Joe MacDonald <joe_macdonald@mentor.com>
CommitDate: Wed Aug 28 10:26:52 2019 -0400

    libselinux: fix build with glibc 2.30

Anyway, fixes are in and life continues :)

Thanks,

-Mikko

> -J.
> 
> [[yocto] [meta-selinux][PATCH 1/2] meson-selinux.bbclass: fix meson flags for glib-2.0-native] On 19.08.28 (Wed 18:30) Mikko Rapeli wrote:
> 
> > With latest poky master, glib-2.0-native fails to compile:
> > 
> > | meson.build:1:0: ERROR: Value "false" for combo option is not one of the choices. Possible choices are: "enabled",
> >  "disabled", "auto".
> > 
> > Thus use enabled and disabled when enabling and disabling flags
> > with meson. Now glib-2.0-native compiles again.
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de>
> > ---
> >  classes/meson-selinux.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/classes/meson-selinux.bbclass b/classes/meson-selinux.bbclass
> > index 77a763a..91c2a2b 100644
> > --- a/classes/meson-selinux.bbclass
> > +++ b/classes/meson-selinux.bbclass
> > @@ -1,4 +1,4 @@
> >  inherit selinux
> >  
> >  PACKAGECONFIG_append = " ${@target_selinux(d)}"
> > -PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,"
> > +PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux,"
> > -- 
> > 1.9.1
> > 
> > -- 
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
> 
> -- 
> -Joe MacDonald.
> :wq