Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.

FS#12653 - Issues with fakeroot again

Attached to Project: Pacman
Opened by Gereon Schomber (IncredibleLaser) - Saturday, 03 January 2009, 15:41 GMT
Last edited by Dan McGee (toofishes) - Thursday, 16 April 2009, 04:02 GMT
Task Type Feature Request
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 3.2.1
Due in Version 3.3.0
Due Date Undecided
Percent Complete 100%
Votes 3
Private No


Summary and Info:
After it wprked last time I checked, I'm having trouble with fakeroot again. When running a configure-skript in fakeroot (mplayer-svn is the troublemaker), I get segmentation faults. Same goes for building amarok2 (build still fails, but at a much later point because of a different error). My question is: would't it be smarter and more logical to run the whole build-process with makepkg as regular user and only create the final package (which would be makepkg --repackage) with fakeroot? It should work, as a user in fakeroot sees all his files belonging to root. However, some build scripts seem to do weird things when run as root without real root privileges. Or at least make this an optional switch in makepkg, as only few packages are concerned.
This task depends upon

Closed by  Dan McGee (toofishes)
Thursday, 16 April 2009, 04:02 GMT
Reason for closing:  Upstream
Additional comments about closing:  Upstream issue with libfakeroot+nvidia-libgl
Comment by Allan McRae (Allan) - Saturday, 03 January 2009, 15:45 GMT
What are the exact errors you are getting? I compiled the amarok2-svn PKGBUILD from the AUR with no issues and had a build failure in mplayer-svn which had nothing to do with fakeroot.

The option to build as regular user and package using fakeroot is already coded and will be in pacman-3.3.
Comment by Gereon Schomber (IncredibleLaser) - Saturday, 03 January 2009, 16:05 GMT
Ah, good to hear about the option to be available. The error I get is:

Checking for freetype >= 2.0.9 ... ./configure: line 94: 22119 Segmentation fault "$TMPEXE" >> "$TMPLOG" 2>&1

even though freetype is installed.

With !fakeroot in BUILDENV in my makepkg.conf, I get;

Checking for freetype >= 2.0.9 ... yes

Sorry to be bugging like this, but I think this has to be fixed in the makepkg script. If that is wrong, just tell me.
Comment by Gereon Schomber (IncredibleLaser) - Saturday, 03 January 2009, 16:09 GMT
line 94 in configure is this function:

tmp_run() {
"$TMPEXE" >> "$TMPLOG" 2>&1

When replacing "$TMPEXE" >> "$TMPLOG" 2>&1 with : , the script runs fine (that's all my patch does).
Comment by Allan McRae (Allan) - Saturday, 03 January 2009, 16:39 GMT
I replaced tmp_run() in the mplayer configure script with:

tmp_run() {
echo $TMPEXE
echo $TMPLOG
"$TMPEXE" >> "$TMPLOG" 2>&1

And got:
Checking for freetype >= 2.0.9 ... /tmp/mplayer-conf-6164-29451

So it appears that the program /tmp/mplayer-conf-6164-29451 (the numbers will vary...) is causing this issue.

My immediate thought is what are the permissions on your /tmp directory (ls -ld /tmp)?
Comment by Allan McRae (Allan) - Saturday, 03 January 2009, 16:51 GMT
Also, i686 or x86_64?
Comment by Attila (attila) - Saturday, 03 January 2009, 17:25 GMT
@Allan I have the same problems in combination with mplayer-svn rel 28328. For me the question is not so much that patching configure let it run better. It is more important that if i got such a "Segmentation fault" for at example "Checking for libmp3lame (for mencoder)" than mencoder have no libmp3lame support.

As described in Bug 12646 from IncredibleLaser this happens only with fakeroot, not as normal user with doing the same as from the PKGBUILD in the srcdir and not with "makepkg --asroot".
Comment by Gereon Schomber (IncredibleLaser) - Saturday, 03 January 2009, 17:46 GMT
I am on i686 right now, but it also happens on 64bit. /tmp is owned by root.
Comment by Gereon Schomber (IncredibleLaser) - Saturday, 03 January 2009, 17:47 GMT
But everyone has write permission (forgot that, sorry).
drwxrwxrwt 10 root root 4096 3. Jan 18:01 /tmp
Comment by Gereon Schomber (IncredibleLaser) - Saturday, 03 January 2009, 23:37 GMT
A little update on this issue: I can install neither of these packages with a regular makepkg; However, I wrote a small script that just does:

fakeroot makepkg --repackage --asroot -f

and I can build and install at least amarok2-svn without problems with a custom PKGBUILD (libmtp is needed), mplayer-svn was not tested. Files installed have the right ownership. My suggestion is to make building via makepkg as regular user the default. This is a feature request after all, and there could be hidden something fishy in the Makefile like creating a needed user, even though this results in an error.
Comment by Dan McGee (toofishes) - Sunday, 04 January 2009, 05:08 GMT
Are you using a tmpfs for /tmp? If so, fakeroot has had some troubles in the past with ACLs which tmpfs does support so this could be a possible cause of problems.
Comment by Attila (attila) - Sunday, 04 January 2009, 08:39 GMT
Only for the stats about tmpfs in the fstab and /tmp:

$ grep tmpfs /etc/fstab
tmpfs /dev/shm tmpfs defaults,rw 0 0
$ ls -ld /tmp/
drwxrwxrwt 10 root root 4096 4. Jan 09:36 /tmp/
Comment by Gereon Schomber (IncredibleLaser) - Sunday, 04 January 2009, 10:31 GMT
Looks like this for me:

$ grep tmpfs /etc/fstab
none /dev/shm tmpfs defaults 0 0
Comment by Ronald van Haren (pressh) - Wednesday, 14 January 2009, 14:48 GMT
is fakeroot still preferred to fakeroot-ng?
fakeroot-ng uses PTRACE to fool programs root is running, whereis fakeroot uses LD_PRELOAD. Not sure which one of the two is technological superior, and I doubt makepkg can handle it as a drop in replacement.
Comment by Allan McRae (Allan) - Thursday, 15 January 2009, 13:41 GMT
Debian still updates fakeroot so I am assuming that they still prefer it over fakeroot-ng. I haven't really seem a good comparison made between the two.

This bug probably has to wait for pacman-3.3 to be release. Them makepkg will separate the building and packaging stages of package building and only use fakeroot for packaging.
Comment by Rasmus Steinke (rasi) - Saturday, 17 January 2009, 10:53 GMT
For me it worked, when i commented out the cflags line in makepkg.conf
Comment by Rasmus Steinke (rasi) - Saturday, 17 January 2009, 11:10 GMT
correction... it works a bit further, but it crashes at a later time then...
Comment by Thomas Bergheim (knighthk) - Monday, 26 January 2009, 13:24 GMT
amarok2 wouldn't compile for me on x86_64. Added --asroot, and it worked.
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 18 February 2009, 20:38 GMT
This is an issue with fakeroot and nvidia libGL libs. Please read comments that i posted here  FS#12592 
Comment by Attila (attila) - Thursday, 19 February 2009, 06:41 GMT
@Gerardo Thanks for your work. My problems with mplayer-svn go away if i use a self compiled (+ "--with-ipc=tcp") version of fakeroot. Is there a negative sideeffect if i use this version of fakeroot for all other packages?
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 19 February 2009, 20:48 GMT
@attila: I don't know, please see  FS#13375  for future information about fakeroot issues.