All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] libselinux: target python interface generation
@ 2017-04-13  4:16 Matt Weber
  2017-04-13  4:16 ` [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled Matt Weber
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Matt Weber @ 2017-04-13  4:16 UTC (permalink / raw)
  To: buildroot

Fixed a consistancy issue between toolchain revisions.
Moves the swig and pywrap step seperate from the overall
build "all".

Resolves:
http://autobuild.buildroot.net/results/967/967b74d0ae5b4b83ea2729217b005a3e1e4514d0/

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 package/libselinux/libselinux.mk | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
index ca7836f..7e92de6 100644
--- a/package/libselinux/libselinux.mk
+++ b/package/libselinux/libselinux.mk
@@ -20,7 +20,6 @@ LIBSELINUX_MAKE_OPTS = \
 	LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread" \
 	ARCH=$(KERNEL_ARCH)
 
-LIBSELINUX_MAKE_TARGETS = all
 LIBSELINUX_MAKE_INSTALL_TARGETS = install
 
 ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
@@ -39,16 +38,23 @@ LIBSELINUX_MAKE_OPTS += \
 	PYSITEDIR=$(TARGET_DIR)/usr/lib/$(LIBSELINUX_PYLIBVER)/site-packages \
 	SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
 
-LIBSELINUX_MAKE_TARGETS += swigify pywrap
 LIBSELINUX_MAKE_INSTALL_TARGETS += install-pywrap
+
+# dependencies are broken and result in file
+# truncation errors at library link if the
+# make targets are added to the existing BUILD_CMD
+define LIBSELINUX_BUILD_PYTHON_INTERFACE_
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(LIBSELINUX_MAKE_OPTS) DESTDIR=$(STAGING_DIR) swigify pywrap
+endef
 endif # python || python3
 
 define LIBSELINUX_BUILD_CMDS
 	# DESTDIR is needed during the compile to compute library and
 	# header paths.
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
-		$(LIBSELINUX_MAKE_OPTS) DESTDIR=$(STAGING_DIR) \
-		$(LIBSELINUX_MAKE_TARGETS)
+		$(LIBSELINUX_MAKE_OPTS) DESTDIR=$(STAGING_DIR) all
+	$(LIBSELINUX_BUILD_PYTHON_INTERFACE)
 endef
 
 define LIBSELINUX_INSTALL_STAGING_CMDS
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
  2017-04-13  4:16 [Buildroot] [PATCH 1/3] libselinux: target python interface generation Matt Weber
@ 2017-04-13  4:16 ` Matt Weber
  2017-04-13 20:27   ` Thomas Petazzoni
  2017-04-13  4:16 ` [Buildroot] [PATCH 3/3] python: " Matt Weber
  2017-04-13 20:19 ` [Buildroot] [PATCH 1/3] libselinux: target python interface generation Thomas Petazzoni
  2 siblings, 1 reply; 10+ messages in thread
From: Matt Weber @ 2017-04-13  4:16 UTC (permalink / raw)
  To: buildroot

When libselinux is enabled, a circular dependency is
created.  Disable ncurses python support when libselinux
is enabled so that the circular busybox, ncurses,
python, libselinux chain is broken.

Resolves
http://autobuild.buildroot.net/results/db1/db1e6f3054092fc5576ccab8e04a3b9d74ca9a8c/

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 package/python3/Config.in  | 1 +
 package/python3/python3.mk | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/package/python3/Config.in b/package/python3/Config.in
index 35f57e6..fce635d 100644
--- a/package/python3/Config.in
+++ b/package/python3/Config.in
@@ -53,6 +53,7 @@ config BR2_PACKAGE_PYTHON3_CODECSCJK
 config BR2_PACKAGE_PYTHON3_CURSES
 	bool "curses module"
 	select BR2_PACKAGE_NCURSES
+	depends on !BR2_PACKAGE_LIBSELINUX    #circular dependency
 	help
 	  curses module for Python3.
 
diff --git a/package/python3/python3.mk b/package/python3/python3.mk
index 2532dee..4fd5d3e 100644
--- a/package/python3/python3.mk
+++ b/package/python3/python3.mk
@@ -61,7 +61,14 @@ PYTHON3_CONF_OPTS += --disable-readline
 endif
 
 ifeq ($(BR2_PACKAGE_PYTHON3_CURSES),y)
+# If libselinux is enabled, this creates a circular dependency
+# with busybox, ncurses, python, libselinux, busybox
+# For this case, we disable curses as a opt in python3.
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+PYTHON3_CONF_OPTS += --disable-curses
+else
 PYTHON3_DEPENDENCIES += ncurses
+endif
 else
 PYTHON3_CONF_OPTS += --disable-curses
 endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 3/3] python: ncurses condition for libselinux enabled
  2017-04-13  4:16 [Buildroot] [PATCH 1/3] libselinux: target python interface generation Matt Weber
  2017-04-13  4:16 ` [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled Matt Weber
@ 2017-04-13  4:16 ` Matt Weber
  2017-04-13 20:19 ` [Buildroot] [PATCH 1/3] libselinux: target python interface generation Thomas Petazzoni
  2 siblings, 0 replies; 10+ messages in thread
From: Matt Weber @ 2017-04-13  4:16 UTC (permalink / raw)
  To: buildroot

When libselinux is enabled, a circular dependency is
created.  Disable ncurses python support when libselinux
is enabled so that the circular busybox, ncurses,
python, libselinux chain is broken.

Resolves
http://autobuild.buildroot.net/results/db1/db1e6f3054092fc5576ccab8e04a3b9d74ca9a8c/

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
 package/python/Config.in | 1 +
 package/python/python.mk | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/package/python/Config.in b/package/python/Config.in
index fa83e77..47001c5 100644
--- a/package/python/Config.in
+++ b/package/python/Config.in
@@ -57,6 +57,7 @@ config BR2_PACKAGE_PYTHON_CODECSCJK
 
 config BR2_PACKAGE_PYTHON_CURSES
 	select BR2_PACKAGE_NCURSES
+	depends on !BR2_PACKAGE_LIBSELINUX    #circular dependency
 	bool "curses module"
 	help
 	  curses module for Python.
diff --git a/package/python/python.mk b/package/python/python.mk
index 7ba5e37..ae90181 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -71,7 +71,14 @@ PYTHON_CONF_OPTS += --disable-readline
 endif
 
 ifeq ($(BR2_PACKAGE_PYTHON_CURSES),y)
+# If libselinux is enabled, this creates a circular dependency
+# with busybox, ncurses, python, libselinux, busybox
+# For this case, we disable curses as a opt in python3.
+ifeq ($(BR2_PACKAGE_LIBSELINUX),y)
+PYTHON_CONF_OPTS += --disable-curses
+else
 PYTHON_DEPENDENCIES += ncurses
+endif
 else
 PYTHON_CONF_OPTS += --disable-curses
 endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/3] libselinux: target python interface generation
  2017-04-13  4:16 [Buildroot] [PATCH 1/3] libselinux: target python interface generation Matt Weber
  2017-04-13  4:16 ` [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled Matt Weber
  2017-04-13  4:16 ` [Buildroot] [PATCH 3/3] python: " Matt Weber
@ 2017-04-13 20:19 ` Thomas Petazzoni
  2 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2017-04-13 20:19 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 12 Apr 2017 23:16:12 -0500, Matt Weber wrote:
> Fixed a consistancy issue between toolchain revisions.

This sentence didn't make much sense, so I've reworded the commit log.

> Moves the swig and pywrap step seperate from the overall
> build "all".
> 
> Resolves:
> http://autobuild.buildroot.net/results/967/967b74d0ae5b4b83ea2729217b005a3e1e4514d0/
> 
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
> ---
>  package/libselinux/libselinux.mk | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)

Applied to master after doing tweaks to the commit log, and a few minor
things in the patch itself (comment and variable name).

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
  2017-04-13  4:16 ` [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled Matt Weber
@ 2017-04-13 20:27   ` Thomas Petazzoni
  2017-04-13 21:20     ` Matthew Weber
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2017-04-13 20:27 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 12 Apr 2017 23:16:13 -0500, Matt Weber wrote:
> When libselinux is enabled, a circular dependency is
> created.  Disable ncurses python support when libselinux
> is enabled so that the circular busybox, ncurses,
> python, libselinux chain is broken.
> 
> Resolves
> http://autobuild.buildroot.net/results/db1/db1e6f3054092fc5576ccab8e04a3b9d74ca9a8c/
> 
> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>

I am not sure this is the right approach to fix this issue. It feels
really weird to no longer be able to use ncurses support in Python(3)
when SELinux is enabled.

I believe the real issue is that Busybox really doesn't care at all
about the Python bindings for libselinux. So perhaps we should split
the Python bindings build/installation from libselinux into a separate
package. I think we had a similar split for another package.

It would however require some investigation to figure out if it's
possible to build just the Python bindings, using an already built and
installed libselinux.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
  2017-04-13 20:27   ` Thomas Petazzoni
@ 2017-04-13 21:20     ` Matthew Weber
  2017-04-13 21:55       ` Arnout Vandecappelle
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew Weber @ 2017-04-13 21:20 UTC (permalink / raw)
  To: buildroot

Thomas,

On Thu, Apr 13, 2017 at 3:27 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Wed, 12 Apr 2017 23:16:13 -0500, Matt Weber wrote:
>> When libselinux is enabled, a circular dependency is
>> created.  Disable ncurses python support when libselinux
>> is enabled so that the circular busybox, ncurses,
>> python, libselinux chain is broken.
>>
>> Resolves
>> http://autobuild.buildroot.net/results/db1/db1e6f3054092fc5576ccab8e04a3b9d74ca9a8c/
>>
>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
>
> I am not sure this is the right approach to fix this issue. It feels
> really weird to no longer be able to use ncurses support in Python(3)
> when SELinux is enabled.
>
> I believe the real issue is that Busybox really doesn't care at all
> about the Python bindings for libselinux. So perhaps we should split
> the Python bindings build/installation from libselinux into a separate
> package. I think we had a similar split for another package.
>
> It would however require some investigation to figure out if it's
> possible to build just the Python bindings, using an already built and
> installed libselinux.

I'll take a look.

-Matt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
  2017-04-13 21:20     ` Matthew Weber
@ 2017-04-13 21:55       ` Arnout Vandecappelle
  2017-04-14  2:29         ` Matthew Weber
  0 siblings, 1 reply; 10+ messages in thread
From: Arnout Vandecappelle @ 2017-04-13 21:55 UTC (permalink / raw)
  To: buildroot



On 13-04-17 23:20, Matthew Weber wrote:
> Thomas,
> 
> On Thu, Apr 13, 2017 at 3:27 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Hello,
>>
>> On Wed, 12 Apr 2017 23:16:13 -0500, Matt Weber wrote:
>>> When libselinux is enabled, a circular dependency is
>>> created.  Disable ncurses python support when libselinux
>>> is enabled so that the circular busybox, ncurses,
>>> python, libselinux chain is broken.
>>>
>>> Resolves
>>> http://autobuild.buildroot.net/results/db1/db1e6f3054092fc5576ccab8e04a3b9d74ca9a8c/
>>>
>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
>>
>> I am not sure this is the right approach to fix this issue. It feels
>> really weird to no longer be able to use ncurses support in Python(3)
>> when SELinux is enabled.
>>
>> I believe the real issue is that Busybox really doesn't care at all
>> about the Python bindings for libselinux. So perhaps we should split
>> the Python bindings build/installation from libselinux into a separate
>> package. I think we had a similar split for another package.
>>
>> It would however require some investigation to figure out if it's
>> possible to build just the Python bindings, using an already built and
>> installed libselinux.
> 
> I'll take a look.

 Alternatively, we could cut the ncurses->busybox dependency. That only exists
to make sure that ncurses tools overwrite busybox tools. IIRC busybox will not
overwrite existing tools, so the reverse should work as well. Or else remove
these things from the busybox config.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
  2017-04-13 21:55       ` Arnout Vandecappelle
@ 2017-04-14  2:29         ` Matthew Weber
  2017-04-14  7:24           ` Thomas Petazzoni
  0 siblings, 1 reply; 10+ messages in thread
From: Matthew Weber @ 2017-04-14  2:29 UTC (permalink / raw)
  To: buildroot

Arnout,

On Thu, Apr 13, 2017 at 4:55 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
> On 13-04-17 23:20, Matthew Weber wrote:
>> Thomas,
>>
>> On Thu, Apr 13, 2017 at 3:27 PM, Thomas Petazzoni
>> <thomas.petazzoni@free-electrons.com> wrote:
>>> Hello,
>>>
>>> On Wed, 12 Apr 2017 23:16:13 -0500, Matt Weber wrote:
>>>> When libselinux is enabled, a circular dependency is
>>>> created.  Disable ncurses python support when libselinux
>>>> is enabled so that the circular busybox, ncurses,
>>>> python, libselinux chain is broken.
>>>>
>>>> Resolves
>>>> http://autobuild.buildroot.net/results/db1/db1e6f3054092fc5576ccab8e04a3b9d74ca9a8c/
>>>>
>>>> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
>>>
>>> I am not sure this is the right approach to fix this issue. It feels
>>> really weird to no longer be able to use ncurses support in Python(3)
>>> when SELinux is enabled.
>>>
>>> I believe the real issue is that Busybox really doesn't care at all
>>> about the Python bindings for libselinux. So perhaps we should split
>>> the Python bindings build/installation from libselinux into a separate
>>> package. I think we had a similar split for another package.
>>>
>>> It would however require some investigation to figure out if it's
>>> possible to build just the Python bindings, using an already built and
>>> installed libselinux.
>>
>> I'll take a look.
>
>  Alternatively, we could cut the ncurses->busybox dependency. That only exists
> to make sure that ncurses tools overwrite busybox tools. IIRC busybox will not
> overwrite existing tools, so the reverse should work as well. Or else remove
> these things from the busybox config.
>

Good idea.  I checked busybox/ncurses and only the ncurse's
"clear"/reset tools overlap.  I'll pull something together removing
the dependency and doing a CONFIG_CLEAR/RESET disable as part of
busybox configuration tweaks.

-Matt

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
  2017-04-14  2:29         ` Matthew Weber
@ 2017-04-14  7:24           ` Thomas Petazzoni
       [not found]             ` <CANQCQpb+0UX5C8npsCXNVMOvR89mdF1jZ1jATLwTufK_633kWw@mail.gmail.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2017-04-14  7:24 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 13 Apr 2017 21:29:09 -0500, Matthew Weber wrote:

> >  Alternatively, we could cut the ncurses->busybox dependency. That only exists
> > to make sure that ncurses tools overwrite busybox tools. IIRC busybox will not
> > overwrite existing tools, so the reverse should work as well. Or else remove
> > these things from the busybox config.
> 
> Good idea.  I checked busybox/ncurses and only the ncurse's
> "clear"/reset tools overlap.  I'll pull something together removing
> the dependency and doing a CONFIG_CLEAR/RESET disable as part of
> busybox configuration tweaks.

Isn't it a bit annoying to no longer have clear/reset compiled as part
of Busybox?

Perhaps we should enable the clear/reset applets in Busybox if ncurses
is disabled, and disable the clear/reset applets in Busybox if ncurses
is enabled. This way, we keep the existing functionality, but we can
break the ncurses->busybox dependency.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled
       [not found]               ` <CANQCQpbtX9ciJhtCSuA0k5Y9tFqtOuziZqpDYbjbz1viaPu6cg@mail.gmail.com>
@ 2017-04-14 11:07                 ` Matthew Weber
  0 siblings, 0 replies; 10+ messages in thread
From: Matthew Weber @ 2017-04-14 11:07 UTC (permalink / raw)
  To: buildroot

Thomas,

On Apr 14, 2017 2:24 AM, "Thomas Petazzoni" <
thomas.petazzoni@free-electrons.com> wrote:

Hello,

On Thu, 13 Apr 2017 21:29:09 -0500, Matthew Weber wrote:

> >  Alternatively, we could cut the ncurses->busybox dependency. That only
exists
> > to make sure that ncurses tools overwrite busybox tools. IIRC busybox
will not
> > overwrite existing tools, so the reverse should work as well. Or else
remove
> > these things from the busybox config.
>
> Good idea.  I checked busybox/ncurses and only the ncurse's
> "clear"/reset tools overlap.  I'll pull something together removing
> the dependency and doing a CONFIG_CLEAR/RESET disable as part of
> busybox configuration tweaks.

Isn't it a bit annoying to no longer have clear/reset compiled as part
of Busybox?

Perhaps we should enable the clear/reset applets in Busybox if ncurses
is disabled, and disable the clear/reset applets in Busybox if ncurses
is enabled. This way, we keep the existing functionality, but we can
break the ncurses->busybox dependency.


Currently the buildroot default busybox config has the two tools which
would be missing if ncurses was disabled, enabled by default. So I think
that's ok, (not the cleanest though).



Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170414/7908d1e9/attachment.html>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-04-14 11:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13  4:16 [Buildroot] [PATCH 1/3] libselinux: target python interface generation Matt Weber
2017-04-13  4:16 ` [Buildroot] [PATCH 2/3] python3: ncurses condition for libselinux enabled Matt Weber
2017-04-13 20:27   ` Thomas Petazzoni
2017-04-13 21:20     ` Matthew Weber
2017-04-13 21:55       ` Arnout Vandecappelle
2017-04-14  2:29         ` Matthew Weber
2017-04-14  7:24           ` Thomas Petazzoni
     [not found]             ` <CANQCQpb+0UX5C8npsCXNVMOvR89mdF1jZ1jATLwTufK_633kWw@mail.gmail.com>
     [not found]               ` <CANQCQpbtX9ciJhtCSuA0k5Y9tFqtOuziZqpDYbjbz1viaPu6cg@mail.gmail.com>
2017-04-14 11:07                 ` Matthew Weber
2017-04-13  4:16 ` [Buildroot] [PATCH 3/3] python: " Matt Weber
2017-04-13 20:19 ` [Buildroot] [PATCH 1/3] libselinux: target python interface generation Thomas Petazzoni

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.