I have my portage DISTDIR automounted from an nfs server at /misc/distfiles; /usr/portage/distfiles is a symlink, and DISTDIR is not explicitly set. This configuration worked fine on all versions of portage I have used for some years, and worked with 2.1.12.2. Since upgrading to 2.2.1, portage will not use the automounted DISTDIR. Reproducible: Always Steps to Reproduce: 1. Configure portage as described 2. emerge gimp Actual Results: >>> Emerging (1 of 1) media-gfx/gimp-2.8.6 !!! makedirs('/misc/distfiles/') !!! Directory Not Found: DISTDIR='/misc/distfiles' !!! Fetching will fail! !!! No write access to '/misc/distfiles' !!! statvfs('/misc/distfiles'): [Errno 2] No such file or directory: '/misc/distfiles' !!! File gimp-2.8.6.tar.bz2 isn't fetched but unable to get it. * Fetch failed for 'media-gfx/gimp-2.8.6', Log file: * '/var/tmp/portage/media-gfx/gimp-2.8.6/temp/build.log' Expected Results: normal emerge output I suspect that what's going on is that portage is using stat() to test whether /misc/distfiles exists, and then using mkdir() to open it if not. That's incorrect, as you shouldn't be mkdir()ing in a directory that is mounted with -t autofs (like /misc). Here is the /proc/mounts line for /misc on my system: /etc/autofs/auto.misc /misc autofs rw,relatime,fd=6,pgrp=28483,timeout=300,minproto=5,maxproto=5,indirect 0 0
I have the same or at least a very similar error. If the TMPDIR is in a directory that is mounted on demand (in my case via automount of systemd, which is nothing else than autofs), then it comes to the following message: > /var/tmp/portage is not writable. > Likely cause is that you've mounted it as readonly. "sys-apps/portage" still has a problem with version "3.0.45.3-r2::gentoo" when directories are included via "Autofs" only on demand.
(In reply to Stefan Schmid from comment #1) That's bug 890812.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=f5ae3c4b198f0d5543afbdd36d923422cd451272 commit f5ae3c4b198f0d5543afbdd36d923422cd451272 Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-06-06 18:15:36 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-06-14 19:21:55 +0000 fetch: do not rely on os.stat() for DISTDIR write test If DISTDIR is an automount, os.stat() will not trigger it. Just try to create a file instead. Bug: https://bugs.gentoo.org/485100 Signed-off-by: Mike Gilbert <floppym@gentoo.org> lib/portage/package/ebuild/fetch.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9502761c5bef818dbec90f062909d46dc22289df commit 9502761c5bef818dbec90f062909d46dc22289df Author: Sam James <sam@gentoo.org> AuthorDate: 2023-06-21 19:09:31 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-21 19:11:05 +0000 sys-apps/portage: add 3.0.49 Closes: https://bugs.gentoo.org/485100 Cloess: https://bugs.gentoo.org/592880 Closes: https://bugs.gentoo.org/596664 Closes: https://bugs.gentoo.org/631490 Closes: https://bugs.gentoo.org/764365 Closes: https://bugs.gentoo.org/793992 Closes: https://bugs.gentoo.org/890812 Closes: https://bugs.gentoo.org/905660 Closes: https://bugs.gentoo.org/907949 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.49.ebuild | 296 +++++++++++++++++++++++++++++++++ 2 files changed, 297 insertions(+)