Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 700898 - toolchain.eclass: BDEPEND should be used for EAPI=7
Summary: toolchain.eclass: BDEPEND should be used for EAPI=7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-11-21 18:50 UTC by David Michael
Modified: 2020-03-10 00:07 UTC (History)
1 user (show)

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


Attachments
Patch toolchain.eclass from Git (0001-toolchain.eclass-move-root-dependencies-to-BDEPEND.patch,1.27 KB, patch)
2020-03-08 15:48 UTC, David Michael
Details | Diff
Patch binutils from Git (0002-sys-devel-binutils-move-deps-to-BDEPEND-for-EAPI-7.patch,2.35 KB, patch)
2020-03-08 15:48 UTC, David Michael
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2019-11-21 18:50:49 UTC
This is a request to expand the EAPI 7 support in toolchain.eclass to implement BDEPEND.  It still has packages like bison, flex, and gettext in DEPEND for GCC when they are only needed in ROOT=/.

I would like to cross-compile a compiler in another root, and supporting BDEPEND will result in less things to build.

Note that I haven't actually tested this in Gentoo yet, so I may be missing something, but I'm basing this off the fact that it only uses those tools installed on the build system when cross-compiling toolchains manually.

Reproducible: Always




I would like to make the same request for binutils (where the latest version now has EAPI=7 without BDEPEND), but that issue is with the ebuild, not toolchain.eclass.  It looks like it will go to the same maintainers, so I didn't file multiple bugs, but let me know if that is preferred.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-21 21:47:55 UTC
Single bug is fine. Would you like to write a patch as well?

No need to handle everything in one go. We can do it in a few steps.

For binutils I suggest starting from binutils-9999.ebuild and not retrofit the changes to rest of ebuilds.

For toolchain.eclass it should be fine to change EAPI=7 behaviour.
Comment 2 David Michael 2019-11-22 05:55:54 UTC
For binutils, I tested the following.  (The 2.33.1 ebuild only differs from 9999 in the patchset and keywords.)

--- sys-devel/binutils/binutils-2.33.1.ebuild
+++ sys-devel/binutils/binutils-2.33.1.ebuild
@@ -73,7 +73,8 @@
 	>=sys-devel/binutils-config-3
 	sys-libs/zlib
 "
-DEPEND="${RDEPEND}
+DEPEND="${RDEPEND}"
+BDEPEND="
 	doc? ( sys-apps/texinfo )
 	test? ( dev-util/dejagnu )
 	nls? ( sys-devel/gettext )

For the eclass, I did something similar, but I ignored later dependencies that only apply to ROOT=/ for GCJ since the feature is not supported by any GCC versions using EAPI=7.

--- eclass/toolchain.eclass
+++ eclass/toolchain.eclass
@@ -225,7 +225,8 @@
 	fi
 fi
 
-DEPEND="${RDEPEND}
+DEPEND="${RDEPEND}"
+BDEPEND="
 	>=sys-devel/bison-1.875
 	>=sys-devel/flex-2.5.4
 	nls? ( sys-devel/gettext )
@@ -233,6 +234,7 @@ DEPEND="${RDEPEND}
 		>=dev-util/dejagnu-1.4.4
 		>=sys-devel/autogen-5.5.4
 	)"
+[[ ${EAPI:-0} == [0-6]* ]] && DEPEND+=" ${BDEPEND}"
 
 if tc_has_feature gcj ; then
 	GCJ_DEPS=">=media-libs/libart_lgpl-2.1"

It seems to work as expected for the latest versions of binutils and GCC when building native compilers, cross-compilers, and cross-compiled compilers with the affected USE flags enabled.  I haven't tried to build other versions yet.
Comment 3 David Michael 2020-03-08 15:48:02 UTC
Created attachment 617492 [details, diff]
Patch toolchain.eclass from Git
Comment 4 David Michael 2020-03-08 15:48:23 UTC
Created attachment 617494 [details, diff]
Patch binutils from Git
Comment 5 Larry the Git Cow gentoo-dev 2020-03-09 21:00:43 UTC
The bug has been referenced in the following commit(s):

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

commit 7781e2cb04272163e94521c2275027b8b2be0251
Author:     David Michael <fedora.dm0@gmail.com>
AuthorDate: 2020-03-08 15:45:06 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-03-09 21:00:36 +0000

    sys-devel/binutils: move deps to BDEPEND for EAPI 7
    
    Tweak only latest ~arch binutils-2.34.
    
    Bug: https://bugs.gentoo.org/700898
    Signed-off-by: David Michael <fedora.dm0@gmail.com>
    Package-Manager: Portage-2.3.89, Repoman-2.3.20
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-devel/binutils/binutils-2.34.ebuild | 3 ++-
 sys-devel/binutils/binutils-9999.ebuild | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Comment 6 David Michael 2020-03-09 21:17:35 UTC
Thanks for applying the binutils part.  I didn't think about sys-libs/binutils-libs originally since it isn't part of the compiler toolchain, but should it also move gettext to BDEPEND for consistency?
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-09 23:40:48 UTC
(In reply to David Michael from comment #6)
> Thanks for applying the binutils part.  I didn't think about
> sys-libs/binutils-libs originally since it isn't part of the compiler
> toolchain, but should it also move gettext to BDEPEND for consistency?

Yeah, that would make sense for both sys-libs/binutils-libs and sys-devel/binutils-hppa64.
Comment 8 Larry the Git Cow gentoo-dev 2020-03-09 23:57:26 UTC
The bug has been referenced in the following commit(s):

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

commit 4acf595771eaaceb14050a938f8e038c90149c15
Author:     David Michael <fedora.dm0@gmail.com>
AuthorDate: 2020-03-08 15:33:19 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-03-09 23:57:20 +0000

    toolchain.eclass: move --build dependencies to BDEPEND
    
    This allows cross-compiling comilers with a much smaller dependency set.
    
    Bug: https://bugs.gentoo.org/700898
    Signed-off-by: David Michael <fedora.dm0@gmail.com>
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/toolchain.eclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 9 Larry the Git Cow gentoo-dev 2020-03-10 00:05:39 UTC
The bug has been referenced in the following commit(s):

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

commit 439800fb8cc9b5b95f163a6329bbfe9a587ba7a7
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-03-10 00:05:17 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-03-10 00:05:33 +0000

    sys-libs/binutils-libs: move deps to BDEPEND for EAPI 7, bug #700898
    
    Tweak only latest ~arch binutils-libs-2.34.
    
    While at it dropped outdated blocker against gdb-7.10.
    
    Reported-by: David Michael
    Bug: https://bugs.gentoo.org/700898
    Package-Manager: Portage-2.3.93, Repoman-2.3.20
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-libs/binutils-libs/binutils-libs-2.34.ebuild | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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

commit 854abca0bdecb5efc0627aeb99f9f3e8299d8d65
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-03-10 00:01:07 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-03-10 00:05:33 +0000

    sys-devel/binutils-hppa64: move deps to BDEPEND for EAPI 7, bug #700898
    
    Tweak only latest ~arch binutils-hppa64-2.34.
    
    Reported-by: David Michael
    Bug: https://bugs.gentoo.org/700898
    Package-Manager: Portage-2.3.93, Repoman-2.3.20
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 sys-devel/binutils-hppa64/binutils-hppa64-2.34.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-10 00:07:06 UTC
Both gcc and binutils-* should be sorted now.

Thank you for the report and fixes!