Closed Bug 1160125 Opened 9 years ago Closed 9 years ago

MSVC version detection is broken CC is set to a wrapper (like sccache)

Categories

(NSPR :: NSPR, defect, P2)

x86
Windows
defect

Tracking

(Not tracked)

RESOLVED FIXED
4.10.9

People

(Reporter: jacek, Assigned: jacek)

References

Details

Attachments

(2 files)

Attached patch fixSplinter Review
I discovered it when working on bug 856404. MSVC version detection is broken when CC is set to a wrapper script, which means that current m-c builds get it wrong, because official builds use sccache. CC is set like this:

CC=python2.7 c:/builds/moz2_slave/try-w32-d-00000000000000000000/build/src/sccache/sccache.py cl

And version detection is based on such invocation:

CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`

Note the quoting. The whole value of CC will be interpreted as a single file name. "${CC}" -v returns something like:

c:/builds/moz2_slave/try-w32-d-00000000000000000000/build/src/nsprpub/configure: line 7097: python2.7 c:/builds/moz2_slave/try-w32-d-00000000000000000000/build/src/sccache/sccache.py cl: No such file or directory

The whole build works only by accident, because following errors are not critical.

The simple and least invasive fix is dropping quotes around ${CC}. I think that's how it's interpreted in every other place, so it should be safe. The attached patch also adds a simple check to ensure that version is detected to avoid such problems in the future.
Attachment #8599843 - Flags: review?(ted)
Attachment #8599843 - Flags: review?(ted) → review+
Thanks for the review.
Attachment #8604070 - Flags: checked-in?
Keywords: checkin-needed
Whiteboard: [NSPR checkin]
wtc, can you please help get this NSPR patch landed?
Flags: needinfo?(wtc)
Comment on attachment 8604070 [details] [diff] [review]
patch for checkin

Review of attachment 8604070 [details] [diff] [review]:
-----------------------------------------------------------------

Patch checked in: https://hg.mozilla.org/projects/nspr/rev/c4194dc04aa5
Attachment #8604070 - Flags: review+
Attachment #8604070 - Flags: checked-in?
Attachment #8604070 - Flags: checked-in+
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(wtc)
Keywords: checkin-needed
Priority: -- → P2
Resolution: --- → FIXED
Whiteboard: [NSPR checkin]
Target Milestone: --- → 4.10.9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: