Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 722054

Summary: unpacker.eclass calls ar directly
Product: Gentoo Linux Reporter: Agostino Sarubbo <ago>
Component: EclassesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: arfrever.fta, billie, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 243502    
Attachments: build.log

Description Agostino Sarubbo gentoo-dev 2020-05-10 08:41:28 UTC
This is an auto-filled bug because app-crypt/debian-archive-keyring calls ar directly.
The issue was originally discovered on amd64, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.

NOTE:
If you think it doesn't make sense fix these type of issues, I'd like to point out that won't be possible use a different AR implementation (like llvm-ar) by setting the AR variable. So this issue has been reproduced by setting the AR variable to x86_64-pc-linux-gnu-ar and by removing the /usr/bin/ar binary.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-10 08:41:36 UTC
Created attachment 637460 [details]
build.log

build log and emerge --info
Comment 2 Sebastian Pipping gentoo-dev 2020-05-10 11:15:23 UTC
The ebuild does not really compile anything.  If direct invocation of "ar" is a problem, this might affect the unpacker eclass more than app-crypt/debian-archive-keyring maybe.  Otherwise maybe we need to add a missing build dependency here?  What do you think?
Comment 3 Larry the Git Cow gentoo-dev 2020-05-10 16:40:11 UTC
The bug has been closed via the following commit(s):

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

commit 9de9d52da4a36f1308a837fd2c4803e893ef9e97
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-05-10 16:35:02 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-05-10 16:39:44 +0000

    unpacker.eclass: respect AR variable in unpack_deb
    
    Closes: https://bugs.gentoo.org/722054
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/unpacker.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 4 Arfrever Frehtes Taifersar Arahesis 2020-05-11 09:11:57 UTC
The planned 'ar' wrapper would print QA warning when called directly.
I suggest to use:

local AR=${AR-${CHOST}-ar}
Comment 5 Mike Gilbert gentoo-dev 2020-05-11 13:57:34 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #4)
> The planned 'ar' wrapper would print QA warning when called directly.

Where is this plan you mention?
Comment 6 Lucian Poston 2020-05-13 12:35:31 UTC
*** Bug 721910 has been marked as a duplicate of this bug. ***
Comment 7 Daniel Pielmeier gentoo-dev 2020-06-22 10:42:01 UTC
Currently net-im/signal-desktop-bin which uses the unpacker eclass fails with:

>>> Unpacking signal-desktop_1.34.2_amd64.deb to /var/portage/tmp/portage/net-im/signal-desktop-bin-1.34.2/work
/var/portage/tmp/portage/net-im/signal-desktop-bin-1.34.2/temp/environment: line 869: ar: command not found
 * ERROR: net-im/signal-desktop-bin-1.34.2::gentoo failed (unpack phase):

When using:

local AR=${AR-${CHOST}-ar}

like Arfrever suggested the unpacking succeeds!
Comment 8 Daniel Pielmeier gentoo-dev 2020-06-22 11:23:42 UTC
Okay so this was just me playing with use -native-symlinks [1] and not setting it back properly!

However it probably still makes sense considering the suggestion of Arfrever.

[1] https://wiki.gentoo.org/wiki/Project:Toolchain/use_native_symlinks
Comment 9 Mike Gilbert gentoo-dev 2020-06-22 12:26:03 UTC
I find the idea that we cannot call ar to unpack an archive ridiculous.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-06-22 15:27:26 UTC
POSIX considers the existence of 'ar' mandatory.  Artificially removing this program makes the system set invalid, and I don't think it reasonable to waste people's time on working around deliberately broken systems.
Comment 12 Mike Gilbert gentoo-dev 2020-06-22 15:49:54 UTC
Copying toolchain in case they have some opinion on this.
Comment 13 Daniel Pielmeier gentoo-dev 2020-06-22 16:43:28 UTC
(In reply to Michał Górny from comment #11)
> POSIX considers the existence of 'ar' mandatory.  Artificially removing this
> program makes the system set invalid, and I don't think it reasonable to
> waste people's time on working around deliberately broken systems.

Just for me to understand. You consider the native symlinks approach broken? Or do you mean it needs to fixed to not mess wit ar, etc?

I was just thinking from the tracker bug that this will eventually become the default.
Comment 14 Mike Gilbert gentoo-dev 2020-06-22 16:53:30 UTC
I certainly don't think this should ever become the default.

I also don't think it makes sense to officially support USE="-native-symlinks" without installing ar, cc, etc in PATH some other way.
Comment 15 Larry the Git Cow gentoo-dev 2020-06-28 22:01:54 UTC
The bug has been closed via the following commit(s):

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

commit e424e535ba0ae80880ee13417713757161a925f0
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-06-22 15:07:39 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-06-28 22:01:40 +0000

    unpacker.eclass: call BUILD_AR when unpacking deb files
    
    Closes: https://bugs.gentoo.org/722054
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 eclass/unpacker.eclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)