Source: debhelper
Version: 11.1.6
Severity: normal

Dear Maintainer,

When running dpkg-buildpackage in a directory that is the root of a
filesystem (in my case, I'm building inside a docker container, and the
source is a volume mount), I get an error:

        Renaming paasta-tools-dbgsym_0.70.5~bionic1_amd64.deb to 
paasta-tools-dbgsym_0.70.5~bionic1_amd64.ddeb
dh_builddeb: mv 
debian/.debhelper/scratch-space/build-paasta-tools/paasta-tools-dbgsym_0.70.5\~bionic1_amd64.deb
 ../paasta-tools-dbgsym_0.70.5\~bionic1_amd64.ddeb: Invalid cross-device link
dh_builddeb: Aborting due to earlier error

I think this is due to the commit
79da6af50c03f4a2508b1a6c0336d86470e7dd58 ("Avoid forking for most
renames"), which replaces a call to the `mv` command (which handles
cross-filesystem moves) with a call to the
`rename` syscall (which does not, and returns EXDEV).

It appears that a similar issue came up long ago with
update-alternatives in bug 42559; the resolution there was to call
rename(2) and then fall back to mv(1) if rename fails. This logic remains
today in update-alternatives.c.


-- System Information:
Debian Release: buster/sid
  APT prefers bionic-updates
  APT policy: (500, 'bionic-updates'), (500, 'bionic-security'), (500, 'bionic')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-75-generic (SMP w/32 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C 
(charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Reply via email to