openSUSE / obs-build

OBS build script, can be used with OBS or stand alone
GNU General Public License v2.0
133 stars 188 forks source link

debiantransform “link: File exists” error w/ non tar.gz files #686

Open drmuey opened 3 years ago

drmuey commented 3 years ago

When OBS invokes debiantransfer it fails with “link: File exists” when not using a tar.gz.

.dsc has:

Version: 7.4.16-2
…
DEBTRANSFORM-RELEASE: 1
DEBTRANSFORM-TAR: ea-php74-php_7.4.16.orig.tar.bz2
DEBTRANSFORM-FILES-TAR: ea-php74-php_7.4.16-2.debian.tar.gz

OBS build failure:

[   80s] Found files matching debian.*, running debian transformer...
[   80s] release: (137.1), release (DEB) (137.1)
[   80s] ** Started: debtransform --release 137.1 //usr/src/packages/SOURCES //usr/src/packages/SOURCES/ea-php74-php_7.4.16.dsc //usr/src/packages/SOURCES.DEB
[   80s] converting //usr/src/packages/SOURCES/ea-php74-php_7.4.16.orig.tar.bz2 to ea-php74-php_7.4.16.orig.tar.gz
[   84s] Modifying dsc Version field to "7.4.16-2+137.1"
[   84s] Moving //usr/src/packages/SOURCES/ea-php74-php_7.4.16.orig.tar.gz to //usr/src/packages/SOURCES.DEB/ea-php74-php_7.4.16.orig.tar.gz
[   84s] link: File exists
[   84s] debian transforming failed.
[   84s] ### VM INTERACTION START ###
[   87s] [   81.304445] sysrq: Power Off
[   87s] [   81.305960] reboot: Power down
[   87s] ### VM INTERACTION END ###
[   87s]
[   87s] hou-1 failed "build ea-php74-php_7.4.16.dsc" at Tue Apr 27 17:50:20 UTC 2021.
[   87s]

I don’t see how /usr/src/packages/SOURCES.DEB/ea-php74-php_7.4.16.orig.tar.gz could exist already 🤔 (like the conversion from bz2 to gz made it or it was left over from a previous build neither of which seem right).

Switch to a tar.gz works fine. That is also odd because the different code path still does link but the first argument is different. If the first arg was bad I'd expect file-does-not-exist. So it seems that something in the converting …orig.tar.bz2 to …orig.tar.gz is creating the tar in /usr/src/packages/SOURCES.DEB/ and the only way that looks to be possible is if the CWD is /usr/src/packages/SOURCES.DEB/ 🤔

crass commented 2 years ago

I'm seeing this also. A work around is to use the recompress service to recompress to gz.