Closed Bug 888549 Opened 6 years ago Closed 6 years ago

config.log should not be printed if config.status errors

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: caitlin.potter, Assigned: glandium)

References

Details

Attachments

(1 file, 2 obsolete files)

The check script in configure.in ends up implicitly declaring posix_fallocate if it's not present in fcntl.h, on mac 10.8 with CC/CXX unset and no moz.config.

> 0:12.05 Warning: -Wimplicit-function-declaration in configure: implicit declaration of
> function 'posix_fallocate' is invalid in C99
> 0:12.05 configure:27688:1: warning: implicit declaration of function 'posix_fallocate' is
> invalid in C99 [-Wimplicit-function-declaration]
> 0:12.05 posix_fallocate(0, 0, 0);
> 0:12.05 ^
> 0:12.05 1 warning generated.
> 0:12.05 Undefined symbols for architecture x86_64:
> 0:12.05   "_posix_fallocate", referenced from:
> 0:12.05       _main in conftest-b7GJAH.o
> 0:12.05 ld: symbol(s) not found for architecture x86_64
> 0:12.05 clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 0:12.05 configure: failed program was:
> 0:12.05 #line 27684 "configure"
> 0:12.05 #include "confdefs.h"
> 0:12.05 #define _XOPEN_SOURCE 600
> 0:12.05   #include <fcntl.h>
> 0:12.05 int main() {
> 0:12.05 posix_fallocate(0, 0, 0);
> 0:12.05 ; return 0; }
> 0:12.06 *** Fix above errors and then restart with               "/usr/bin/make -f
> client.mk build"
> 0:12.06 make[2]: *** [configure] Error 1
> 0:12.06 make[1]: *** [obj-x86_64-apple-darwin12.4.0/Makefile] Error 2
> 0:12.06 make: *** [build] Error 2
> 0:12.10 1 compiler warnings present
Hardware: x86 → x86_64
Attachment #769286 - Flags: review?(ted)
Forgot to mark attachment as patch
Attachment #769286 - Attachment is obsolete: true
Attachment #769286 - Flags: review?(ted)
Attachment #769288 - Flags: review?(ted)
This test seems to work fine for me on OS X 10.8.4 with XCode 4.6.2. configure is picking up /usr/bin/clang[++] as my compiler, and configure succeeds. What version of XCode do you have installed?
OSX 10.8.4 with Xcode 4.6.3 (4H1503)

gcc reports i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

clang reports Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0

This is a fairly recent happening, I have not been able to build without these hacks for a few weeks now.
I've been seeing this error when config.status fails (typically because a moz.build reading error). I think if you scroll up, you'll see a different error.

You can reproduce this by adding "FOO = True" to the root moz.build file then running |mach configure|.

config.log is making a negative detection look like a build error. That's the underlying problem here.

Perhaps we should move config.status invocation to the bottom of configure or out of configure completely (possibly into client.mk).

 0:03.73 checking for posix_fallocate... no
 0:03.75 creating ./config.status
 0:03.89 Reticulating splines...
 0:03.89 Traceback (most recent call last):
 0:03.89   File "./config.status", line 929, in <module>
 0:03.89     config_status(**args)
 0:03.89   File "/Users/gps/src/firefox/build/ConfigStatus.py", line 122, in config_status
 0:03.89     summary = backend.consume(definitions)
 0:03.89   File "/Users/gps/src/firefox/python/mozbuild/mozbuild/backend/base.py", line 176, in consume
 0:03.89     for obj in objs:
 0:03.89   File "/Users/gps/src/firefox/python/mozbuild/mozbuild/frontend/emitter.py", line 43, in emit
 0:03.89     for out in output:
 0:03.89   File "/Users/gps/src/firefox/python/mozbuild/mozbuild/frontend/reader.py", line 609, in read_mozbuild
 0:03.89     sys.exc_info()[2], sandbox_exec_error=se)
 0:03.89 mozbuild.frontend.reader.BuildReaderError: ==============================
 0:03.89 ERROR PROCESSING MOZBUILD FILE
 0:03.90 ==============================
 0:03.90
 0:03.90 The error occurred while processing the following file:
 0:03.90
 0:03.90     /Users/gps/src/firefox/moz.build
 0:03.90
 0:03.90 The error was triggered on line 8 of this file:
 0:03.90
 0:03.90     FOO = True
 0:03.90
 0:03.90 The underlying problem is an attempt to write a reserved UPPERCASE variable that does not exist.
 0:03.90
 0:03.90 The variable write causing the error is:
 0:03.90
 0:03.90     FOO
 0:03.90
 0:03.90 Please change the file to not use this variable.
 0:03.90
 0:03.90 For reference, the set of valid variables is:
 0:03.90
 0:03.90 ASFILES, CMMSRCS, CONFIGURE_SUBST_FILES, CPP_SOURCES, CSRCS, DEFINES, DIRS, EXPORTS, EXTERNAL_MAKE_DIRS, EXTRA_COMPONENTS, EXTRA_JS_MODULES, EXTRA_PP_COMPONENTS, GTEST_CMM_SOURCES, GTEST_CPP_SOURCES, GTEST_C_SOURCES, HOST_CPPSRCS, HOST_CSRCS, HOST_LIBRARY_NAME, IPDL_SOURCES, JS_MODULES_PATH, LIBRARY_NAME, LIBS, MODULE, NO_DIST_INSTALL, PARALLEL_DIRS, PARALLEL_EXTERNAL_MAKE_DIRS, PROGRAM, SDK_LIBRARY, SHARED_LIBRARY_LIBS, SIMPLE_PROGRAMS, SSRCS, TEST_DIRS, TEST_TOOL_DIRS, TIERS, TOOL_DIRS, XPCSHELL_TESTS_MANIFESTS, XPIDL_FLAGS, XPIDL_MODULE, XPIDL_SOURCES
 0:03.90
 0:03.90 ------ config.log ------
 0:03.90 ld: file too small for architecture x86_64
 0:03.90 clang-3.3: error: linker command failed with exit code 1 (use -v to see invocation)
 0:03.90 configure:25529: /usr/local/bin/ccache /usr/local/llvm/bin/clang -o conftest   -framework Cocoa -lobjc -Wl,-filelist,conftest.list  1>&5
 0:03.90 configure:26308: checking for stdint.h
 0:03.90 configure:26308: checking for inttypes.h
 0:03.90 configure:26308: checking for sys/int_types.h
 0:03.90 configure:27665: checking for posix_fallocate
 0:03.90 configure:27675: /usr/local/bin/ccache /usr/local/llvm/bin/clang -o conftest -Qunused-arguments -Wall -Wpointer-arith -Wdeclaration-after-statement -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-unused -fcolor-diagnostics -std=gnu99 -fgnu89-inline -fno-strict-aliasing -ffunction-sections -fdata-sections -pthread -DNO_X11 -pipe -Qunused-arguments    -framework Cocoa -lobjc conftest.c  1>&5
 0:03.90 configure:27671:1: warning: implicit declaration of function 'posix_fallocate' is invalid in C99 [-Wimplicit-function-declaration]
 0:03.90 posix_fallocate(0, 0, 0);
 0:03.90 ^
 0:03.90 1 warning generated.
 0:03.91 Undefined symbols for architecture x86_64:
 0:03.91   "_posix_fallocate", referenced from:
 0:03.91       _main in conftest-mnRxoi.o
 0:03.91 ld: symbol(s) not found for architecture x86_64
 0:03.91 clang-3.3: error: linker command failed with exit code 1 (use -v to see invocation)
 0:03.91 configure: failed program was:
 0:03.91 #line 27667 "configure"
 0:03.91 #include "confdefs.h"
 0:03.91 #define _XOPEN_SOURCE 600
 0:03.91   #include <fcntl.h>
 0:03.91 int main() {
 0:03.91 posix_fallocate(0, 0, 0);
 0:03.91 ; return 0; }
 0:03.91 *** Fix above errors and then restart with               "/usr/bin/make -f client.mk build"
 0:03.91 make: *** [configure] Error 1
gps@gps-mbp:~/src/firefox$
OS: Mac OS X → All
Hardware: x86_64 → All
Summary: Checking for posix_fallocate() fails badly and kills configure script → config.log should not be printed if config.status errors
Version: 24 Branch → Trunk
Depends on: 788613
This has been happening even with a fresh clone, so it's not clear to me how there would be a problem reading moz.build files, but I'll have to trust your judgement :)
Can you paste more lines of context from before this error? I want you to go back to at least the "checking for posix_fallocate..." line. My bet is you'll see something else here.
I see, I think this can be closed. It's not finding some files, which are no longer included in the repository. But it might be good to stop the build as soon as that happens so that it's easier to spot
Comment on attachment 769288 [details] [diff] [review]
Don't implicitly declare posix_fallocate() in configure.in

Clearing review request, since this is not actually the real problem. (I realized that if I tail the config.log on my mac build I see the same error, it's just not fatal.)
Attachment #769288 - Flags: review?(ted)
Assignee: caitlin.potter → mh+mozilla
Attachment #790045 - Flags: review?(ted) → review+
Attachment #769288 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/bcfa70489d5c
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.