Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 218131 - gcc version used in compile no longer detectable in emerged package information
Summary: gcc version used in compile no longer detectable in emerged package information
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 238048 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-17 16:33 UTC by DrChandra the Gentoo Person
Modified: 2017-06-14 05:37 UTC (History)
2 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 DrChandra the Gentoo Person 2008-04-17 16:33:01 UTC
In version of portage leading up to 2.1.4, it was possible to detect the version
of gcc that was used to compile each package. Running this from with /var/db/pkg
/$category/$packagename-$version directory would find the gcc version:

bzcat environment.bz2 | awk '/^PATH/ && /gcc-bin/ && !/declare/ { print substr($0, match($0, /gcc-bin/) + 8, 5); exit }'

When portage 2.1.4 was emerged on my systems, this stopped working. The gcc version appears nowhere in any of the information saved in /var/db/pkg.

Would it be possible to have the pkg_compile method set something like "GCC_VERSION=4.1.2" as it does the compile, so that this is captured into environment.bz2?


Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2008-04-17 18:00:03 UTC
I guess we can have portage export it. It would be a bit nicer if we could fit it into one of the toolchain eclasses somehow, but maybe that won't be able to cover all the necessary cases.
Comment 2 SpanKY gentoo-dev 2008-04-17 18:26:14 UTC
i'm not sure putting into a toolchain eclass would work as then every ebuild out there would have to explicitly inherit it :/

if you're looking to simply setup some dummy vars for users to hook off of via a sneaky backdoor, then it should be 4 fold:
PORTAGE_CC_VERSION=$(${CC:-gcc} --version | head -n1)
PORTAGE_CBUILD_VERSION=$(${CBUILD}${CBUILD+-}${CC:-gcc} --version | head -n1)
PORTAGE_CHOST_VERSION=$(${CHOST}${CHOST+-}${CC:-gcc} --version | head -n1)
PORTAGE_CTARGET_VERSION=$(${CTARGET}${CTARGET+-}${CC:-gcc} --version | head -n1)
Comment 3 Zac Medico gentoo-dev 2008-09-18 23:38:38 UTC
*** Bug 238048 has been marked as a duplicate of this bug. ***
Comment 4 Mark Loeser (RETIRED) gentoo-dev 2009-07-03 23:24:51 UTC
Nothing for toolchain to do here...
Comment 5 Toralf Förster gentoo-dev 2015-12-21 09:43:09 UTC
With gcc-5.3.0 being unstable now the question rises here again how to include that info into "emerge --info"