Subject: Re: [PATCH] libselinux: Fix parallel build with swig python To: Jason Zaman , selinux@tycho.nsa.gov References: <1444468191-15852-1-git-send-email-jason@perfinion.com> From: Stephen Smalley Message-ID: <561D6A7D.4050001@tycho.nsa.gov> Date: Tue, 13 Oct 2015 16:33:01 -0400 MIME-Version: 1.0 In-Reply-To: <1444468191-15852-1-git-send-email-jason@perfinion.com> Content-Type: text/plain; charset=windows-1252; format=flowed List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: On 10/10/2015 05:09 AM, Jason Zaman wrote: > 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 > > Signed-off-by: Jason Zaman Thanks, applied. > --- > libselinux/src/Makefile | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile > index a81acc7..feab561 100644 > --- a/libselinux/src/Makefile > +++ b/libselinux/src/Makefile > @@ -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) >