Closed Bug 1417745 Opened 3 years ago Closed 3 years ago

"checking whether the target C compiler can be used..." fails with "c:\temp\conftest.i1uzfc.c(83): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory"

Categories

(Firefox Build System :: General, defect)

x86
Windows 10
defect
Not set
blocker

Tracking

(firefox-esr52 unaffected, firefox57 unaffected, firefox58 unaffected, firefox59 fixed)

RESOLVED FIXED
Tracking Status
firefox-esr52 --- unaffected
firefox57 --- unaffected
firefox58 --- unaffected
firefox59 --- fixed

People

(Reporter: masayuki, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

I cannot build today's m-c.

Currently, f41930a869a8 is the tip:
https://hg.mozilla.org/mozilla-central/pushloghtml?changeset=f41930a869a84af81df1a88d8e82323ff3a6509a

It seems that I can build its previous merge changeset, 60b9fa15e427. (Currently, building it cleanly.)

> $ ./mach build
>  0:01.53 Clobber not needed.
>  0:01.57 c:\mozilla-build\mozmake\mozmake.EXE -f client.mk MOZ_PARALLEL_BUILD=16 -s configure
>  0:02.94 Generating c:/mozilla/src/configure
>  0:02.99 Generating c:/mozilla/src/js/src/configure
>  0:03.07 cd c:/mozilla/fx64-dbg
>  0:03.09 c:/mozilla/src/configure
>  0:03.48 Reexecuting in the virtualenv
>  0:03.97 Adding configure options from c:\Users\toybox\fx64.debug.mozconfig
>  0:03.97   --target=x86_64-pc-mingw32
>  0:03.97   --host=x86_64-pc-mingw32
>  0:03.97   --enable-debug
>  0:03.97 checking for vcs source checkout... hg
>  0:04.17 checking for a shell... C:/mozilla-build/msys/bin/sh.exe
>  0:04.35 checking for host system type... x86_64-pc-mingw32
>  0:04.55 checking for target system type... x86_64-pc-mingw32
>  0:04.60 checking for a shell... C:/mozilla-build/msys/bin/sh.exe
>  0:04.78 checking for host system type... x86_64-pc-mingw32
>  0:04.98 checking for target system type... x86_64-pc-mingw32
>  0:05.02 checking for vcs source checkout... hg
>  0:05.02 checking whether cross compiling... no
>  0:05.07 checking for the target C compiler... 'C:/PROGRA~2/MIB055~1/2017/PROFES~1/VC/Tools/MSVC/1411~1.255/bin/HostX64/x64/cl.exe'
>  0:05.14 checking whether the target C compiler can be used...
>  0:05.14 DEBUG: <truncated - see config.log for full output>
>  0:05.14 DEBUG: | #line 70 "c:\\temp\\conftest.khlspv.c"
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: | #line 72 "c:\\temp\\conftest.khlspv.c"
>  0:05.14 DEBUG: | %KERNEL "WINNT"
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: | #line 78 "c:\\temp\\conftest.khlspv.c"
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: | %ENDIANNESS "little"
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: | #line 83 "c:\\temp\\conftest.khlspv.c"
>  0:05.14 DEBUG: Its error output was:
>  0:05.14 DEBUG: | Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25547 for x64
>  0:05.14 DEBUG: | Copyright (C) Microsoft Corporation.  All rights reserved.
>  0:05.14 DEBUG: |
>  0:05.14 DEBUG: | conftest.khlspv.c
>  0:05.14 DEBUG: | c:\temp\conftest.khlspv.c(83): fatal error C1034: stddef.h: no include path set
>  0:05.14 ERROR: Command `cl.exe -E 'c:\temp\conftest.khlspv.c'` failed with exit status 2.
>  0:05.17 *** Fix above errors and then restart with\
>  0:05.17                "c:/mozilla-build/mozmake/mozmake.EXE -f client.mk build"
>  0:05.18 mozmake.EXE: *** [client.mk:200: configure] Error 1

MozillaBuild version isn't related, I failed to build with either 3.0 and 3.1.

Even if I ran |vsvars32.bat| before |start-shell.bat|, couldn't solve this.

My VS version is 15.4.2.

Even without bug 1325632, i.e., b8067f9bf9a7, I couldn't build.

Perhaps, regression of bug 1416743 or bug 1415470 caused this.
The regression point is b0eedb4c140b, it's the last patch of bug 1412983.
Blocks: 1412983
Flags: needinfo?(ted)
Flags: needinfo?(nfroyd)
Keywords: regression
What in the world...cl.exe can't find its own include files?  Can it find them in the shell you're trying to build from?

I figure this has to be some sort of MozillaBuild peculiarity, since everything works fine in automation, but I'm at a loss to know what's going on here.
Flags: needinfo?(nfroyd)
> Can it find them in the shell you're trying to build from?

How to check it?
Write a small C file containing:

#include <stddef.h>

and run:

cl.exe -E $FILENAME

from the same shell where you are seeing the above error.
> $ 'c:/PROGRA~2/MIB055~1/2017/PROFES~1/VC/Tools/MSVC/1411~1.255/bin/HostX64/x64/cl.exe' -E test.c
> Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25547 for x64
> Copyright (C) Microsoft Corporation.  All rights reserved.
> 
> test.c
> #line 1 "test.c"
> test.c(1): fatal error C1034: stddef.h: no include path set

Hmm...
It works on automation because mozconfigs set INCLUDE. It's only set in include_path in build/moz.configure/windows.configure otherwise.
(In reply to Mike Hommey [:glandium] from comment #6)
> It works on automation because mozconfigs set INCLUDE. It's only set in
> include_path in build/moz.configure/windows.configure otherwise.

Ugh, ok.  I guess we could skip the check if _MSC_VER?  Anyway, we can discuss this in the original bug, since I backed the offending commit out.  central should build now for everybody.
Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(ted)
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.