Closed ignatenkobrain closed 5 years ago
/cc @ascherer FYI
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
Looking at original cause of error 100
, it seems to be here:
D: waitpid(31325) rc 31325 status 100
error: /bin/sh failed: 100
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:
rpmlog(RPMLOG_ERR, _("%s failed: %x\n"), argv[0], status);
is not showing return code, it returns status without WEXITSTATUS, so it is not helpful to user.build/build.c
, rpmlog(RPMLOG_ERR, _("Exec of %s failed (%s): %s\n")
uses strerror(errno)
, but there is nothing what sets errno at that time because process went much further.%__build_post
does not actually getting executed if somebody runs yes &; exit 1
, so it is not getting killed2 separate patchsets has been sent for this issue (they are somewhat unrelated): #729 #730
76c429c3178c965c6517629957a633768132904c is the first bad commit
Before
After