Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7853 - Sandbox errors in KDE ebuilds
Summary: Sandbox errors in KDE ebuilds
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 7980 9255 9320 10391 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-09-12 19:57 UTC by Stephen Farrugia
Modified: 2003-04-14 16:07 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Sandbox log generated by 'emerge kdebase' (sandbox-kdebase-3.0.3-31322.log,1.07 KB, text/plain)
2002-09-14 09:34 UTC, Stephen Farrugia
Details
New kde.eclass setting HOME=$T/fakehome. (kde.eclass,3.79 KB, text/plain)
2002-10-04 07:10 UTC, Dan Armak (RETIRED)
Details
Replacement kde.eclass (kde.eclass,3.92 KB, text/plain)
2002-10-04 09:39 UTC, Dan Armak (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Farrugia 2002-09-12 19:57:49 UTC
kdebase 3.0.3 ebuild does not work correctly in the sandbox.  This manifests
itself on a clean system with no prior versions of kde present.  The result is
that kdebase does not install correctly.  KDE will *NEVER* be able to be
installed for new users as it currently stands.
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-09-12 20:10:09 UTC
can you attach the emerge log, please?
Comment 2 Stephen Farrugia 2002-09-13 05:02:57 UTC
Err, unless emerge automaticall keeps logs, no I cannot provide you with
the bad build log file as it was overwritten by the final good one.  I
can tell you that the sandbox problem error messages were for /root/.kde
and a couple of subdirs below that.  Hope that helps a bit more
Comment 3 Dan Armak (RETIRED) gentoo-dev 2002-09-14 09:19:41 UTC
"Final good one" - you mean it succeeded in emerging when you tried again? Or what?  The errors about stuff in ~/.qt and ~/.kde not being writeable are always there, but they don't make the build process abort. Did they become "real" sanbodx errors for you, i.e. with red-colored output etc? Normally they're just messages from the build system, not from the sandbox itself. 
Comment 4 Stephen Farrugia 2002-09-14 09:34:27 UTC
Created attachment 3911 [details]
Sandbox log generated by 'emerge kdebase'

When building the system from scratch, I emerged kdebase.  It repeatedly
displayed red output saying it was unable to create /root/.kde.
It was only after I searched the forum that I tried emerging kdebase
with the sandbox disabled (export SANDBOX_DISABLED=1; emerge kdebase;).
Only with the sandbox disabled was kdebase built to completion, by which
I mean that 'startkde' existed at the end.  To help a bit more, I have
found the sandbox log from the first time I tried emerging kdebase.
So I made /root/.kde and the build them complained about /root/.kde/share.
Comment 5 Matt Willsher 2002-09-22 22:09:25 UTC
I too am seeing this error. I'm also getting it when I try to emerge Quanta. Are
the two related?
Comment 6 Dan Armak (RETIRED) gentoo-dev 2002-09-29 02:10:42 UTC
This bug is really annoying. People have been reporting it on and off for  
months (only a very few people though). I and everyone else get the access  
denied _warnings_ from the app that tries to access .kde, but these people get  
access denied _errors_ from the sandbox. And I've no idea what the difference  
in our setups is. 
Ideas anyone? 
Maybe you're using some rare filesystem or portage version or something?... 
Comment 7 Stephen Farrugia 2002-09-29 04:43:35 UTC
This occurred when I was installing on my brand new laptop.  I followed the
install instructions from a stage-1 install.  I use the vanilla kernel which is
highly customised.  I like a nice, tight kernel, force of habit over many years
of using Linux.  File system is ext3.  From my view point, it looks like
something in the build of kdebase is looking for something like $HOME/.kde. 
Could an env var which I have contribute to the build failing?  Once again, my
root login is tight but customised to my needs.  If my login profile has
compromised the build of kdebase, but it's OK for other people generally, this
would indicate something in my profile affects the build, doesn't it?  So I
would start looking at anything in the build that used $LOGNAME, or $USER as I
used sudo from my standard login shell and they're the only two variables in my
environment that have root mentioned in them.  As much as I can, I will help
sniff the problem out, so keep asking the questions and I'll keep answering as
best as I can.
Comment 8 Dan Armak (RETIRED) gentoo-dev 2002-10-04 04:09:44 UTC
*** Bug 7980 has been marked as a duplicate of this bug. ***
Comment 9 Dan Armak (RETIRED) gentoo-dev 2002-10-04 07:09:07 UTC
OK, finally a fix to test! :-) 
 
Part 1: the fix: I'm about to attach a new kde.eclass, replace the one in 
/usr/portage/eclass with it and try again. 
 
What it does is mkdir -p $T/fakehome/.kde; export HOME=$T/fakehome. That means 
the build process can now access a homedir that's writeable under the sandbox 
(T=/var/tmp/portage/<package>/temp, the temp dir). That should get rid of the 
errors no matter what their source is. 
 
I've just now though of & implemented it, so haven't tested it myself, but it 
shouldn't break anything AFAICS. Yes I know I could have done this long ago; it 
took mjc who suggested a good explanation for why this is is happening only for 
certain people to get me going. 
Comment 10 Dan Armak (RETIRED) gentoo-dev 2002-10-04 07:10:20 UTC
Created attachment 4403 [details]
New kde.eclass setting HOME=$T/fakehome.

Please test this. It replaces /usr/portage/eclass/kde.eclass.
Comment 11 Dan Armak (RETIRED) gentoo-dev 2002-10-04 07:16:55 UTC
Part 2: now for mjc's explanation:   
   
Whatever is generating these errors checks if it has write permissions to   
~/.kde before trying to write.   
   
Because emerge is run as root, the build process always sees HOME=/root.   
  
If the user really is root (like me and mostly everyone since emerge requires   
root perms), he does have write permissions there and so the build process  
tries to write there and the sandbox errors out.  
  
If the user isn't root but has root permissions (therefore probably not using  
su but something different?), he doesn't have write perms to /root and so the  
build process prints its own warning of "access denied", but doesn't try to  
write there.  
  
Now I know this theory isn't very correct. For one thing, it predicts that _I_ 
should haev sandbox errors rather than other people. But it's something at 
least and sounds like a promising lead :-) 
 
Credit goes to mjc (thanks!) and to my possible misunderstanding of his 
words... 
Comment 12 Dan Armak (RETIRED) gentoo-dev 2002-10-04 09:39:40 UTC
Created attachment 4409 [details]
Replacement kde.eclass

New version: add support for ccache by making fakehome/.ccache a symlink
pointing to the real $HOME/.ccache.
Comment 13 Dan Armak (RETIRED) gentoo-dev 2002-10-20 07:40:42 UTC
*** Bug 9255 has been marked as a duplicate of this bug. ***
Comment 14 Dan Armak (RETIRED) gentoo-dev 2002-10-22 02:45:06 UTC
*** Bug 9320 has been marked as a duplicate of this bug. ***
Comment 15 Dan Armak (RETIRED) gentoo-dev 2002-11-10 04:49:49 UTC
*** Bug 10391 has been marked as a duplicate of this bug. ***
Comment 16 Dan Armak (RETIRED) gentoo-dev 2002-11-23 15:18:41 UTC
The fix has been in portage for some time now. If noone objects I will close this bug. 
Comment 17 Sam Yates 2003-01-23 13:52:36 UTC
Still getting sandbox violations on emerging kdebase-3.1_rc6, these being
multiple lines of the form
[...]
mkdir:     /root/.kde
mkdir:     /root/.kde
mkdir:     /root/.kde
[...]
(pretty much the sandbox log already attached to this bug)

There was indeed a /var/tmp/portage/kdebase-3.1_rc6/temp/fakehome/ directory,
with a empty .kde subdirectory, and a .qt subirectory containing
'qt_plugins_3.1rc' and '.qt_plugins_3.1rc.lock'.

At the time of install, there were no other kde packages emerged, and further
until this point there was a -kde in the USE variable.

Would posting anything else be useful?
Comment 18 Sam Yates 2003-01-23 14:06:14 UTC
I noticed that my comment is pretty much the same as bug 11664 - sorry for the dupe!
Comment 19 Dan Armak (RETIRED) gentoo-dev 2003-01-28 06:49:47 UTC
Are you using sudo like the poster from #11664? If so please try using su, that should work if 
it's the same issue as 11664. 
Comment 20 Dan Armak (RETIRED) gentoo-dev 2003-04-14 16:07:42 UTC
Fixed AFAIK. For the separate sudo issue see bug #11664.