[libvirt] [PATCH] build: avoid corrupting / in RHEL 5

I noticed this while building from libvirt.git on RHEL 5.6: Generating internals/command.html.tmp mkdir: cannot create directory `/internals': Permission denied If I had been building as root instead, this pollutes /. Older autoconf lacks $(builddir), but it is rigorously equal to '.' in newer autoconf, so we could use '$(MKDIR_P) internals' instead. However, since internals/command.html is part of the tarball, we _already_ build it in $(srcdir), not $(builddir) during VPATH builds, so the mkdir is wasted effort! * docs/Makefile.am (internals/%.html.tmp): Drop unused mkdir. --- docs/Makefile.am | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index a8024b3..a98ced0 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -127,7 +127,6 @@ hvsupport.html.in: $(srcdir)/hvsupport.pl $(srcdir)/../src/libvirt_public.syms \ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in @if [ -x $(XSLTPROC) ] ; then \ echo "Generating $@"; \ - $(MKDIR_P) "$(builddir)/internals"; \ name=`echo $@ | sed -e 's/.tmp//'`; \ $(XSLTPROC) --stringparam pagename $$name --nonet --html \ $(top_srcdir)/docs/subsite.xsl $< > $@ \ -- 1.7.4.4

On Wed, Jun 01, 2011 at 11:52:00 -0600, Eric Blake wrote:
I noticed this while building from libvirt.git on RHEL 5.6:
Generating internals/command.html.tmp mkdir: cannot create directory `/internals': Permission denied
If I had been building as root instead, this pollutes /.
Older autoconf lacks $(builddir), but it is rigorously equal to '.' in newer autoconf, so we could use '$(MKDIR_P) internals' instead.
However, since internals/command.html is part of the tarball, we _already_ build it in $(srcdir), not $(builddir) during VPATH builds, so the mkdir is wasted effort!
* docs/Makefile.am (internals/%.html.tmp): Drop unused mkdir. --- docs/Makefile.am | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
ACK Jirka

On 06/01/2011 02:30 PM, Jiri Denemark wrote:
On Wed, Jun 01, 2011 at 11:52:00 -0600, Eric Blake wrote:
I noticed this while building from libvirt.git on RHEL 5.6:
Generating internals/command.html.tmp mkdir: cannot create directory `/internals': Permission denied
If I had been building as root instead, this pollutes /.
Older autoconf lacks $(builddir), but it is rigorously equal to '.' in newer autoconf, so we could use '$(MKDIR_P) internals' instead.
However, since internals/command.html is part of the tarball, we _already_ build it in $(srcdir), not $(builddir) during VPATH builds, so the mkdir is wasted effort!
* docs/Makefile.am (internals/%.html.tmp): Drop unused mkdir. --- docs/Makefile.am | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
ACK
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Wed, Jun 01, 2011 at 11:52:00AM -0600, Eric Blake wrote:
I noticed this while building from libvirt.git on RHEL 5.6:
Generating internals/command.html.tmp mkdir: cannot create directory `/internals': Permission denied
If I had been building as root instead, this pollutes /.
Older autoconf lacks $(builddir), but it is rigorously equal to '.' in newer autoconf, so we could use '$(MKDIR_P) internals' instead.
However, since internals/command.html is part of the tarball, we _already_ build it in $(srcdir), not $(builddir) during VPATH builds, so the mkdir is wasted effort!
* docs/Makefile.am (internals/%.html.tmp): Drop unused mkdir. --- docs/Makefile.am | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am index a8024b3..a98ced0 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -127,7 +127,6 @@ hvsupport.html.in: $(srcdir)/hvsupport.pl $(srcdir)/../src/libvirt_public.syms \ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in @if [ -x $(XSLTPROC) ] ; then \ echo "Generating $@"; \ - $(MKDIR_P) "$(builddir)/internals"; \ name=`echo $@ | sed -e 's/.tmp//'`; \ $(XSLTPROC) --stringparam pagename $$name --nonet --html \ $(top_srcdir)/docs/subsite.xsl $< > $@ \
I've seen a strange build error from autobuild.sh which I'm thinking may be related to this patch ... Generating drvvmware.html.tmp Generating firewall.html.tmp Generating bindings.html.tmp if [ -f todo.cfg ]; then \ echo "Generating todo.html.in"; \ perl ../../docs/../../docs/todo.pl > todo.html.in \ || { rm todo.html.in && exit 1; }; \ else \ echo "Stubbing todo.html.in"; \ echo "<html><body><h1>Todo list</h1></body></html>" > todo.html.in ; \ fi Generating drivers.html.tmp Stubbing todo.html.in Generating internals/locking.html.tmp Generating internals/command.html.tmp GEN ../../docs/libvirt-api.xml /bin/sh: line 3: internals/locking.html.tmp: No such file or directory /bin/sh: line 3: internals/command.html.tmp: No such file or directory Validating architecture.html Validating contact.html rm: cannot remove `internals/command.html.tmp': No such file or directory make[2]: *** [internals/command.html.tmp] Error 1 make[2]: *** Waiting for unfinished jobs.... rm: cannot remove `internals/locking.html.tmp': No such file or directory make[2]: *** [internals/locking.html.tmp] Error 1 Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 06/02/2011 05:26 AM, Daniel P. Berrange wrote:
I've seen a strange build error from autobuild.sh which I'm thinking may be related to this patch
Generating drivers.html.tmp Stubbing todo.html.in Generating internals/locking.html.tmp Generating internals/command.html.tmp
There's no locking.html.in yet (except in your patch series), so this points to a bug in at least the VPATH rules for your conversion from locking.html.in to locking.html. You need to generate locking.html in $(srcdir), since it will be distributed pre-built as part of the tarball.
GEN ../../docs/libvirt-api.xml /bin/sh: line 3: internals/locking.html.tmp: No such file or directory /bin/sh: line 3: internals/command.html.tmp: No such file or directory Validating architecture.html Validating contact.html rm: cannot remove `internals/command.html.tmp': No such file or directory make[2]: *** [internals/command.html.tmp] Error 1 make[2]: *** Waiting for unfinished jobs....
Sometimes, it helps to use make -j1 to ensure that interleaved output from parallel rules isn't causing further confusion, although I don't know if it's easy to do that as an autobuild.sh parameter or if it requires an actual script tweak. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Thu, Jun 02, 2011 at 05:48:39AM -0600, Eric Blake wrote:
On 06/02/2011 05:26 AM, Daniel P. Berrange wrote:
I've seen a strange build error from autobuild.sh which I'm thinking may be related to this patch
Generating drivers.html.tmp Stubbing todo.html.in Generating internals/locking.html.tmp Generating internals/command.html.tmp
There's no locking.html.in yet (except in your patch series), so this points to a bug in at least the VPATH rules for your conversion from locking.html.in to locking.html.
You need to generate locking.html in $(srcdir), since it will be distributed pre-built as part of the tarball.
There's no special makefile rules for locking.html - all the HTML stuff is wildcarded. The same error hits command.html here too.
GEN ../../docs/libvirt-api.xml /bin/sh: line 3: internals/locking.html.tmp: No such file or directory /bin/sh: line 3: internals/command.html.tmp: No such file or directory Validating architecture.html Validating contact.html rm: cannot remove `internals/command.html.tmp': No such file or directory make[2]: *** [internals/command.html.tmp] Error 1 make[2]: *** Waiting for unfinished jobs....
Sometimes, it helps to use make -j1 to ensure that interleaved output from parallel rules isn't causing further confusion, although I don't know if it's easy to do that as an autobuild.sh parameter or if it requires an actual script tweak.
Yep, you can already just run MAKEFLAGS="-j1" ./autobuild.sh Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 06/02/2011 06:35 AM, Daniel P. Berrange wrote:
On Thu, Jun 02, 2011 at 05:48:39AM -0600, Eric Blake wrote:
On 06/02/2011 05:26 AM, Daniel P. Berrange wrote:
I've seen a strange build error from autobuild.sh which I'm thinking may be related to this patch
Generating drivers.html.tmp Stubbing todo.html.in Generating internals/locking.html.tmp Generating internals/command.html.tmp
There's no locking.html.in yet (except in your patch series), so this points to a bug in at least the VPATH rules for your conversion from locking.html.in to locking.html.
You need to generate locking.html in $(srcdir), since it will be distributed pre-built as part of the tarball.
There's no special makefile rules for locking.html - all the HTML stuff is wildcarded. The same error hits command.html here too.
Ah, I see the problem now. locking.html is generated in $(srcdir), but it goes via an intermediate locking.html.tmp, which is indeed generated in $(builddir). I didn't catch it earlier, because I was testing an in-tree build (where the builddir happens to already exist, since it is also the srcdir). I'll push the obvious fix (restoring the MKDIR_P, but without the problematic $(builddir) that RHEL 5 didn't like). -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark