Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 876933 - app-emulation/qemu-guest-agent-7.1.0 calls strings directly
Summary: app-emulation/qemu-guest-agent-7.1.0 calls strings directly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: John Helmert III
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2022-10-13 06:49 UTC by Agostino Sarubbo
Modified: 2022-10-20 02:22 UTC (History)
5 users (show)

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


Attachments
build.log (build.log,44.69 KB, text/plain)
2022-10-13 06:49 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-10-13 06:49:33 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-emulation/qemu-guest-agent-7.1.0 calls strings directly.
Discovered on: amd64 (internal ref: ci)

NOTE:
As per QA policy, toolchain tools must not be called directly because they can cause issue in cross-compiling and because is not possible use a different STRINGS implementation (like llvm-strings). To reproduce, please use sys-devel/gcc-config[-native-symlinks], sys-devel/binutils-config[-native-symlinks].
Comment 1 Agostino Sarubbo gentoo-dev 2022-10-13 06:49:35 UTC
CC'ing also the author of the commit (a47ee1bcc5b697a9c404d0e1c9356d9eb2ed44aa)
Comment 2 Agostino Sarubbo gentoo-dev 2022-10-13 06:49:36 UTC
Created attachment 823743 [details]
build.log

build log and emerge --info
Comment 3 Agostino Sarubbo gentoo-dev 2022-10-13 06:49:39 UTC
Error(s) that match a know pattern:


/var/tmp/portage/app-emulation/qemu-guest-agent-7.1.0/work/qemu-7.1.0/configure: line 1493: strings: command not found
/var/tmp/portage/app-emulation/qemu-guest-agent-7.1.0/work/qemu-7.1.0/configure: line 1495: strings: command not found
Comment 4 Michal Prívozník 2022-10-13 07:26:01 UTC
Hey, I'll try to fix this upstream, but looking into qemu's git log, it was introduced in the following commit:

https://gitlab.com/qemu-project/qemu/-/commit/12f15c9155b31fc9f964a5233b0fbec9196f56f3

And is there for ages now:

qemu.git $ git describe --contains 12f15c9155b31fc9f964a5233b0fbec9196f56f3
v2.12.0-rc0~102^2~28

How come this was caught only now?
Comment 5 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-10-13 13:58:59 UTC
(In reply to Michal Prívozník from comment #4)
> Hey, I'll try to fix this upstream, but looking into qemu's git log, it was
> introduced in the following commit:
> 
> https://gitlab.com/qemu-project/qemu/-/commit/
> 12f15c9155b31fc9f964a5233b0fbec9196f56f3
> 
> And is there for ages now:
> 
> qemu.git $ git describe --contains 12f15c9155b31fc9f964a5233b0fbec9196f56f3
> v2.12.0-rc0~102^2~28

Thanks! Maybe https://github.com/gentoo/gentoo/blob/master/app-emulation/qemu/files/qemu-7.1.0-strings.patch is suitable?

> How come this was caught only now?

I think ago's tinderbox only builds things when they're touched, and evidently this package hasn't been touched in some time.
Comment 6 Michal Prívozník 2022-10-13 14:05:12 UTC
(In reply to John Helmert III from comment #5)
> (In reply to Michal Prívozník from comment #4)
> > Hey, I'll try to fix this upstream, but looking into qemu's git log, it was
> > introduced in the following commit:
> > 
> > https://gitlab.com/qemu-project/qemu/-/commit/
> > 12f15c9155b31fc9f964a5233b0fbec9196f56f3
> > 
> > And is there for ages now:
> > 
> > qemu.git $ git describe --contains 12f15c9155b31fc9f964a5233b0fbec9196f56f3
> > v2.12.0-rc0~102^2~28
> 
> Thanks! Maybe
> https://github.com/gentoo/gentoo/blob/master/app-emulation/qemu/files/qemu-7.
> 1.0-strings.patch is suitable?

That will fix it, but only for Gentoo. I've proposed a patch this morning, got a bit of discussion and now sent v2:

https://lists.gnu.org/archive/html/qemu-devel/2022-10/msg02149.html

I'd much rather have this fixed in the upstream (and possibly use that patch in Gentoo), because then we can just drop it from the portage as we bump versions.

> 
> > How come this was caught only now?
> 
> I think ago's tinderbox only builds things when they're touched, and
> evidently this package hasn't been touched in some time.

Ah, makes perfect sense. Having said that, we'll hit the same issue with app-emulation/qemu (if not hit already), because it's the same code base. Another reason for fixing it in qemu itself. I'll let you know when my patch is merged.
Comment 7 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-10-13 14:08:24 UTC
(In reply to Michal Prívozník from comment #6)
> (In reply to John Helmert III from comment #5)
> > (In reply to Michal Prívozník from comment #4)
> > > Hey, I'll try to fix this upstream, but looking into qemu's git log, it was
> > > introduced in the following commit:
> > > 
> > > https://gitlab.com/qemu-project/qemu/-/commit/
> > > 12f15c9155b31fc9f964a5233b0fbec9196f56f3
> > > 
> > > And is there for ages now:
> > > 
> > > qemu.git $ git describe --contains 12f15c9155b31fc9f964a5233b0fbec9196f56f3
> > > v2.12.0-rc0~102^2~28
> > 
> > Thanks! Maybe
> > https://github.com/gentoo/gentoo/blob/master/app-emulation/qemu/files/qemu-7.
> > 1.0-strings.patch is suitable?
> 
> That will fix it, but only for Gentoo. I've proposed a patch this morning,
> got a bit of discussion and now sent v2:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2022-10/msg02149.html
> 
> I'd much rather have this fixed in the upstream (and possibly use that patch
> in Gentoo), because then we can just drop it from the portage as we bump
> versions.

I agree! I shared it to save you the trouble of writing it yourself while the patch already exists.

> > 
> > > How come this was caught only now?
> > 
> > I think ago's tinderbox only builds things when they're touched, and
> > evidently this package hasn't been touched in some time.
> 
> Ah, makes perfect sense. Having said that, we'll hit the same issue with
> app-emulation/qemu (if not hit already), because it's the same code base.
> Another reason for fixing it in qemu itself. I'll let you know when my patch
> is merged.

Do you mean we'll still hit it despite having the aforementioned downstream patch? Thank you for working on this!
Comment 8 Michal Prívozník 2022-10-13 14:17:34 UTC
(In reply to John Helmert III from comment #7)

> Do you mean we'll still hit it despite having the aforementioned downstream
> patch? Thank you for working on this!

No, once my patch is merged we won't hit this issue. But if we were to bump the qemu version right now, we would hit it, because that would trigger the tinderbox IIUC. IOW, once my patch is merged I need to fix it in both app-emulation/qemu-guest-agent and app-emulation/qemu. I'll keep you posted.
Comment 9 Larry the Git Cow gentoo-dev 2022-10-19 14:41:44 UTC
The bug has been referenced in the following commit(s):

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

commit 69629171b283b4e0d29eb0d18d812b469af49ca1
Author:     Michal Privoznik <michal.privoznik@gmail.com>
AuthorDate: 2022-10-19 07:43:54 +0000
Commit:     John Helmert III <ajak@gentoo.org>
CommitDate: 2022-10-19 14:14:43 +0000

    app-emulation/qemu-guest-agent: Avoid using strings binary
    
    The qemu's configure script (from which qemu-guest-agent is
    built) calls strings binary directly. This does not fly with
    cross compilation and was fixed upstream. Backport the fix.
    
    Bug: https://bugs.gentoo.org/876933
    Signed-off-by: Michal Privoznik <michal.privoznik@gmail.com>
    Signed-off-by: John Helmert III <ajak@gentoo.org>

 ....1.0-configure-Avoid-using-strings-binary.patch | 85 ++++++++++++++++++++++
 .../qemu-guest-agent/qemu-guest-agent-7.1.0.ebuild |  4 +
 2 files changed, 89 insertions(+)
Comment 10 Michal Prívozník 2022-10-20 02:22:13 UTC
(In reply to Michal Prívozník from comment #8)
> But if we were to bump the qemu version right now, we would hit it.

Actually, I was wrong here. What I did not realize is that qemu ebuild already had a patch to work around this problem. But now that this is fixed upstream, we can slowly ditch the patch.