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

Bug 891805

Summary: dev-libs/capstone: "next" patches required downstream
Product: Gentoo Linux Reporter: John Helmert III <ajak>
Component: Current packagesAssignee: mario.haustein
Status: RESOLVED FIXED    
Severity: normal CC: davidroman96, proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/31469
https://github.com/gentoo/gentoo/pull/31499
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Ebuild for capstone commit 12e8258f60647a997ffa72702a9e5b37bd622044
Ebuild for capstone commit 61cdc56159986e6d77be571b04c570cf2c378d13

Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-23 04:22:27 UTC
Radare2 in particular has started to depend on capstone-5 from the "next" upstream branch:

https://github.com/radareorg/radare2/issues/21204

Which is referring, I think, to this patch in particular:

https://github.com/capstone-engine/capstone/commit/bc583a7da3008dd010e64f8cb517aeda2b58e281

And then I hit it when working on bumping radare2: 

https://github.com/gentoo/gentoo/pull/29223

So, I'm wondering who's wrong here. Should Gentoo not have a capstone release candidate as stable? Should we add patches on top of capstone-5 for the reverse dependencies that depend on them? In the short term, we can obviously
Comment 1 Larry the Git Cow gentoo-dev 2023-01-23 04:32:48 UTC
The bug has been referenced in the following commit(s):

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

commit 309640e8da12494bdc227e238bdbd7435cb415f9
Author:     John Helmert III <ajak@gentoo.org>
AuthorDate: 2023-01-23 03:38:19 +0000
Commit:     John Helmert III <ajak@gentoo.org>
CommitDate: 2023-01-23 04:32:34 +0000

    dev-util/radare2: add 5.8.2
    
    Unbundle capstone to avoid upstream requirement of capstone-5 patches
    which are not shipped in Gentoo's capstone package.
    
    Bug: https://bugs.gentoo.org/885395
    Bug: https://bugs.gentoo.org/889026
    Bug: https://bugs.gentoo.org/891805
    Closes: https://github.com/gentoo/gentoo/pull/29223
    Signed-off-by: John Helmert III <ajak@gentoo.org>

 dev-util/radare2/Manifest                          |   5 +
 .../files/radare2-5.8.2-bundled-capstone.patch     |  21 ++++
 .../radare2/files/radare2-5.8.2-vector35.patch     |  24 ++++
 dev-util/radare2/radare2-5.8.2.ebuild              | 125 +++++++++++++++++++++
 4 files changed, 175 insertions(+)
Comment 2 mario.haustein 2023-02-25 09:16:54 UTC
Created attachment 854544 [details]
Ebuild for capstone commit 12e8258f60647a997ffa72702a9e5b37bd622044

From https://github.com/radareorg/radare2/issues/21204 it seems radare2 only builds against specific commits of capstone. I extracted the commit 12e8258f60647a997ffa72702a9e5b37bd622044 from the build scripts and prepared the attached ebuild.

@ajak: Can you confirm radare2 builds against this capstone version? If so I will publish it and you have to pinpoint it in the radare2 ebuilds.
Comment 3 mario.haustein 2023-03-16 17:13:57 UTC
Created attachment 858015 [details]
Ebuild for capstone commit 61cdc56159986e6d77be571b04c570cf2c378d13

@ajak: Attached you will find a capstone ebuild suitable for radare 5.8.4 (Capstone commit 61cdc56159986e6d77be571b04c570cf2c378d13). Please check if it works and I will commit it to the tree.
Comment 4 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-05-28 17:27:18 UTC
Hi Mario, I apologize for the delay in responding.

It does seem that radare-5.8.{2,6} are able to compile with your capstone-5.0_rc2-r4. But is this really what we want to do? There seem to breaking changes in the next branch, which other revdeps of capstone shouldn't be subject to?
Comment 5 mario.haustein 2023-06-15 20:09:43 UTC
(In reply to John Helmert III from comment #4)
> There seem to
> breaking changes in the next branch, which other revdeps of capstone
> shouldn't be subject to?

AFAIK capstone isn't introducing breaking changes, but Radare2 just requires unreleased features from capstone. So using a newer version of capstone should be safe.

I prepared a pull request adding the required capstone versions and added the required dependencies to Radare2. See: https://github.com/gentoo/gentoo/pull/31469. Please review and tell if you agree with it.
Comment 6 mario.haustein 2023-06-17 08:17:46 UTC
Capstone published a new release candidate today which is a suitable dependency for Radare2 (see https://github.com/gentoo/gentoo/pull/31499).
Comment 7 Larry the Git Cow gentoo-dev 2023-06-18 19:02:12 UTC
The bug has been referenced in the following commit(s):

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

commit 34ac96b281fbbf9c2d22133a3b32136e3884b24e
Author:     John Helmert III <ajak@gentoo.org>
AuthorDate: 2023-06-18 18:58:37 +0000
Commit:     John Helmert III <ajak@gentoo.org>
CommitDate: 2023-06-18 19:02:00 +0000

    dev-util/radare2: use system capstone
    
    Bug: https://bugs.gentoo.org/891805
    Signed-off-by: John Helmert III <ajak@gentoo.org>

 dev-util/radare2/radare2-5.8.8-r1.ebuild | 121 +++++++++++++++++++++++++++++++
 1 file changed, 121 insertions(+)
Comment 8 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-06-18 19:02:43 UTC
Thanks for handling this! Anything else needed before closing this bug, you think?
Comment 9 mario.haustein 2023-06-18 20:57:39 UTC
Nothing to be done left