rpm-software-management / rpm

The RPM package manager
http://rpm.org
Other
506 stars 366 forks source link

4.15 Regression: #728

Closed ignatenkobrain closed 5 years ago

ignatenkobrain commented 5 years ago

76c429c3178c965c6517629957a633768132904c is the first bad commit

commit 76c429c3178c965c6517629957a633768132904c
Author: Andreas Scherer <andreas_github@freenet.de>
Date:   Mon Nov 26 15:50:15 2018 +0200

    Handle %setup archive unpack exit code centrally and consistently

    Previously the exit code handling was missing from uncompressed tar-case.

 build/parsePrep.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

Before

⋊> ~/t/p/rust-heck on master ⨯ ~/Projects/upstream/rpm/rpmbuild -ba ./rust-heck.spec -D "_sourcedir $PWD"                                                                   17:05:06
error: Bad source: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory

After

⋊> ~/t/p/rust-heck on master ⨯ ~/Projects/upstream/rpm/rpmbuild -ba ./rust-heck.spec -D "_sourcedir $PWD"                                                                   17:05:42
error: Bad source: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.KIKFls
+ umask 022
+ cd /home/brain/rpmbuild/BUILD
+ cd /home/brain/rpmbuild/BUILD
+ rm -rf heck-0.3.1x1
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd heck-0.3.1x1
/var/tmp/rpm-tmp.KIKFls: line 38: cd: heck-0.3.1x1: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.KIKFls (%prep)

RPM build errors:
    Bad source: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory
    Bad exit status from /var/tmp/rpm-tmp.KIKFls (%prep)
ignatenkobrain commented 5 years ago

/cc @ascherer FYI

ignatenkobrain commented 5 years ago

Also, @pmatilai change made it worse, it continues to execute other sections even if %prep failed.

18e8f4e9b2dd170d090843adf5b5084658d68cf7

⋊> ~/t/p/rust-heck on master ⨯ ~/Projects/upstream/rpm/rpmbuild -ba ./rust-heck.spec -D "_sourcedir $PWD"                                                                   17:23:48
error: Bad source: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.rzlT5p
+ umask 022
+ cd /home/brain/rpmbuild/BUILD
+ cd /home/brain/rpmbuild/BUILD
+ rm -rf heck-0.3.1x1
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd heck-0.3.1x1
/var/tmp/rpm-tmp.rzlT5p: line 38: cd: heck-0.3.1x1: No such file or directory
error: /bin/sh failed: 100
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.p6LTus
+ umask 022
+ cd /home/brain/rpmbuild/BUILD
+ cd heck-0.3.1x1
/var/tmp/rpm-tmp.p6LTus: line 30: cd: heck-0.3.1x1: No such file or directory
error: /bin/sh failed: 100
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.1kzKtp
+ umask 022
+ cd /home/brain/rpmbuild/BUILD
+ '[' /home/brain/rpmbuild/BUILDROOT/rust-heck-0.3.1x1-1.fc31.x86_64 '!=' / ']'
+ rm -rf /home/brain/rpmbuild/BUILDROOT/rust-heck-0.3.1x1-1.fc31.x86_64
++ dirname /home/brain/rpmbuild/BUILDROOT/rust-heck-0.3.1x1-1.fc31.x86_64
+ mkdir -p /home/brain/rpmbuild/BUILDROOT
+ mkdir /home/brain/rpmbuild/BUILDROOT/rust-heck-0.3.1x1-1.fc31.x86_64
+ cd heck-0.3.1x1
/var/tmp/rpm-tmp.1kzKtp: line 34: cd: heck-0.3.1x1: No such file or directory
error: /bin/sh failed: 100
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.e4WuKq
+ umask 022
+ cd /home/brain/rpmbuild/BUILD
+ cd heck-0.3.1x1
/var/tmp/rpm-tmp.e4WuKq: line 30: cd: heck-0.3.1x1: No such file or directory
error: /bin/sh failed: 100
error: Bad file: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory

RPM build errors:
    Bad source: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory
    /bin/sh failed: 100
    /bin/sh failed: 100
    /bin/sh failed: 100
    /bin/sh failed: 100
    Bad file: /home/brain/tmp/playground/rust-heck/heck-0.3.1x1.crate: No such file or directory
ignatenkobrain commented 5 years ago

Looking at original cause of error 100, it seems to be here:

D:  waitpid(31325) rc 31325 status 100
error: /bin/sh failed: 100
ignatenkobrain commented 5 years ago
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 5f3f56872..6e88c9359 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -446,6 +446,7 @@ int rpmfcExec(ARGV_const_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp,
                       failnonzero, buildRoot, dup);
     if (ec) {
        sb = freeStringBuf(sb);
+       goto exit;
     }

     if (sb_stdoutp != NULL) {
@@ -453,8 +454,6 @@ int rpmfcExec(ARGV_const_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp,
        sb = NULL;      /* XXX don't free */
     }

-    ec = 0;
-
 exit:
     freeStringBuf(sb);
     argvFree(xav);

With patch above, I see following:

ignatenkobrain commented 5 years ago

2 separate patchsets has been sent for this issue (they are somewhat unrelated): #729 #730