Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 694460 - sys-devel/llvm pulls in dev-lang/perl and friends when cross-compiling
Summary: sys-devel/llvm pulls in dev-lang/perl and friends when cross-compiling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-15 09:40 UTC by tt_1
Modified: 2019-09-16 15:05 UTC (History)
1 user (show)

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


Attachments
patch for llvm-9.x and llvm-10.x (llvm-cross.patch,2.11 KB, patch)
2019-09-16 07:08 UTC, tt_1
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2019-09-15 09:40:48 UTC
description is below

Reproducible: Always

Steps to Reproduce:
1. setup cross-compiler
2. emerge-armv7a-unknown-linux-gnueabihf -av llvm
3. dev-lang/perl gets pulled in, alongside perl-cleaner and sys-apps/portage
Actual Results:  
the compile is going to stop at sys-apps/portage, as it still fails to cross-compile. 

Expected Results:  
none of those should get pulled in, they're not compile time dependencies:
 
[ebuild  N     ] sys-devel/llvm-common-8.0.1::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ 0 KiB
[ebuild  N     ] dev-libs/iniparser-3.1-r1::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ USE="-doc -examples -static-libs" 0 KiB
[ebuild  N     ] app-portage/portage-utils-0.74::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ USE="-nls -static" 0 KiB
[ebuild  N     ] dev-lang/perl-5.28.2-r1:0/5.28::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ USE="berkdb gdbm -debug -doc -ithreads" 0 KiB
[ebuild  N     ] app-admin/perl-cleaner-2.27::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ 0 KiB
[ebuild  N     ] virtual/perl-Data-Dumper-2.170.0::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ 0 KiB
[ebuild  N     ] virtual/perl-Test-Harness-3.420.0-r1::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ 0 KiB
[ebuild  N     ] perl-core/File-Temp-0.230.400-r1::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ 0 KiB
[ebuild  N     ] virtual/perl-File-Temp-0.230.400-r5::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ 0 KiB
[ebuild   R   *] sys-devel/llvm-9.0.0.9999:9::gentoo to /usr/armv7a-unknown-linux-gnueabihf/ USE="gold libffi ncurses -debug -doc -exegesis -libedit -test -xar -xml -z3" LLVM_TARGETS="(ARM) WebAssembly -AArch64 -AMDGPU -BPF -Hexagon -Lanai -MSP430 -Mips -NVPTX -PowerPC -RISCV -Sparc -SystemZ -X86 -XCore" 0 KiB

that's also true for llvm-common, strictly speaking it's a runtime dependency, needed on the hosts side.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-15 17:33:33 UTC
I'm not cross-compiling myself, so please supply a patch.
Comment 2 tt_1 2019-09-16 06:50:00 UTC
thanks for your fast answer, I'll provide a patch as soon as I can find the reason. It's a bit of a head scratcher though, moving dev-lang/perl to RDEPEND isn't working. 

Since llvm-9.x is EAPI=7, I might try to fix this via BDEPEND: 

https://dev.gentoo.org/~mgorny/articles/the-ultimate-guide-to-eapi-7.html#build-time-dependencies-split-into-depend-and-bdepend
Comment 3 tt_1 2019-09-16 07:08:49 UTC
Created attachment 589968 [details, diff]
patch for llvm-9.x and llvm-10.x

how about this?
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-16 09:56:23 UTC
It looks fine. Did you test that it works without perl installed in your chost tree?

There are probably more deps that need to be moved but one's still progress x).
Comment 5 tt_1 2019-09-16 12:08:18 UTC
Yes, I did test this right after your confirmation. 

I emerge llvm-9.0.9999 on the host, with the patch
I removed cross compiled chost tree and bootstraped it from scratch
I emerged llvm-9.0.9999 to the newly bootrstraped chost tree, with the patch

all of this went fine without any problem.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-16 12:12:48 UTC
I know the patch is kinda trivial but I'd use your Signed-off-by on it.
Comment 7 tt_1 2019-09-16 12:17:08 UTC
yeah, I'll bake one with correct sign-off in the evening.
Comment 8 Larry the Git Cow gentoo-dev 2019-09-16 15:05:32 UTC
The bug has been closed via the following commit(s):

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

commit 17d10010f7e4578ed704a2672c952b18f569727c
Author:     stefson <herrtimson@yahoo.de>
AuthorDate: 2019-09-16 07:00:02 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2019-09-16 15:05:27 +0000

    sys-devel/llvm: move dev-lang/perl to BDEPEND wrt #694460
    
    dev-lang/perl is a build time dependency of llvm, only during cross
    compile it must be run by the host (CBUILD) and not the target (CHOST).
    Moving it to BDEPEND solves the issue of dev-lang/perl and friends
    getting pulled into the dependency graph as compile time dependencies
    during cross compile. BDEPEND has been introduced in EAPI=7, so the fix
    is only possible for >=llvm-9.x
    
    Closes: https://bugs.gentoo.org/694460
    Signed-off-by: Steffen Kuhn <nielson2@yandex.com>
    Closes: https://github.com/gentoo/gentoo/pull/12941
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 sys-devel/llvm/llvm-10.0.0.9999.ebuild | 2 +-
 sys-devel/llvm/llvm-9.0.0.9999.ebuild  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)