Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 755950 - xattr code always triggered, stub code always fails
Summary: xattr code always triggered, stub code always fails
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All OS X
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 755644 756028
  Show dependency tree
 
Reported: 2020-11-21 14:26 UTC by Fabian Groffen
Modified: 2020-12-01 10:24 UTC (History)
2 users (show)

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 Fabian Groffen gentoo-dev 2020-11-21 14:26:48 UTC
I observe this traceback on prefix branch (3.0.8 equivalent):

 * checking 49 files for package collisions
Traceback (most recent call last):
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/dbapi/_MergeProcess.py", line 234, in _spawn
    prev_mtimes=self.prev_mtimes, counter=counter)
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/dbapi/vartree.py", line 1795, in wrapper
    return f(self, *args, **kwargs)
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/dbapi/vartree.py", line 5400, in merge
    counter=counter)
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/dbapi/vartree.py", line 4291, in treewalk
    others_in_slot + blockers, filelist, linklist)
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/dbapi/vartree.py", line 3759, in _collision_protect
    differences = compare_files(file1, file2, skipped_types=("atime", "mtime", "ctime"))
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/util/_compare_files.py", line 49, in compare_files
    if "xattr" not in skipped_types and sorted(xattr.get_all(file1, nofollow=True)) != sorted(xattr.get_all(file2, nofollow=True)):
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/util/_xattr.py", line 29, in get_all
    for name in cls.list(item, nofollow=nofollow, namespace=namespace)]
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/util/_xattr.py", line 147, in list
    cls._raise()
  File "/Scratch/Gentoo/bootstrap64-20201121/tmp/usr/lib/python3.7/portage/util/_xattr.py", line 131, in _raise
    raise e
OSError: stub

FEATURES=-xattr doesn't help much.

What does help is to make the stub not throw an exception, but an empty list for xattrlist.  However, I mostly wonder whether this should be triggered at this point?
Comment 1 Zac Medico gentoo-dev 2020-11-21 21:09:35 UTC
We should fix the compare_files function to skip xattrs comparison, like this:


> diff --git a/lib/portage/util/_compare_files.py b/lib/portage/util/_compare_files.py
> index de97a9d9d..334aeb0bf 100644
> --- a/lib/portage/util/_compare_files.py
> +++ b/lib/portage/util/_compare_files.py
> @@ -45,7 +45,7 @@ def compare_files(file1, file2, skipped_types=()):
>         if "device_number" not in skipped_types and file1_stat.st_rdev != file2_stat.st_rdev:
>                 differences.append("device_number")
>  
> -       if "xattr" not in skipped_types and sorted(xattr.get_all(file1, nofollow=True)) != sorted(xattr.get_all(file2, nofollow=True)):
> +       if xattr.XATTRS_WORKS and "xattr" not in skipped_types and sorted(xattr.get_all(file1, nofollow=True)) != sorted(xattr.get_all(file2, nofollow=True)):
>                 differences.append("xattr")
>  
>         if "atime" not in skipped_types and file1_stat.st_atime_ns != file2_stat.st_atime_ns
Comment 2 Larry the Git Cow gentoo-dev 2020-11-22 06:20:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=a2e7bf7d1c7d518fe8d7cf2c0e6cb30020b8aa94

commit a2e7bf7d1c7d518fe8d7cf2c0e6cb30020b8aa94
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-11-21 21:13:27 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-11-22 06:17:29 +0000

    compare_files: handle missing xattr support
    
    Bug: https://bugs.gentoo.org/755950
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/util/_compare_files.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 3 Larry the Git Cow gentoo-dev 2020-11-22 06:47:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b723fb347408dcd76ab4121f9cf94b0c51d48223

commit b723fb347408dcd76ab4121f9cf94b0c51d48223
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-11-22 06:43:39 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-11-22 06:47:30 +0000

    sys-apps/portage: Bump to version 3.0.10
    
     #753497 profiles should not inherit deprecated messages
     #754903 minimize use of installed packages to break cycles
     #755950 compare_files: handle missing xattr support
    
    Bug: https://bugs.gentoo.org/753497
    Bug: https://bugs.gentoo.org/754903
    Bug: https://bugs.gentoo.org/755950
    Bug: https://bugs.gentoo.org/756028
    Package-Manager: Portage-3.0.10, Repoman-3.0.2
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.10.ebuild | 267 +++++++++++++++++++++++++++++++++
 2 files changed, 268 insertions(+)
Comment 4 Fabian Groffen gentoo-dev 2020-11-22 11:18:30 UTC
Thanks a lot for the swift response and fix Zac!
Comment 5 Fabian Groffen gentoo-dev 2020-11-22 17:13:34 UTC
I've done a clean deploy now, and the error (shortened) with commit c51d48223 changed to:

  File "/Scratch/Gentoo/bootstrap64-20201122/tmp/usr/lib/python3.7/portage/util/_compare_files.py", line 48, in compare_files
    if (xattr.XATTRS_WORKS and "xattr" not in skipped_types and
AttributeError: type object '_XattrStub' has no attribute 'XATTRS_WORKS'
Comment 6 Larry the Git Cow gentoo-dev 2020-11-22 19:41:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=ae8b18f868c9bd039643f89f28f9d92ce8966c3c

commit ae8b18f868c9bd039643f89f28f9d92ce8966c3c
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-11-22 19:37:05 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-11-22 19:38:51 +0000

    compare_files: fix missing xattr handling
    
    Fixes: a2e7bf7d1c7d ("compare_files: handle missing xattr support")
    Bug: https://bugs.gentoo.org/755950
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/util/_compare_files.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2020-11-22 19:54:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d04117118ee16f77ac19eb081f774277a0931729

commit d04117118ee16f77ac19eb081f774277a0931729
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-11-22 19:52:00 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-11-22 19:54:32 +0000

    sys-apps/portage: 3.0.10-r1 revbump for bug 755950
    
     #755950 compare_files: fix missing xattr handling
    
    Bug: https://bugs.gentoo.org/756028
    Bug: https://bugs.gentoo.org/755950
    Package-Manager: Portage-3.0.10, Repoman-3.0.2
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/{portage-3.0.10.ebuild => portage-3.0.10-r1.ebuild} | 5 +++++
 1 file changed, 5 insertions(+)
Comment 8 Fabian Groffen gentoo-dev 2020-11-23 10:21:38 UTC
thanks again Zac, this time confirmed, this does the trick
Comment 9 Fabian Groffen gentoo-dev 2020-12-01 10:24:16 UTC
fixed with portage-3.0.10.2