Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 137909 - crossdev chooses bad keywords
Summary: crossdev chooses bad keywords
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 137911 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-25 01:24 UTC by Torsten Kaiser
Modified: 2007-07-28 07:14 UTC (History)
0 users

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 Torsten Kaiser 2006-06-25 01:24:01 UTC
I was trying to build an arm-softfloat-linux-gnu toolchain, but using the command 'crossdev -t arm-softfloat-linux-gnu' tried to use versions of gcc and glibc that where not suitable for arm.

The problem is, that in my make.conf I had KEYWORDS="~x86", as that was my unstable x86 test system.
crossdev then added in packages.keywords the arm and ~arm keywords for the packages from the cross-arm-softfloat-linux-gnu.
But when doing the emerge of the crosstoolchain, emerge still used the gcc/glibc with the higher version that only had the ~x86 keyword.

In my opinion crossdev should have added -x86 and -~x86 to its packages.keywords to prevent this from happening.
(Or -ppc and -~pcc in case of an pcc hostsystem, etc...)

This is especially important for arm, as no gcc-4 and no glibc-2.4 has an arm keyword. But alpha and sparc will have the same problems.


Not really related feature request:
a --stable option for crossdev that only adds the stable keywords to package.keywords.
Comment 1 Torsten Kaiser 2006-06-25 01:51:39 UTC
*** Bug 137911 has been marked as a duplicate of this bug. ***
Comment 2 SpanKY gentoo-dev 2006-06-25 02:22:29 UTC
specify the versions yourself using --l / --g
Comment 3 Torsten Kaiser 2006-06-25 06:20:45 UTC
Could you please explain, why this was marked WONTFIX?

I understand marking my --stable request as WONTFIX, but my main concern was, that the default of crossdev is definitely broken.

The default is using --latest for all packages, but instead of using the latest keyworded version of the target architecture, crossdev will use the highest version of either the target or the host architecture.
This is NOT a good choice, as trying to build an arm cross toolchain can easily demonstrate. I think this is even the worst choice crossdev can use.

Possible choices for --lastest are:

a) highest version of target or host
b) highest version of target
c) highest version of host
d) highest version, that is available on target and host

a) is used right now.
This can easily break with any packages that has problems on EITHER the host or the target architecture. That why I call the current choice the worst behavior.
b) Might break, if the version is not working on the host.
That would be my short term choice, as that breakage is the easiest to detect (already on the host, before coping to the target, I would even expect that this is only relevant for gcc).
Also the implementation should be trivial, as only the logic in crossdev that adds the keywords of the cross-xxx packages needs to be modified.
c) Would be even simpler to implement. Just remove the part of crossdev that adds the keywords to packages.keywords.
But I would prefer b) because this might break in ways that only show up later on the target machine.
d) Might be the safest way, but I do not know of a way to make portage check two keywords. So a change in portage might be needed and that might not worth it. (Maybe it would be simpler to make crossdev use package.mask to mark know good or bad combinations)

So in the light, that I think the current behavior is worst possible I cant understand the WONTFIX. I would understand to mark the solution d) as LATER maybe even WONTFIX, but please explain why my request for b) was marked WONTFIX, even if the current default is horribly broken?
Comment 4 SpanKY gentoo-dev 2006-06-25 09:26:07 UTC
portage does not easily support cross-compiling at the moment ... much of the work ive done is abusing the way portage works internally

i'm not about to add some ebuild parsers to crossdev

you can easily work around the issue on your side by specifying --l/--g/etc...
Comment 5 Torsten Kaiser 2006-06-25 12:02:19 UTC
I did not ask to add an ebuild parser to crossdev.

I asked to instead of adding the following to packages.keywords:
cross-$TARGET/$PACKAGE $TARGETARCH ~$TARGETARCH

just add:
cross-$TARGET/$PACKAGE $TARGETARCH ~$TARGETARCH -$HOSTARCH ~-$HOSTARCH

No change to portage needed.
All the code to add things to packages.keywords is already persent and used in crossdev.
With $TARGET I mean things like arm-softfloat-linux-gnu, with $PACKAGE binutils/ gcc/ glibc etc, with $TARGETARCH/ $HOSTARCH the portage-keywords of the host or targetsystem.
Example (for x86 host):
crossdev -t arm-softfloat-linux-gnu will add:
cross-arm-softfloat-linux-gnu/binutils arm ~arm
cross-arm-softfloat-linux-gnu/gcc arm ~arm
cross-arm-softfloat-linux-gnu/linux-headers arm ~arm
cross-arm-softfloat-linux-gnu/glibc arm ~arm
cross-arm-softfloat-linux-gnu/gdb arm ~arm

But I think adding that would be better:
cross-arm-softfloat-linux-gnu/binutils arm ~arm -x86 -~x86
cross-arm-softfloat-linux-gnu/gcc arm ~arm -x86 -~x86
cross-arm-softfloat-linux-gnu/linux-headers arm ~arm -x86 -~x86
cross-arm-softfloat-linux-gnu/glibc arm ~arm -x86 -~x86
cross-arm-softfloat-linux-gnu/gdb arm ~arm -x86 -~x86

And this will prevent the default breakage of trying to emerge gcc-4 or glibc-2.4 for arm/alpha/sparc where these packages are not keyworded WITHOUT the need to parse ebuild OR modify portage.

What I mean is this patch:

--- crossdev.org        2006-06-25 20:53:45.284352200 +0200
+++ crossdev    2006-06-25 20:54:22.638332822 +0200
@@ -440,7 +440,7 @@
        [[ -z ${pkg} ]] && return 0
        sed -i -e "/^cross-${CTARGET}\/${pkg} /d" package.keywords
        if [[ ${ver} == "[latest]" ]] || [[ -z ${ver} ]] ; then
-               echo "cross-${CTARGET}/${pkg} $TARCH ~$TARCH" >> package.keywords
+               echo "cross-${CTARGET}/${pkg} $TARCH ~$TARCH -$HARCH -~$HARCH" >> package.keywords
        else
                sed -i -e "/cross-${CTARGET}\/${pkg}/d" package.mask
                echo ">cross-${CTARGET}/${pkg}-${ver}" >> package.mask


But I'm not sure, if this is 100% the right thing, because I do not have enough knowledge of the portage internals.

Yes, I know I can use -l/-g to fix the problem for me, but it would still be better if crossdev would default to something usefull...
Comment 6 genbug 2007-07-28 07:14:58 UTC
cross-arm-unknown-linux-gnu/binutils arm ~arm -x86 -~x86
cross-arm-unknown-linux-gnu/gcc arm ~arm -x86 -~x86
cross-arm-unknown-linux-gnu/linux-headers arm ~arm -x86 -~x86
cross-arm-unknown-linux-gnu/glibc arm ~arm -x86 -~x86
cross-arm-unknown-linux-gnu/gdb arm ~arm -x86 -~x86

seemed like a good idea but it didnot stop it compiling 4.2 here.