As a security precaution, we have turned on the setting "Require API key authentication for API requests" for everyone. If this has broken something, please contact bugzilla-admin@mozilla.org
Last Comment Bug 687225 - configure does not detect MSVC 2011 compiler
: configure does not detect MSVC 2011 compiler
Status: RESOLVED FIXED
fixed-in-bs
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: All Windows 8
: -- normal (vote)
: mozilla10
Assigned To: Gregory Szorc [:gps]
:
: Gregory Szorc [:gps]
Mentors:
Depends on: 696422
Blocks: VC11 707021
  Show dependency treegraph
 
Reported: 2011-09-16 22:41 PDT by Gregory Szorc [:gps]
Modified: 2011-12-01 16:09 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Detect MSVC2011 Compiler in configure (2.09 KB, patch)
2011-09-16 23:10 PDT, Gregory Szorc [:gps]
ted: review+
Details | Diff | Splinter Review
Detect MSVC2011 Compiler in configure, v2 (5.67 KB, patch)
2011-10-02 17:10 PDT, Gregory Szorc [:gps]
ted: review+
Details | Diff | Splinter Review
Detect MSVC2011 in configure, v3 (6.23 KB, patch)
2011-10-03 21:57 PDT, Gregory Szorc [:gps]
bugspam.Callek: review+
Details | Diff | Splinter Review

Description User image Gregory Szorc [:gps] 2011-09-16 22:41:34 PDT
I'm trying to build mozilla-central on Windows 8 with the Visual Studio 2011 toolchain and am getting the following error when running configure:

checking for strip... no
checking for windres... no
checking for midl... midl
configure: error: This version (17.00.40825.2) of the MSVC compiler is unsupport
ed. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.
*** Fix above errors and then restart with               "c:/mozilla-build/pytho
n/python.exe c:/dev/mozilla-central/build/pymake/pymake/../make.py -f client.mk
build"
c:\dev\mozilla-central\client.mk:315:0: command 'cd obj-i686-pc-mingw32 &&   c:/
dev/mozilla-central/configure  \
  || ( echo "*** Fix above errors and then restart with\
               \"c:/mozilla-build/python/python.exe c:/dev/mozilla-central/build
/pymake/pymake/../make.py -f client.mk build\"" && exit 1 )' failed, return code
 1

I'll likely have a patch in a few minutes...
Comment 1 User image Gregory Szorc [:gps] 2011-09-16 23:10:56 PDT
Created attachment 560677 [details] [diff] [review]
Detect MSVC2011 Compiler in configure

This (trivial) patch detects the MSVC 2011 compiler in configure.

When applied, `make.py -f client.mk configure` works! (Although, there still might be a few warnings related to Windows 8/MSVC 2011 in there.) But, at least this patch unblocks on Windows 8 compiling.
Comment 2 User image Mike Hommey [:glandium] 2011-09-17 01:56:22 PDT
You also need to fix
*/installer/package-manifest.in
and
*/installer/removed-files.in
for the corresponding CRT.
Comment 3 User image Mike Hommey [:glandium] 2011-09-17 01:57:18 PDT
And I forgot toolkit/mozapps/installer/packager.mk, too
Comment 4 User image Gregory Szorc [:gps] 2011-09-17 10:03:47 PDT
Ahh, good catch. I didn't realize those existed.

My compilation hasn't yet reached the installer phase. I could incorporate those into the patch easily enough or I can create a part 2 once compilation gets that far.
Comment 5 User image Mike Hommey [:glandium] 2011-09-17 10:15:46 PDT
Oh, and you made me remember of yet another one: build/win32/Makefile.in. Man, we really need to group that.
Comment 6 User image Gregory Szorc [:gps] 2011-09-17 10:40:55 PDT
OK, I'll upload a new patch shortly.

In the meantime, the output from `make.py -f client.mk configure` without an existing objdir is at http://gps.pastebin.mozilla.org/1333021. I don't know enough about our build system (yet) to determine if there is anything fishy.
Comment 7 User image Mike Hommey [:glandium] 2011-09-17 10:44:25 PDT
Nothing seems wrong at first (quick) glance.
Note that for the CRT to be installed, you need to manually set the WIN32_REDIST_DIR variable.
Comment 8 User image Ted Mielczarek [:ted.mielczarek] 2011-09-23 08:00:17 PDT
Comment on attachment 560677 [details] [diff] [review]
Detect MSVC2011 Compiler in configure

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

::: configure.in
@@ +731,5 @@
>              AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
> +        elif test "$_CC_MAJOR_VERSION" = "17"; then
> +            _CC_SUITE=11
> +            AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
> +            AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)

I wonder if we shouldn't just fold these three blocks together now, like:
elif test $_CC_MAJOR_VERSION -ge 15; then
  _CC_SUITE=$(( $_CC_MAJOR_VERSION - 6 ))
  ...

What do you think?
Comment 9 User image Gregory Szorc [:gps] 2011-09-23 10:46:58 PDT
Actually, I should have canceled the review since there were some missing files per comment #2.

As for rolling everything together, it is very tempting. We run the risk of something in the future not following convention. But, I suppose we can cross that bridge if it comes to that.

I'll upload a new patch when I have access to the computer it is on.
Comment 10 User image Gregory Szorc [:gps] 2011-10-02 17:10:47 PDT
Created attachment 564093 [details] [diff] [review]
Detect MSVC2011 Compiler in configure, v2

This version adds checks to files that were missed in the first iteration. I confirmed that detection and compilation works in both x86 and x64 modes.
Comment 11 User image Ted Mielczarek [:ted.mielczarek] 2011-10-03 06:35:12 PDT
Comment on attachment 564093 [details] [diff] [review]
Detect MSVC2011 Compiler in configure, v2

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

::: build/win32/Makefile.in
@@ +97,5 @@
> +ifeq (1700,$(_MSC_VER))
> +REDIST_FILES = \
> +	msvcp110.dll \
> +	msvcr110.dll \
> +	$(NULL)

Please use two-space indent here. Apparently I've been bad about enforcing that in this file. Feel free to fix the rest of them to match if you'd like.
Comment 12 User image Gregory Szorc [:gps] 2011-10-03 21:57:27 PDT
Created attachment 564458 [details] [diff] [review]
Detect MSVC2011 in configure, v3

This is the same as the last patch (which received r+) except it corrects whitespace in build/win32/Makefile.in, as suggested by reviewer.

I don't have checkin privileges, so on r+, please check it in for me.
Comment 13 User image Justin Wood (:Callek) 2011-10-03 21:59:15 PDT
Comment on attachment 564458 [details] [diff] [review]
Detect MSVC2011 in configure, v3

I verified this has no other changes, and meets ted's review requirement. Saving him the trouble and setting checkin-needed. Someone will get this into the tree shortly.
Comment 14 User image Justin Wood (:Callek) 2011-10-03 22:00:05 PDT
r+=ted for posterity for checkin
Comment 15 User image Ted Mielczarek [:ted.mielczarek] 2011-10-04 04:15:03 PDT
https://hg.mozilla.org/projects/build-system/rev/fe2e10601158
Comment 16 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-10-11 05:21:38 PDT
https://hg.mozilla.org/mozilla-central/rev/fe2e10601158

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