[PATCH] meson: src: Fix DESTDIR handling while creating dirs

Pavel Hrdina phrdina at redhat.com
Wed Sep 9 21:21:36 UTC 2020


On Wed, Sep 09, 2020 at 06:06:19PM +0200, Michal Privoznik wrote:
> On 9/9/20 5:47 PM, Pavel Hrdina wrote:
> > On Wed, Sep 09, 2020 at 05:06:19PM +0200, Jan Kiszka wrote:
> > > On 09.09.20 16:38, Erik Skultety wrote:
> > > > On Mon, Sep 07, 2020 at 11:25:34PM +0200, Jan Kiszka wrote:
> > > > > From: Jan Kiszka <jan.kiszka at siemens.com>
> > > > > 
> > > > > If the target path contains a link with an absolute path (e.g.
> > > > > /var/run -> /run), makedirs will target the wrong location. Resolve the
> > > > > path first, then append DESTDIR again if needed.
> > > > 
> > > > Can you elaborate on this? os.makedirs should follow the symlinks before
> > > > actually creating the directory hierarchy, so I'm failing to see the problem
> > > > this patch is trying to address.
> > > > 
> > > 
> > > mkdir -p /my/destdir/var /my/destdir/run
> > > ln -s /run /my/destdir/var/run
> > > meson build --prefix=/usr
> > > DESTDIR=/my/destdir ninja -C build install
> > > 
> > > -> PermissionError: [Errno 13] Permission denied:
> > > '/my/destdir/var/run/libvirt'
> > 
> > I would say don't do that as that's not purpose of DESTDIR and running
> > libvirt from the DESTDIR installation will not work as it will not find
> > all the required files.
> 
> This is exactly what gentoo portage does, btw. And I bet some other package
> tools too.

RPM is doing the same and everything works correctly, that's why I wrote
the statement above. It breaks only if the DESTDIR is not empty
directory where there are some links outside of DESTDIR. This use-case
would not work with our previous autotools build system as well.

So I don't understand what you meant by your reply.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200909/fbac9b94/attachment-0001.sig>


More information about the libvir-list mailing list