FS#40620 - [devtools] makechrootpkg does not end in non-zero code when build fails

Attached to Project: Arch Linux
Opened by John (graysky) - Saturday, 31 May 2014, 09:08 GMT
Last edited by Dave Reisner (falconindy) - Friday, 24 October 2014, 13:25 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

I believe an error was introduced in makechrootpkg in the 20140510 release wherein running makechrootpkg will end in a non-zero state even though a build using it fails to build a package. It should return a non-zero code in that scenario. Downgrading to devtools-20131101 fixes this problem.

Additional info:
* package version(s) devtools 20140510-1

Steps to reproduce:
1) Setup a clean chroot.
2) Modify a good PKGBUILD to throw an error in the prepare function; change the name of a patch for example and run: makechrootpkg -c -u -r /scratch/chroot
3) Query the return code by: echo $? which is 0.

Example:
# makechrootpkg -c -u -r /scratch/chroot
...
==> Starting prepare()...
patch: **** Can't open patch file /build/chromium-no-sse2/src/chromium-no-sse2-1/undo_removing_sse2.patch : No such file or directory
==> ERROR: A failure occurred in prepare().
Aborting...

==> ERROR: Build failed, check /scratch/chroot/facade/build
makechrootpkg -c -u -r /scratch/.chroot32 39.55s user 2.65s system 96% cpu 43.820 total

# echo $?
0
This task depends upon

Closed by  Dave Reisner (falconindy)
Friday, 24 October 2014, 13:25 GMT
Reason for closing:  Fixed
Additional comments about closing:  devtools-20141024

https://projects.archlinux.org/devtools. git/commit/?id=af6c0a0f6a7644f
Comment by Dave Reisner (falconindy) - Monday, 02 June 2014, 01:51 GMT Comment by Ike Devolder (BlackEagle) - Saturday, 07 June 2014, 13:55 GMT Comment by John (graysky) - Saturday, 07 June 2014, 15:32 GMT
https://mailman.archlinux.org/pipermail/arch-projects/2014-June/004163.html

Worked for me:
% sudo makechrootpkg -c -u -r /scratch/.chroot64
==> Creating clean working copy [facade]...done
...
==> Starting build()...
patch: **** Can't open patch file ../no.patch : No such file or directory
==> ERROR: A failure occurred in build().
Aborting...

==> ERROR: Build failed, check /scratch/.chroot64/facade/build
sudo makechrootpkg -c -u -r /scratch/.chroot64 5.32s user 0.59s system 88% cpu 6.683 total

% echo $? :(
255
Comment by John (graysky) - Thursday, 28 August 2014, 18:25 GMT
Any word on timing for this fix?

Loading...