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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 09, 2020 at 05:53:06PM +0200, Jan Kiszka wrote:
> 
> 
> Am 9. September 2020 17:47:59 MESZ schrieb Pavel Hrdina <phrdina@xxxxxxxxxx>:
> >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@xxxxxxxxxxx>
> >> >>
> >> >> 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.
> >
> >What is you use-case or what are you trying to achieve?
> 
> https://www.gnu.org/prep/standards/html_node/DESTDIR.html
> 
> It's exactly for what I'm using it: installing the package into a rootfs dir that is alien to the builder. It will become the rootfs on the target only.

So if I understand it correctly you set DESTDIR to the path to that
rootfs in order to install it there.

I'm not sure if that is the desired usage of DESTDIR. My understanding
is that it should be empty directory where package systems will install
the project in order to create a package out of it. Or for users to
inspect what is installed by the project.

Looking at our old autoconf build system it would fail with the same
permission denied error as we were using this in Makefile:

    $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/libxl"

Based on that I'm not sure if we want to fix it.

> PS: Is it normal with meson that one has to implement such basic stuff at project level?

I would not say it's normal but in the current state of Meson it is
probably expected to have some features missing as it's a fairly young
project and they are still introducing a lot of features.

Pavel

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux