Last Comment Bug 448573 - configure fails - can't parse "$GCC -v" and retrieve version number with French VC8
: configure fails - can't parse "$GCC -v" and retrieve version number with Fren...
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: mozilla16
Assigned To: Cameron McCormack (:heycam)
: Gregory Szorc [:gps]
Depends on:
Blocks: 767848
  Show dependency treegraph
Reported: 2008-07-30 13:14 PDT by Francis Robichaud
Modified: 2014-07-01 08:47 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix - supports any char instead of ' ' in the regex (2.48 KB, patch)
2008-07-31 13:55 PDT, Francis Robichaud
ted: review-
Details | Diff | Splinter Review
generated with autoconf2.13 on a linux system (318.60 KB, patch)
2008-07-31 13:56 PDT, Francis Robichaud
no flags Details | Diff | Splinter Review
tested regex (96.62 KB, image/png)
2008-08-07 18:13 PDT, Francis Robichaud
no flags Details
patch (852 bytes, patch)
2012-06-12 01:22 PDT, Cameron McCormack (:heycam)
ted: review+
Details | Diff | Splinter Review
patch v1.1 (2.62 KB, patch)
2012-06-21 18:22 PDT, Cameron McCormack (:heycam)
dmandelin: review+
Details | Diff | Splinter Review
patch to nspr (2.02 KB, patch)
2012-06-22 05:22 PDT, Cameron McCormack (:heycam)
no flags Details | Diff | Splinter Review
nsprpub-typo (1.16 KB, patch)
2012-06-24 06:06 PDT, Alphat-PC
no flags Details | Diff | Splinter Review

Description Francis Robichaud 2008-07-30 13:14:01 PDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2008073015 Minefield/3.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2008073015 Minefield/3.0.1

cl.exe -v outputs this:
"Compilateur d'optimisation Microsoft (R) 32 bits C/C++ version 14.00.50727.762 pour 80x86
Copyright (C) Microsoft Corporation. Tous droits réservés."

_CC_MAJOR_VERSION variable is empty and configure exits with message "configure: error: This version of the MSVC compiler, $CC_VERSION , is unsupported."
The installed version of Visual Studio is "Microsoft Visual Studio 2005 - Français"

replacing lines 3006 and 3013 respectively with:

Possible fix:
modify the _MSVC_VER_FILTER regex to support any language

Reproducible: Always

Expected Results:  
The right version number should be set for the CC_VERSION and CXX_VERSION variables.
Comment 1 Ted Mielczarek [:ted.mielczarek] 2008-07-30 13:46:08 PDT
I've seen this mentioned in the forums before, but I don't think it's ever been reported. I don't know what's actually failing here. Maybe you could figure out why that regex *doesn't* match the output you pasted there?
Comment 2 Francis Robichaud 2008-07-31 13:55:47 PDT
Created attachment 331858 [details] [diff] [review]
fix - supports any char instead of ' ' in the regex

I changed two regex used to parse the cl.exe, link.exe and mt.exe version numbers. They now rely on the word "version" (without the v) preceding the numbers.

On a french system, one or many 'ÿ' chars were printed between "version" and "14.00..." instead of an empty space. We can assume the "ersion" string won't be different on systems with other encodings/languages.
Comment 3 Francis Robichaud 2008-07-31 13:56:37 PDT
Created attachment 331859 [details] [diff] [review]
generated with autoconf2.13 on a linux system

@see attachment 331858 [details] [diff] [review]
Comment 4 Ted Mielczarek [:ted.mielczarek] 2008-07-31 15:21:33 PDT
Comment on attachment 331859 [details] [diff] [review]
generated with autoconf2.13 on a linux system

You don't need to submit patches to configure, is enough.
Comment 5 Ted Mielczarek [:ted.mielczarek] 2008-08-07 13:54:33 PDT
Comment on attachment 331858 [details] [diff] [review]
fix - supports any char instead of ' ' in the regex

I don't see how this regex can possibly work. You're trying to match "version 14.00.50727.762" with the regex ".*ersion[^0-9]+((?[0-9]+\.)*[0-9]+).*", which looks very wrong.
Comment 6 Francis Robichaud 2008-08-07 18:13:12 PDT
Created attachment 332868 [details]
tested regex

Regex works perfectly, it has been tested by building Firefox on a Windows machine. I also tested it didn't impact my Linux build.
You can test the regex at
The '?' char might be optional but i placed it there to ignore the grouping create by first set of parenthesis.

The regex works, you might want to try it out yourself at
Comment 7 Cameron McCormack (:heycam) 2012-06-12 00:59:08 PDT
I've had someone come to me with build problems with a French version of MSVC 2010 that is exactly this problem -- a ÿ character used just before the version number in the compiler's banner rather than a space.  ("ÿ" of course being Unicode character 255, which if interpreted in CP437 is a non-breaking space.)

I am having trouble exactly matching the ÿ, but how about we change the regular expression to allow a space or any non-ASCII character as the delimiter just before the version number?
Comment 8 Cameron McCormack (:heycam) 2012-06-12 01:22:17 PDT
Created attachment 632163 [details] [diff] [review]
Comment 9 Ted Mielczarek [:ted.mielczarek] 2012-06-18 12:00:47 PDT
Comment on attachment 632163 [details] [diff] [review]

Review of attachment 632163 [details] [diff] [review]:

@@ +678,4 @@
>          AC_LANG_RESTORE
>          changequote(,)
> +        _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'

I guess this is fine. Honestly, we probably don't need the space check at all. Matching 3-4 groups of numbers separated by periods is probably sufficient.

You'll need to make this change in js/src/ as well. It looks like NSPR's configure has this same check, but it doesn't explicitly error out for unrecognized versions, so you might not need to change that.
Comment 10 Cameron McCormack (:heycam) 2012-06-21 18:22:41 PDT
Created attachment 635560 [details] [diff] [review]
patch v1.1

OK.  There is some behaviour that switches depending on what the detected version is in nsprpub, so let's fix it there too.  I'll take your r+ as applying to the nsprpub/ too, and r?dmandelin for js/src/
Comment 11 Cameron McCormack (:heycam) 2012-06-21 18:56:12 PDT
Comment 12 Ted Mielczarek [:ted.mielczarek] 2012-06-22 05:08:28 PDT
Oh, I'm sorry, I wasn't clear. NSPR still lives in CVS, so we have to land the patch there and sync it back to m-c with a tagged revision. If you attach a separate NSPR patch I'll land it in CVS for you.
Comment 13 Ted Mielczarek [:ted.mielczarek] 2012-06-22 05:08:46 PDT
(Also my review is fine for js/src/ as well, it's all build system.)
Comment 14 Cameron McCormack (:heycam) 2012-06-22 05:22:39 PDT
Created attachment 635701 [details] [diff] [review]
patch to nspr

Oops, I think I knew that but forgot.  Good thing too, as I made a stupid c/p error in the original patch to nsprpub/  This one should be good.
Comment 15 Ed Morley [:emorley] 2012-06-22 09:17:19 PDT
Comment 16 Alphat-PC 2012-06-24 06:06:38 PDT
Created attachment 636152 [details] [diff] [review]

(In reply to Ed Morley [:edmorley] from comment #15)

There is a typographical error in nsprpub/
Comment 17 Cameron McCormack (:heycam) 2012-06-24 16:02:31 PDT
Ted, will the NSPR update and relanding in m-c happen soon, or should I fix up this nsprpub/ problem first?  (Not sure whether it is causing a problem at the moment.)
Comment 18 Alphat-PC 2012-06-24 17:51:26 PDT
MSC_VER is undefined!

MSC_VER is used in nsprpub/pr/src/misc/
$(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c
ifeq (,$(filter-out 1100 1200 1300 1310,$(MSC_VER)))
	$(CC) -Fo$@ -c $(CFLAGS) -Op $(call pr_abspath,$<)
	$(CC) -Fo$@ -c $(CFLAGS) -fp:precise $(call pr_abspath,$<)
Comment 19 Cameron McCormack (:heycam) 2012-06-24 18:08:48 PDT
Yeah, fair enough.  Filed bug 767848 to backout the nsprpub/ change.

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