Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417291 - sys-devel/gcc-config: CHOST should fall back when `portageq` fails
Summary: sys-devel/gcc-config: CHOST should fall back when `portageq` fails
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-05-23 18:42 UTC by Andrew Church
Modified: 2012-06-01 05:24 UTC (History)
0 users

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


Attachments
Patch to gcc-config to fix fallback (gcc-config-chost-fix.patch,526 bytes, patch)
2012-05-23 18:44 UTC, Andrew Church
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Church 2012-05-23 18:42:25 UTC
gcc-config fails to fall back to manual CHOST detection if Python is installed and working but portageq is broken.

Reproducible: Always

Steps to Reproduce:
$ sudo chmod 0 /etc/portage/package.keywords  # to break portageq for non-root
$ gcc-config -l
Actual Results:  
 * gcc-config: Could not get portage CHOST!
 * gcc-config: You should verify that CHOST is set in one of these places:
 * gcc-config:  - //etc/portage/make.conf
 * gcc-config:  - active environment

Expected Results:  
gcc-config lists the installed configurations.

If anything under /etc/portage is unreadable by the effective user, portageq will die with a PermissionDenied exception.  This should probably be treated the same way as Python breakage and fall back to the manual search (as the error message suggests it will do).

Patch to come.
Comment 1 Andrew Church 2012-05-23 18:44:39 UTC
Created attachment 312863 [details, diff]
Patch to gcc-config to fix fallback
Comment 2 SpanKY gentoo-dev 2012-05-24 01:54:16 UTC
i don't know about this.  do you have any legitimate cases where this happens ?
Comment 3 Andrew Church 2012-05-24 15:44:32 UTC
I came across this problem because mingw32-gcc failed, but it looks like that was caused by not updating the current compiler after emerge --depclean.  So no, I don't currently have a case where this breaks anything.
Comment 4 SpanKY gentoo-dev 2012-06-01 05:24:28 UTC
i filed bug 418475 for making portageq/etc... more resilient.  no reason those files being inaccessible as non-root would keep them from providing useful info.