Bug 834425 - GPRbuild fails to find GCC in some locales.
GPRbuild fails to find GCC in some locales.
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: gprbuild (Show other bugs)
19
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Pavel Zhukov
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-21 16:35 EDT by Julian Leyh
Modified: 2014-10-11 18:22 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-11 18:22:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
attached patch for gprbuild.spec (1.23 KB, patch)
2012-06-21 16:35 EDT, Julian Leyh
no flags Details | Diff
remove rpath (496 bytes, patch)
2012-06-21 16:36 EDT, Julian Leyh
no flags Details | Diff
fix version parsing for non-English locales (1.69 KB, patch)
2012-06-21 16:36 EDT, Julian Leyh
no flags Details | Diff
Git patch for the f19 branch (3.61 KB, patch)
2013-12-03 11:52 EST, Björn Persson
no flags Details | Diff
Git patch for the master branch (3.53 KB, patch)
2013-12-03 11:52 EST, Björn Persson
no flags Details | Diff
Git patch for the f19 branch (3.53 KB, patch)
2013-12-03 12:02 EST, Björn Persson
no flags Details | Diff
Git patch for the master branch (3.61 KB, patch)
2013-12-03 12:04 EST, Björn Persson
no flags Details | Diff

  None (edit)
Description Julian Leyh 2012-06-21 16:35:31 EDT
Created attachment 593584 [details]
attached patch for gprbuild.spec

Description of problem:

gprbuild creates configurations using rpath for the linker.
Additionally, it is broken for non-English locales, since it parses "gcc -v" output and not "gcc -dumpversion".

Version-Release number of selected component (if applicable):

2011-3

How reproducible:

rpath: look into generated cgpr
locale: LC_ALL=de_DE.UTF-8 gprversion

Steps to Reproduce:
1. run gprbuild on some project
2. grep rpath obj/auto.cgpr
3. run LC_ALL=de_DE.UTF-8 gprversion
  
Actual results:

step 2:
   for Run_Path_Option  use ("-Wl,-z,origin,-rpath,");
step 3:
Invalid setup of the gprconfig knowledge base
Exit code: 4

Expected results:

no rpath, working with different locales

Additional info:
Comment 1 Julian Leyh 2012-06-21 16:36:08 EDT
Created attachment 593585 [details]
remove rpath
Comment 2 Julian Leyh 2012-06-21 16:36:36 EDT
Created attachment 593586 [details]
fix version parsing for non-English locales
Comment 3 Pavel Zhukov (IBM) 2012-06-22 02:12:40 EDT
Thank you for your bug report. 
Probably I've lost gprbuild-gccversion.patch while updating to 2011. Besides, I've sent this patch to AdaCore already.
Comment 4 Fedora Update System 2012-06-24 14:57:59 EDT
gprbuild-2011-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gprbuild-2011-4.fc17
Comment 5 Björn Persson 2012-06-24 18:20:45 EDT
(In reply to comment #1)
> Created attachment 593585 [details]
> remove rpath

What does this patch do? Does it completely disable GPRbuild's ability to embed runpaths in binaries, even when it's not a Fedora package being built? Does it do a better job than the -R option?
Comment 6 Pavel Zhukov (IBM) 2012-06-25 02:21:47 EDT
I prefer use -R or chrpath. 
So I'm going to testing gprbuild-2011-4 with other packages and accept or delete patch.
Comment 7 Fedora Update System 2012-06-25 20:48:24 EDT
Package gprbuild-2011-4.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gprbuild-2011-4.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9890/gprbuild-2011-4.fc17
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2012-08-09 19:24:56 EDT
gprbuild-2011-4.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Björn Persson 2013-12-03 11:50:13 EST
The problem with getting the GCC version still exists in GPRbuild 2012 and 2013. In at least the locales fi_FI.UTF-8 and de_DE.UTF-8 it fails to find GCC and claims that "libraries are not supported on this platform".

Please restore the gccversion patch.
Comment 10 Björn Persson 2013-12-03 11:52:04 EST
Created attachment 832212 [details]
Git patch for the f19 branch
Comment 11 Björn Persson 2013-12-03 11:52:35 EST
Created attachment 832213 [details]
Git patch for the master branch
Comment 12 Björn Persson 2013-12-03 12:02:24 EST
Created attachment 832214 [details]
Git patch for the f19 branch
Comment 13 Björn Persson 2013-12-03 12:04:10 EST
Created attachment 832215 [details]
Git patch for the master branch

I mixed up the patches. Now they're labelled correctly. Sorry.
Comment 14 Pavel Zhukov 2013-12-03 15:19:17 EST
Bjorn, 
Thank you for the patch. 

for me it looks like a bug in gcc localization, not in gprbuild. Unfortunately I'm not familiar with German and Finish languages but gcc-Version and gcc-versio doesn't look as translation of "gcc version"... 

The original regexp filters all non-gcc compilers out which "could" use gcc alias for compatibility for example but -dumpversion doesn't contain any compiler name string at all. Are some raises possible here? Is something like "^gcc[^\s]\S+ (\S+)" could be less dangerous here?
Comment 15 Björn Persson 2013-12-04 05:32:55 EST
German is famous for its compound words but it can't match Finnish. In English "gcc version 4.8.2" can be read either as "This is GCC. Specifically, it's version 4.8.2." or as "The GCC version is 4.8.2.". In the latter case "gcc version" is a compound and the only problem with the German translation is that it doesn't spell "GCC" with capitals. The Swedish translator seems to have chosen the first interpretation. Otherwise I would have had this problem too.

Vietnamese (vi_VN) appears to express "version" in two words:
"gcc phiên bản 4.8.2 20131017 (Red Hat 4.8.2-1) (GCC)"
The current pattern will select "bản" as the version.

Parsing text that's intended for human consumption is inherently unreliable, and trying to do it with localized text is just crazy. If gcc -v is a stable API, then the documentation should tell how its output can be parsed reliably. Otherwise, if -dumpversion isn't acceptable, then the only way this can become anywhere near reliable is to have GPRbuild set the locale to "C" in the subprocess.

Note You need to log in before you can comment on or make changes to this bug.