Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dhodovsk opened this issue Sep 24, 2020 · 3 comments
Open

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

dhodovsk opened this issue Sep 24, 2020 · 3 comments

Comments

@dhodovsk
Copy link
Contributor

dhodovsk commented Sep 24, 2020

Packages:

  • c8: java-atk-wrapper, jimtcl, jq, ladspa, latexmk, libabigail, libcgroup, libdnet, LibRaw, libtheora, lzop, mcpp, meanwhile, mingw-gnutls, mingw-headers, mingw-libgcrypt, mingw-libtheora, mingw-libxml2, mingw-sqlite, mingw-w64-tools, mtx, neon, openoffice.org-dict-cs_CZ, openslp, pcre, pcsc-lite, pcsc-lite-ccid, perl-Algorithm-Diff, perl-B-Hooks-EndOfScope, perl-Class-Accessor-Chained, perl-common-sense, perl-DateTime-Set, perl-File-MMagic, perl-IO-Socket-SSL, perl-List-MoreUtils-XS, perl-Mail-SPF, perl-Perl-OSType, perl-Readonly, perl-Tk, perl-Types-Serialiser, perl-UNIVERSAL-require, perltidy, python-cpio, pnm2ppa, python-iniparse, python-unittest2, recode, redhat-lsb, sassc, sblim-cmpi-base, SDL, SFML, squashfs-tools, texlive, tokyocabinet, torque, xdelta, xhtml1-dtds, arpwatch, bacula, boost, cdparanoia, cdrdao, compat-sap-c++-9, crda, dvd+rw-tools, eigen3, expect, fabtests, java-1.8.0-openjdk, check, compat-libgfortran-48, nspr, imake, python-pip, python-ply, rhel-system-roles-sap, tzdata, xorg-x11-server-utils, freetype, gcc, mozjs52, hunspell-en, hunspell-it, hyperv-daemons

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
Copy link
Member

TomasTomecek commented Sep 25, 2020

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.

TomasTomecek added a commit to TomasTomecek/packit that referenced this issue Sep 25, 2020
some patches in dist-git are applied with -p0 which implies --no-prefix
option for format-patch

this commit enables that: packit is able generate a patch file with
format-patch without leading a/ and b/ in the patch diff

by default format-patch generates patches for -p1 application

🤦‍♂️

packit/dist-git-to-source-git#85 (comment)

Signed-off-by: Tomas Tomecek <[email protected]>
TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Sep 25, 2020
TomasTomecek added a commit to TomasTomecek/packit that referenced this issue Sep 25, 2020
some patches in dist-git are applied with -p0 which implies --no-prefix
option for format-patch

this commit enables that: packit is able generate a patch file with
format-patch without leading a/ and b/ in the patch diff

by default format-patch generates patches for -p1 application

🤦‍♂️

packit/dist-git-to-source-git#85 (comment)

Signed-off-by: Tomas Tomecek <[email protected]>
TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Sep 25, 2020
TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Sep 29, 2020
TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Sep 29, 2020
TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Sep 29, 2020
%setup -T means that rpm should not unpack source0 - if we turn %setup
into %autosetup thus getting a git repo after running it, we'll get an
empty git repo - bad. These cases usually unpack/construct the source
tree in %prep in a custom way. It would result into first patch
containing the whole source tree - we don't want that.

With this change, we'll create the git repo before applying first patch
which should match the initial source tree.

I hope it's clear we are getting into depths of odd packaging

Related packit#85

Signed-off-by: Tomas Tomecek <[email protected]>
TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Oct 1, 2020
%setup -T means that rpm should not unpack source0 - if we turn %setup
into %autosetup thus getting a git repo after running it, we'll get an
empty git repo - bad. These cases usually unpack/construct the source
tree in %prep in a custom way. It would result into first patch
containing the whole source tree - we don't want that.

With this change, we'll create the git repo before applying first patch
which should match the initial source tree.

I hope it's clear we are getting into depths of odd packaging

Related packit#85

Signed-off-by: Tomas Tomecek <[email protected]>
@dhodovsk
Copy link
Contributor Author

dhodovsk commented Oct 1, 2020

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
Copy link
Member

will take a look on the rest

TomasTomecek added a commit to TomasTomecek/dist-git-to-source-git that referenced this issue Oct 8, 2020
%setup -T means that rpm should not unpack source0 - if we turn %setup
into %autosetup thus getting a git repo after running it, we'll get an
empty git repo - bad. These cases usually unpack/construct the source
tree in %prep in a custom way. It would result into first patch
containing the whole source tree - we don't want that.

With this change, we'll create the git repo before applying first patch
which should match the initial source tree.

I hope it's clear we are getting into depths of odd packaging

Related packit#85

Signed-off-by: Tomas Tomecek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants