ValueError: dst_dir must be absolute
glimchb opened this issue · 6 comments
On Fedora33 when building rpm like this:
rpmbuild --nodeps --build-in-place -ba .build/nvme-stas.spec
I get this error during %install
stage :
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.hQKIyt
+ umask 022
+ cd /root
+ '[' .build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64 '!=' / ']'
+ rm -rf .build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64
++ dirname .build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64
+ mkdir -p .build/rpm-pkg/BUILDROOT
+ mkdir .build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64
+ DESTDIR=.build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64
+ /usr/bin/meson install -C noarch-redhat-linux-gnu --no-rebuild
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/mesonbuild/mesonmain.py", line 228, in run
return options.run_func(options)
File "/usr/lib/python3.9/site-packages/mesonbuild/minstall.py", line 720, in run
installer.do_install(datafilename)
File "/usr/lib/python3.9/site-packages/mesonbuild/minstall.py", line 511, in do_install
self.install_subdirs(d, dm, destdir, fullprefix) # Must be first, because it needs to delete the old subtree.
File "/usr/lib/python3.9/site-packages/mesonbuild/minstall.py", line 540, in install_subdirs
self.do_copydir(d, i.path, full_dst_dir, i.exclude, i.install_mode, dm)
File "/usr/lib/python3.9/site-packages/mesonbuild/minstall.py", line 445, in do_copydir
raise ValueError(f'dst_dir must be absolute, got {dst_dir}')
ValueError: dst_dir must be absolute, got .build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64/etc/stas
Installing subdir /root/etc/stas to .build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64/etc/stas
error: Bad exit status from /var/tmp/rpm-tmp.hQKIyt (%install)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.hQKIyt (%install)
make: *** [Makefile:68: rpm] Error 1
looks like this should be absolute?
+ DESTDIR=.build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64
reading https://docs.fedoraproject.org/en-US/packaging-guidelines/Meson ...
F33 is way outdated, I haven't seen such issue when packaging nvme-stas
on F36.
See also: https://bugzilla.redhat.com/show_bug.cgi?id=2061730
and the related build log: https://download.copr.fedorainfracloud.org/results/@storage/udisks-daily/fedora-rawhide-x86_64/03637253-nvme-stas/build.log.gz
@tbzatek in the build log above notice
+ DESTDIR=/builddir/build/BUILDROOT/nvme-stas-1.0~rc3-1.fc37.x86_64
vs
+ DESTDIR=.build/rpm-pkg/BUILDROOT/nvme-stas-1.0-1.fc33.x86_64
I will try on F36 now, just curious where it comes from ?
Could be related to meson rpm macros https://docs.fedoraproject.org/en-US/packaging-guidelines/Meson/ ?
Yes, I guess it's about meson rpm macros. Probably an expansion of %meson_install
.
Recent versions of Meson actually make the potentially surprising decision to convert non-absolute DESTDIR into an absolute path by assuming it is relative to the build directory.
This is particularly surprising when you use meson install -C <builddir>
.
I would NEVER rely on non-absolute paths for this.