FS#56124 - [s-nail] build in clean chroot fails due to missing sudo permissions

Attached to Project: Arch Linux
Opened by Erich Eckner (deepthought) - Thursday, 26 October 2017, 11:31 GMT
Last edited by Gaetan Bisson (vesath) - Thursday, 26 October 2017, 20:31 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Gaetan Bisson (vesath)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The use of sudo in check() dos not work if the package is built via archbuild. It results in:

==> Starting check()...

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for builduser:

Additional info:
* package version(s)
s-nail 14.9.5-1 (git revision fd3fd57127d7)

Steps to reproduce:
> asp export s-nail
> cd s-nail
> staging-x86_64-build
This task depends upon

Closed by  Gaetan Bisson (vesath)
Thursday, 26 October 2017, 20:31 GMT
Reason for closing:  Fixed
Comment by Erich Eckner (deepthought) - Thursday, 26 October 2017, 11:31 GMT
whoops, forgot to set the correct repository - it should be [core]
Comment by Gaetan Bisson (vesath) - Thursday, 26 October 2017, 17:26 GMT
The problem is makechrootpkg's nobody user (as which the builds are done) is too restrictive: it has no login shell, no locale, no sudo access, etc.
For many packages that makes running `make check` properly near impossible (off the top of my head: openssh, also s-nail).
Personally I build with a full environment inside a VM which does not suffer from these limitations; see: https://aur.archlinux.org/packages/buildstuff/

What would you suggest as a possible solution to this? I can add a check to see if we have sudo access and if not disable the check() function entirely. Would that work for you?
Comment by Eli Schwartz (eschwartz) - Thursday, 26 October 2017, 18:24 GMT
I'm a bit confused, as this is only being used to enable the en_US.UTF-8 locale, while mkarchroot defines a valid Arch chroot as being one with en_US.UTF-8 and de_DE.UTF-8 available. So maybe a better check would be to first see if the locale is already in fact available, and if it isn't, assume it is your own build VM which needs to be fixed. And possibly also add a check for sudo access, yeah. Or define your build VM to include this requirement.

Aside: I quite like Earnestly's glibc-git package for the fact that it reimplements locale.gen as /etc/locales/en_US and other drop-in files and just builds the UTF-8 versions of all files. (Because in this day and age non-UTF-8 locales are extremely silly.) You could easily enable a locale that some package needs by adding a makedepends on some package which provides that drop-in file and runs locale-gen.
Comment by Gaetan Bisson (vesath) - Thursday, 26 October 2017, 19:49 GMT
You're right, my memory failed me: the issue with makechrootpkg is not related to the locale but something else:

./cc-test.sh: line 2204: 2294 Segmentation fault (core dumped) ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
behave:atxplode-1: error: unexpected exit status: 139 != 0
behave:atxplode-1: error: checksum mismatch (got 4294967295 0)

./cc-test.sh: line 2655: 2988 Segmentation fault (core dumped) ${MAILX} ${ARGS} -ef ./.t.mbox
./cc-test.sh: line 2655: 3001 Segmentation fault (core dumped) ${MAILX} ${ARGS} -ef ./.t.mbox
./cc-test.sh: line 2655: 3002 Segmentation fault (core dumped) ${MAILX} ${ARGS} -efL @t@me ./.t.mbox
./cc-test.sh: line 2655: 3003 Segmentation fault (core dumped) ${MAILX} ${ARGS} -efL @t@you ./.t.mbox
./cc-test.sh: line 2655: 3004 Segmentation fault (core dumped) ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox
./cc-test.sh: line 2655: 3005 Segmentation fault (core dumped) ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox
./cc-test.sh: line 2655: 3006 Segmentation fault (core dumped) ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox
./cc-test.sh: line 2655: 3007 Segmentation fault (core dumped) ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox
./cc-test.sh: line 2655: 3008 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
./cc-test.sh: line 2655: 3009 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
./cc-test.sh: line 2655: 3010 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
./cc-test.sh: line 2655: 3011 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
./cc-test.sh: line 2655: 3012 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
./cc-test.sh: line 2655: 3013 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
./cc-test.sh: line 2655: 3014 Segmentation fault (core dumped) ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2> /dev/null
behave:e_H_L_opts: error: checksum mismatch (got 3914351258 60)

So removing my sudo won't change much because the tests will fail under makechrootpkg. Quite frankly I'm tired of fixing these tests which assume a full-blown environment. So I guess I'll do what I did with openssh and disable the tests altogether when inside makechrootpkg.
Comment by Gaetan Bisson (vesath) - Thursday, 26 October 2017, 19:52 GMT
See if you're happy with my changes to SVN. Anyone is free to run the tests by building with makepkg and/or removing the if statement.
Comment by Erich Eckner (deepthought) - Thursday, 26 October 2017, 20:11 GMT
I'm not really happy with disabling the tests, but I see your point.
I just wanted to let you know, that andreas_baumann had a look at the segfault, too: https://bbs.archlinux32.org/viewtopic.php?pid=474#p474
Comment by Gaetan Bisson (vesath) - Thursday, 26 October 2017, 20:31 GMT
Awesome. Let me know as soon as this if fixed (my email address is there: https://www.archlinux.org/people/developers/#bisson ) and I'll remove the if statement. Cheers.

Loading...