packit / dist-git-to-source-git

Converting dist-git to source-git
MIT License
4 stars 9 forks source link

mock build fail: can't find file to patch at input line XX #85

Open dhodovsk opened 3 years ago

dhodovsk commented 3 years ago

Packages:

Build output (tail)

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.OlRiSI
+ umask 022
+ cd /builddir/build/BUILD
+ cd /builddir/build/BUILD
+ rm -rf meanwhile-1.1.0
+ /usr/bin/gzip -dc /builddir/build/SOURCES/meanwhile-1.1.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd meanwhile-1.1.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ echo 'Patch #0 (meanwhile-crash.patch):'
Patch #0 (meanwhile-crash.patch):
+ /usr/bin/patch --no-backup-if-mismatch -p0 -b --suffix .crash --fuzz=0
can't find file to patch at input line 18
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From e0b26a249f36fbbf07e7c6e378a08627557c7c30 Mon Sep 17 00:00:00 2001
|From: Packit <packit>
|Date: Thu, 24 Sep 2020 11:44:09 +0000
|Subject: [PATCH 1/5] Apply patch meanwhile-crash.patch
|
|patch_name: meanwhile-crash.patch
|present_in_specfile: true
|---
| src/st_list.c       |   6 +-
| src/st_list.c.crash | 668 ++++++++++++++++++++++++++++++++++++++++++++
| 2 files changed, 672 insertions(+), 2 deletions(-)
| create mode 100644 src/st_list.c.crash
|
|diff --git a/src/st_list.c b/src/st_list.c
|index 949696a..c2809be 100644
|--- a/src/st_list.c
|+++ b/src/st_list.c
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
patching file b/src/st_list.c.crash

RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.OlRiSI (%prep)
    Bad exit status from /var/tmp/rpm-tmp.OlRiSI (%prep)
Finish: rpmbuild meanwhile-1.1.0-24.g88dce3a1.fc30.src.rpm
Finish: build phase for meanwhile-1.1.0-24.g88dce3a1.fc30.src.rpm
ERROR: Exception(/tmp/playground/meanwhile-1.1.0-24.g88dce3a1.fc30.src.rpm) Config(centos-stream-x86_64) 0 minutes 17 seconds
INFO: Results and/or logs in: /var/lib/mock/centos-stream-x86_64/result
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M 0c158696b54c4747a4b14141db1d3c3d -D /var/lib/mock/centos-stream-x86_64/root -a --capability=cap_ipc_lock --bind=/tmp/mock-resolv.lwlf7boc:/etc/resolv.conf --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=en_US.UTF-8 -u mockbuild bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/meanwhile.spec
TomasTomecek commented 3 years ago

Okay, I know what the problem is.

🤦

The first patch for "meanwhile" is applied with -p0:

--- src/st_list.c.orig  2008-08-27 11:32:47.000000000 +1000
+++ src/st_list.c   2008-08-27 10:24:34.000000000 +1000

The rest are p1

--- a/src/srvc_ft.c Tue Nov 06 11:46:26 2007 +0100
+++ b/src/srvc_ft.c Thu Nov 08 18:58:33 2007 +0100

the leading "a/" and "b" are the difference

When packit creates patches with git-format it does it with -p1 all the time. So... 🤦🤦🤦

The easiest solution here is to try the other -pNUM if the firsts one fails.

Edit: my bad, this is about build part, not creation: so we need to explicitly support the p0/p1 formats with d2s and packit.

dhodovsk commented 3 years ago

For most of the packages (51 out of 85), the issue has been fixed and the repos were created. For pkgs, some new issues appeared, but it seems for some (mtx, openoffice.org-dict-cs_CZ, openslp, pcre,xdelta, bacula), this error remains (but I am not 100% sure)

TomasTomecek commented 3 years ago

will take a look on the rest