Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 400641 - emerge fails: OSError: [Errno 20] Not a directory: '/var/tmp/portage/app-office' when that is a symlink
Summary: emerge fails: OSError: [Errno 20] Not a directory: '/var/tmp/portage/app-offi...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 431026
  Show dependency tree
 
Reported: 2012-01-24 20:43 UTC by nikarul
Modified: 2012-09-08 23:51 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nikarul 2012-01-24 20:43:47 UTC
I have my /var/tmp mounted as a ramdisk.  This works for most applications, but there's not enough room for Libre Office.  I've worked around this in the past by symlinking /var/tmp/portage/app-office to another tmp dir on my hard drive.  However libreoffice-3.4.5.2 fails with the following error:

>>> Running pre-merge checks for app-office/libreoffice-3.4.5.2
 * Checking for at least 1 gibibytes RAM ...                                                                                                                [ ok ]
 * Checking for at least 9 gibibytes disk space at "/var/tmp/portage/app-office/libreoffice-3.4.5.2/temp" ...                                               [ ok ]
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 2032, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 444, in action_build
    retval = mergetask.merge()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1020, in merge
    rval = self._run_pkg_pretend()
  File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 949, in _run_pkg_pretend
    build_dir.unlock()
  File "/usr/lib64/portage/pym/_emerge/EbuildBuildDir.py", line 99, in unlock
    os.rmdir(self._catdir)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 230, in __call__
    rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 20] Not a directory: '/var/tmp/portage/app-office'

Reproducible: Always

Steps to Reproduce:
1.  Create a symlink /var/tmp/portage/app-office that points to a suitable temp directory.
2.  'emerge libreoffice'
3.
Actual Results:  
A fatal Python exception.

Expected Results:  
libreoffice to compile and install properly from the symlinked folder

emerge --resume --skipfirst doesn't help in this situation, since its failing in the pre-merge check section.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-01-25 14:45:26 UTC
Please post your `emerge --info' output in a comment.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-01-25 14:46:54 UTC
You should probably simply symlink /var/tmp/portage or just set PORTAGE_TMPDIR properly (in /etc/portage/env/app-office/libreoffice), but emerge should probably handle it properly too.
Comment 3 Zac Medico gentoo-dev 2012-01-25 18:41:21 UTC
/etc/portage/env/app-office/libreoffice won't work.

You have to use something like this in /etc/portage/package.env:

  app-office/* app-office.conf

And something like this in /etc/portage/env/app-office.conf:

  PORTAGE_TMPDIR=/some/other/temp/dir
Comment 4 Zac Medico gentoo-dev 2012-01-25 18:46:55 UTC
(In reply to comment #0)
>   File "/usr/lib64/portage/pym/_emerge/EbuildBuildDir.py", line 99, in unlock
>     os.rmdir(self._catdir)
>   File "/usr/lib64/portage/pym/portage/__init__.py", line 230, in __call__
>     rval = self._func(*wrapped_args, **wrapped_kwargs)
> OSError: [Errno 20] Not a directory: '/var/tmp/portage/app-office'

We can reduce this to a warning, but if you have sandbox enabled (it is by default), then the symlink is going to trigger a sandbox access violation because sandbox de-references symlinks in order to perform access checks.
Comment 5 nikarul 2012-01-26 03:57:27 UTC
Zac's suggestion worked like a charm.  Its probably the better solution, considering I no longer have to remember to re-create the symlink whenever there is a Libre Office update.
Comment 6 Zac Medico gentoo-dev 2012-09-04 03:11:21 UTC
(In reply to comment #0)
>   File "/usr/lib64/portage/pym/_emerge/EbuildBuildDir.py", line 99, in unlock
>     os.rmdir(self._catdir)
>   File "/usr/lib64/portage/pym/portage/__init__.py", line 230, in __call__
>     rval = self._func(*wrapped_args, **wrapped_kwargs)
> OSError: [Errno 20] Not a directory: '/var/tmp/portage/app-office'

It's fixed in git to ignore the rmdir failure:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ed68a1bdb22fec478ac39b377961508cd3a30617
Comment 7 Zac Medico gentoo-dev 2012-09-08 23:51:01 UTC
This is fixed in 2.1.11.14 and 2.2.0_alpha125.