Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 629776 - sys-devel/kgcc64: uses unavailable FILESDIR: Cannot find $EPATCH_SOURCE!
Summary: sys-devel/kgcc64: uses unavailable FILESDIR: Cannot find $EPATCH_SOURCE!
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-03 15:11 UTC by Michał Górny
Modified: 2017-09-16 09:40 UTC (History)
3 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-09-03 15:11:47 UTC
[16:54:14] <[Arfrever]> sys-devel/kgcc64/kgcc64-6.3.0.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}

This makes very wrong assumptions about FILESDIR which are no longer true for the recent versions of Portage, i.e. it's completely broken.

And no, you *can't* access FILESDIR of another package. Ever.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2017-09-03 15:16:35 UTC
sys-devel/kgcc64/kgcc64-3.4.6.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.1.2.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.2.4.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.3.5.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.4.5.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.4.6.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.5.3.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.5.4.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.6.4.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.7.3.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.7.4.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.8.3.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.8.5.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-4.9.4.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
sys-devel/kgcc64/kgcc64-5.4.0.ebuild:GCC_FILESDIR=${FILESDIR/${PN}/gcc}
Comment 2 Rolf Eike Beer archtester 2017-09-15 17:18:11 UTC
I guess this is the reason for that:

 * Fixing misc issues in configure files

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 * 
 *   /var/tmp/portage/sys-devel/gcc-6.3.0/files/gcc-configure-texinfo.patch
 *   ( gcc-configure-texinfo.patch )

 * ERROR: sys-devel/kgcc64-6.3.0::gentoo failed (prepare phase):
 *   Cannot find $EPATCH_SOURCE!
 * 
 * Call stack:
 *     ebuild.sh, line  115:  Called src_prepare
 *   environment, line 3415:  Called toolchain_src_prepare
 *   environment, line 4773:  Called epatch '/var/tmp/portage/sys-devel/gcc-6.3.0/files/gcc-configure-texinfo.patch'
 *   environment, line  942:  Called die
 * The specific snippet of code:
 *                   die "Cannot find \$EPATCH_SOURCE!";
 *
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2017-09-15 21:16:39 UTC
Now we either need to push files out to a separate patchset or copy files.

Both options increase maintenance burden.
Comment 4 Ulrich Müller gentoo-dev 2017-09-16 07:53:00 UTC
PMS reference: https://projects.gentoo.org/pms/6/pms.html

   FILESDIR
   The full path to a directory where the files from the package’s files
   directory (used for small support files or patches) are available.

Note that it says "the package's files directory", not other packages' files directories. Accessing the latter via FILESDIR was never guaranteed.


(In reply to Sergei Trofimovich from comment #3)
> Now we either need to push files out to a separate patchset or copy files.
> 
> Both options increase maintenance burden.

Can't you simply copy the handful of files that are referenced via GCC_FILESDIR in toolchain.eclass? "git log sys-devel/gcc/files" shows that the last relevant commit there (other than trivial changes like cleanups) was in 2014, so I think the maintenance burden would not be so large.
Comment 5 Larry the Git Cow gentoo-dev 2017-09-16 09:25:18 UTC
The bug has been referenced in the following commit(s):

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

commit b45b015b5e6e17a5f229e6bc67455563f4af7af0
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2017-09-16 08:43:11 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2017-09-16 09:25:08 +0000

    sys-devel/kgcc64: drop GCC_FILESDIR override, bug #629776
    
    GCC_FILESDIR support was broken by portage-2.3.6 commit:
        https://github.com/gentoo/portage/commit/0637c95545ab7dc0bb5d091de221b9e99e2cf5b2
    ("portage.package.ebuild: Use a fake FILESDIR to catch invalid accesses")
    
    Unfortunately it was applied to older EAPIs without fixing all
    the users first.
    
    The change yanks GCC_FILESDIR override support and copies
    FILESDIR files used by toolchain.eclass in crosscompilation
    mode only (kgcc does not support native builds)
    
    Bug: https://bugs.gentoo.org/629776
    Package-Manager: Portage-2.3.8, Repoman-2.3.3

 .../files/4.1.0/gcc-4.1.0-cross-compile.patch      | 40 ++++++++++++++
 sys-devel/kgcc64/files/gcc-configure-LANG.patch    | 64 ++++++++++++++++++++++
 sys-devel/kgcc64/files/gcc-configure-texinfo.patch | 16 ++++++
 sys-devel/kgcc64/kgcc64-3.4.6.ebuild               |  9 ++-
 sys-devel/kgcc64/kgcc64-4.1.2.ebuild               |  5 +-
 sys-devel/kgcc64/kgcc64-4.2.4.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.3.5.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.4.5.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.4.6.ebuild               |  1 -
 sys-devel/kgcc64/kgcc64-4.5.3.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.5.4.ebuild               |  1 -
 sys-devel/kgcc64/kgcc64-4.6.4.ebuild               |  1 -
 sys-devel/kgcc64/kgcc64-4.7.3.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.7.4.ebuild               |  1 -
 sys-devel/kgcc64/kgcc64-4.8.3.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.8.5.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-4.9.4.ebuild               |  3 +-
 sys-devel/kgcc64/kgcc64-5.4.0.ebuild               |  1 -
 sys-devel/kgcc64/kgcc64-6.3.0.ebuild               |  1 -
 19 files changed, 134 insertions(+), 30 deletions(-)

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

commit b4c07795243ba2e56fe44b52811b9b5a3fcbefed
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2017-09-16 08:30:07 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2017-09-16 09:25:08 +0000

    dev-lang/gnat-gpl: drop GCC_FILESDIR reference in comments, bug #629776
    
    Bug: https://bugs.gentoo.org/629776
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 dev-lang/gnat-gpl/gnat-gpl-2016.ebuild | 1 -
 1 file changed, 1 deletion(-)

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

commit 759375bb1704a2bd28888dfe2714e19828e8a6e3
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2017-09-16 08:22:35 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2017-09-16 09:25:07 +0000

    toolchain.eclass: drop GCC_FILESDIR override,  bug #629776
    
    GCC_FILESDIR support was broken by portage-2.3.6 commit:
        https://github.com/gentoo/portage/commit/0637c95545ab7dc0bb5d091de221b9e99e2cf5b2
    ("portage.package.ebuild: Use a fake FILESDIR to catch invalid accesses")
    
    Unfortunately it was applied to older EAPIs without fixing all
    the users first.
    
    The change yanks GCC_FILESDIR override support and hardcodes
    FILESDIR usage (as all the ebuilds except 'gcc' are broken anyway).
    
    Bug: https://bugs.gentoo.org/629776
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/toolchain.eclass | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)}
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2017-09-16 09:40:23 UTC
I'd appreciate if knowingly breaking changes for ::gentoo  would go into
newer EAPI handling code in portage and only cause warning for older EAPI
(if easily possible).

Especially if user-facing documentation changes with applied change.

Fixing stable toolchain ebuilds (especially the ones responsible for building kernels) retroactively is fragile.