Skip to contentSkip to conversation

libselinux: Fix parallel build with swig python

PATCH Applied Jason Zaman 2 participants 2 messages Oct 10, 2015 – Oct 13, 2015 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: Fix parallel build with swig python

Commit 966855d9a1f7b758 added selinux.py as a requirement for pywrap. This file is generated during the swig step but there is no explicit rule in the Makefile so parallel build fails. This adds another rule so the ordering is correct.

jason@meriadoc ~/code/gentoo/selinux/libselinux $ make -j3 pywrap
.... SNIP ....
sed -e 's/@VERSION@/2.4/; s:@prefix@:/usr:; s:@libdir@:lib:; s:@includedir@:/usr/include:' < libselinux.pc.in > libselinux.pc bash exception.sh > selinuxswig_python_exception.i
make[1]: *** No rule to make target 'selinux.py', needed by 'pywrap'. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/jason/code/gentoo/selinux/libselinux/src'
Makefile:36: recipe for target 'pywrap' failed
make: *** [pywrap] Error 2

---
 libselinux/src/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
libselinux/src/Makefile +5 -2
index a81acc7..feab561 100644
@@ -29,11 +29,12 @@ LIBPC=libselinux.pc
 SWIGIF= selinuxswig_python.i selinuxswig_python_exception.i
 SWIGRUBYIF= selinuxswig_ruby.i
 SWIGCOUT= selinuxswig_wrap.c
+SWIGPYOUT= selinux.py
 SWIGRUBYCOUT= selinuxswig_ruby_wrap.c
 SWIGLOBJ:= $(patsubst %.c,$(PYPREFIX)%.lo,$(SWIGCOUT))
 SWIGRUBYLOBJ:= $(patsubst %.c,%.lo,$(SWIGRUBYCOUT)) 
 SWIGSO=$(PYPREFIX)_selinux.so
-SWIGFILES=$(SWIGSO) selinux.py
+SWIGFILES=$(SWIGSO) $(SWIGPYOUT)
 SWIGRUBYSO=$(RUBYPREFIX)_selinux.so
 LIBSO=$(TARGET).$(LIBVERSION)
 AUDIT2WHYLOBJ=$(PYPREFIX)audit2why.lo
@@ -135,6 +136,8 @@ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
 $(SWIGCOUT): $(SWIGIF)
 	$(SWIG) $<
 
+$(SWIGPYOUT): $(SWIGCOUT)
+
 $(SWIGRUBYCOUT): $(SWIGRUBYIF)
 	$(SWIGRUBY) $<
 
@@ -154,7 +157,7 @@ install-pywrap: pywrap
 	test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux
 	install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/selinux/_selinux.so
 	install -m 755 $(AUDIT2WHYSO) $(PYLIBDIR)/site-packages/selinux/audit2why.so
-	install -m 644  selinux.py $(PYLIBDIR)/site-packages/selinux/__init__.py
+	install -m 644 $(SWIGPYOUT) $(PYLIBDIR)/site-packages/selinux/__init__.py
 
 install-rubywrap: rubywrap
 	test -d $(RUBYINSTALL) || install -m 755 -d $(RUBYINSTALL) 
Signature · 1 line
2.4.9
#1 lore raw
Quoted 15 lines · Jason Zaman

Commit 966855d9a1f7b758 added selinux.py as a requirement for pywrap. This file is generated during the swig step but there is no explicit rule in the Makefile so parallel build fails. This adds another rule so the ordering is correct.

jason@meriadoc ~/code/gentoo/selinux/libselinux $ make -j3 pywrap
.... SNIP ....
sed -e 's/@VERSION@/2.4/; s:@prefix@:/usr:; s:@libdir@:lib:; s:@includedir@:/usr/include:' < libselinux.pc.in > libselinux.pc bash exception.sh > selinuxswig_python_exception.i
make[1]: *** No rule to make target 'selinux.py', needed by 'pywrap'. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/jason/code/gentoo/selinux/libselinux/src'
Makefile:36: recipe for target 'pywrap' failed
make: *** [pywrap] Error 2

Quoted 1 line

Thanks, applied.

Quoted 41 lines
---
  libselinux/src/Makefile | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
libselinux/src/Makefile +5 -2
index a81acc7..feab561 100644
@@ -29,11 +29,12 @@ LIBPC=libselinux.pc
  SWIGIF= selinuxswig_python.i selinuxswig_python_exception.i
  SWIGRUBYIF= selinuxswig_ruby.i
  SWIGCOUT= selinuxswig_wrap.c
+SWIGPYOUT= selinux.py
  SWIGRUBYCOUT= selinuxswig_ruby_wrap.c
  SWIGLOBJ:= $(patsubst %.c,$(PYPREFIX)%.lo,$(SWIGCOUT))
  SWIGRUBYLOBJ:= $(patsubst %.c,%.lo,$(SWIGRUBYCOUT))
  SWIGSO=$(PYPREFIX)_selinux.so
-SWIGFILES=$(SWIGSO) selinux.py
+SWIGFILES=$(SWIGSO) $(SWIGPYOUT)
  SWIGRUBYSO=$(RUBYPREFIX)_selinux.so
  LIBSO=$(TARGET).$(LIBVERSION)
  AUDIT2WHYLOBJ=$(PYPREFIX)audit2why.lo
@@ -135,6 +136,8 @@ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
  $(SWIGCOUT): $(SWIGIF)
  	$(SWIG) $<
 
+$(SWIGPYOUT): $(SWIGCOUT)
+
  $(SWIGRUBYCOUT): $(SWIGRUBYIF)
  	$(SWIGRUBY) $<
 
@@ -154,7 +157,7 @@ install-pywrap: pywrap
  	test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux
  	install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/selinux/_selinux.so
  	install -m 755 $(AUDIT2WHYSO) $(PYLIBDIR)/site-packages/selinux/audit2why.so
-	install -m 644  selinux.py $(PYLIBDIR)/site-packages/selinux/__init__.py
+	install -m 644 $(SWIGPYOUT) $(PYLIBDIR)/site-packages/selinux/__init__.py
 
  install-rubywrap: rubywrap
  	test -d $(RUBYINSTALL) || install -m 755 -d $(RUBYINSTALL)