ytrstu / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

test/mac/gyptest-archs.py flaky on Xcode 4 #476

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make sure that the default Xcode is Xcode 4.6.2 (xcode-select -print-path
2. for ((i=1;i<=100;i++)); do PRESERVE_FAIL=1 ./gyptest.py 
test/mac/gyptest-archs.py -fmake ; done

What is the expected output?
No failing test, 100x the following output:
PYTHONPATH=/Volumes/data/b/build/slave/gyp/build/trunk/test/lib
TESTGYP_FORMAT=make
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/
MacOS/python  test/mac/gyptest-archs.py

What do you see instead?
Occasionally (about 6 times on my machine), the test fails with 
FAILED test at line 423 of 
/Volumes/data/b/build/slave/gyp/build/trunk/test/lib/TestCommon.py (_complete)
    from line 532 of /Volumes/data/b/build/slave/gyp/build/trunk/test/lib/TestCommon.py (run)
    from line 310 of /Volumes/data/b/build/slave/gyp/build/trunk/test/lib/TestGyp.py (run)
    from line 810 of /Volumes/data/b/build/slave/gyp/build/trunk/test/lib/TestGyp.py (build)
    from line 33 of test/mac/gyptest-archs.py
None returned 2
STDOUT =========================================================================
  CXX(target) out/Default/obj.target/lib/my_file.o
  CXX(target) out/Default/obj.target/exe/my_main_file.o
  LINK(target) out/Default/Test

STDERR =========================================================================
ld: warning: ignoring file out/Default/libTest.a, file was built for archive 
which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_x", referenced from:
      _main in my_main_file.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [out/Default/Test] Error 1

(see e.g. 
http://build.chromium.org/p/tryserver.nacl/builders/gyp-mac/builds/1962/steps/an
notate/logs/stdio)

What version of the product are you using? On what operating system?
gyp@master, Mac OS X 10.9.2, Xcode 4.6.2

Please provide any additional information below.
- The test first gyps and builds test-no-archs.gyp. On Xcode 4 (but not Xcode 5 
and later), the default when building without specifying the architecture is to 
build 32 bit binaries (i386). One of the build outputs is libTest.a.
- The test then gyps and builds test-valid-archs.gyp. The gyp file explicitly 
specifies to build 64 bit binaries (x86). The final executable Test links 
against libTest.a.
- When the test fails, make for some reason fails to pick-up that the 
dependency libTest.a must be rebuilt before linking Test. This can be seen be 
comparing the following expected output of 'make all' to the one above. Note 
how the LIBTOOL-STATIC static step is missing above:

$ make all
  CXX(target) out/Default/obj.target/lib/my_file.o
  LIBTOOL-STATIC out/Default/libTest.a
  CXX(target) out/Default/obj.target/exe/my_main_file.o
  LINK(target) out/Default/Test
  LINK(target) out/Default/Test: Finished

- On Xcode 5 and later, this failure to rebuild the dependency doesn't cause a 
linker error because the architecture is the same (x86).

Original issue reported on code.google.com by tobias.h...@ableton.com on 19 Dec 2014 at 3:13