Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building dart on Mac OS X Lion with xcode 4 #18

Closed
DartBot opened this issue Oct 10, 2011 · 18 comments
Closed

Building dart on Mac OS X Lion with xcode 4 #18

DartBot opened this issue Oct 10, 2011 · 18 comments
Assignees
Labels
area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes.
Milestone

Comments

@DartBot
Copy link

DartBot commented Oct 10, 2011

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. checkout source code
  2. run tools/build.py

Result:
=== BUILD NATIVE TARGET v8_base OF PROJECT v8 WITH CONFIGURATION Debug_x64 ===
** BUILD FAILED **

The problem is in macosx sdk version. Google Dart needs 10.5 for building, but there are no macosx10.5 sdk in XCode 4 in Lion.

Workaround: specify sdk manually in build.py:
Index: tools/build.py
===================================================================

--- tools/build.py (revision 296)
+++ tools/build.py (working copy)
@@ -106,6 +106,8 @­@
         if os.path.exists('dart-%s.gyp' % CurrentDirectoryBaseName()):
           project_file = 'dart-%s.xcodeproj' % CurrentDirectoryBaseName()
         args = ['xcodebuild',

  •            '-sdk',
    
  •            'macosx10.6',
    
                     '-project',
                     project_file,
                     '-target',

Full instruction for workaround on Lion:
http://batsuev.com/2011/10/building-google-dart-on-os-x-lion-with-xcode-4/

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by [email protected]


Set owner to [email protected].
Added Area-Compiler, Accepted labels.

@iposva-google
Copy link
Contributor

We need to evaluate whether we still need to build against 10.5.


Set owner to @iposva-google.
Removed Area-Compiler label.
Added Area-Build label.

@DartBot
Copy link
Author

DartBot commented Oct 11, 2011

This comment was originally written by [email protected]


Most of tests passed after 10.6 build. Just one fail.

@iposva-google
Copy link
Contributor

Issue #31 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Oct 21, 2011

This comment was originally written by [email protected]


It seems like the workaround doesn't work for all versions of xcode on Lion. I'm using xcode 4.2 and am still having problems, even after the workaround. I believe others are having the same issue.

@kevmoo
Copy link
Member

kevmoo commented Oct 28, 2011

I would really appreciate help with OSX Lion.

Thanks!

@DartBot
Copy link
Author

DartBot commented Dec 9, 2011

This comment was originally written by [email protected]


If it is any help I get the following error message, when trying to build on Lion with XCode 4.2 and setting the SDK to macosx10.7:

svnversion:

Verify exit code of build task 'PhaseScriptExecution Script-83F146809089295397E58BF0.sh'
Build task failed without generating error messages.

** BUILD FAILED **

The following build commands failed:
    Check dependencies
    PhaseScriptExecution "Action "build_closure_compiler"" /Users/gedefar/workspace/dart/dart/xcodebuild/dart-compiler.build/Debug_x64/closure_compiler.build/Script-83F146809089295397E58BF0.sh
(2 failures)
BUILD FAILED

@DartBot
Copy link
Author

DartBot commented Dec 30, 2011

This comment was originally written by [email protected]


I'm getting a similar error (I tried the 10.6 fix, that didn't work either, so now using 10.7):

[~/Development/ext/google/dart-source/dart]$./tools/build.py --arch=x64
Please set JAVA_HOME to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
xcodebuild -sdk macosx10.7 -project dart.xcodeproj -target All -parallelizeTargets -configuration Debug_x64 SYMROOT=/Users/shane/Development/ext/google/dart-source/dart/xcodebuild
Build settings from command line:
    SDKROOT = macosx10.7
    SYMROOT = /Users/shane/Development/ext/google/dart-source/dart/xcodebuild

2011-12-30 12:41:03.578 xcodebuild[22379:4003] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c++ -c /dev/null 2>&1" UserInfo=0x401dad8a0 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c++ -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}
2011-12-30 12:41:03.579 xcodebuild[22379:4003] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c++'.
Compiler: /Developer/usr/bin/gcc-4.2
Reason: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c++ -c /dev/null 2>&1
2011-12-30 12:41:03.616 xcodebuild[22379:4003] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c -c /dev/null 2>&1" UserInfo=0x4020ddf40 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}
2011-12-30 12:41:03.617 xcodebuild[22379:4003] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'.
Compiler: /Developer/usr/bin/gcc-4.2
Reason: /Developer/usr/bin/gcc-4.2 -v -E -dM -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -x c -c /dev/null 2>&1
=== BUILD NATIVE TARGET v8_base OF PROJECT v8 WITH CONFIGURATION Debug_x64 ===
Check dependencies
Unsupported compiler 'GCC 4.2' selected for architecture 'x86_64'

=== BUILD AGGREGATE TARGET js2c OF PROJECT v8 WITH CONFIGURATION Debug_x64 ===

=== BUILD AGGREGATE TARGET d8_js2c OF PROJECT d8 WITH CONFIGURATION Debug_x64 ===

=== BUILD NATIVE TARGET libdart OF PROJECT dart-runtime WITH CONFIGURATION Debug_x64 ===

=== BUILD AGGREGATE TARGET generate_builtin_cc_file OF PROJECT dart-runtime WITH CONFIGURATION Debug_x64 ===

=== BUILD NATIVE TARGET v8_nosnapshot OF PROJECT v8 WITH CONFIGURATION Debug_x64 ===

=== BUILD AGGREGATE TARGET closure_compiler OF PROJECT dart-compiler WITH CONFIGURATION Debug_x64 ===
PhaseScriptExecution "Action "build_closure_compiler"" /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/dart-compiler.build/Debug_x64/closure_compiler.build/Script-83F146809089295397E58BF0.sh
    cd /Users/shane/Development/ext/google/dart-source/dart/compiler
    /bin/sh -c /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/dart-compiler.build/Debug_x64/closure_compiler.build/Script-83F146809089295397E58BF0.sh
note: Building closure compiler
Buildfile: ../third_party/closure_compiler_src/build.xml

clean:
   [delete] Deleting directory /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out

rhino:

properties:

init:
    [mkdir] Created dir: /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib
    [mkdir] Created dir: /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes
    [mkdir] Created dir: /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/rhino1_7R3pre

compile:

compile-most:
    [javac] Compiling 191 source files to /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes
     [copy] Copying 2 files to /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes

compile-jdk15:
    [javac] Compiling 1 source file to /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes

compile:

properties:

compile:
    [javac] Compiling 28 source files to /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes
    [javac] /Users/shane/Development/ext/google/dart-source/dart/third_party/closure_compiler_src/lib/rhino/src/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java:3143: warning: [deprecation] disable() in javax.swing.JComponent has been deprecated
    [javac] public void disable() {
    [javac] ^
    [javac] /Users/shane/Development/ext/google/dart-source/dart/third_party/closure_compiler_src/lib/rhino/src/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java:3155: warning: [deprecation] enable() in javax.swing.JComponent has been deprecated
    [javac] public void enable() {
    [javac] ^
    [javac] 2 warnings
     [copy] Copying 1 file to /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes

xmlimplsrc-compile:
     [echo] Calling /Users/shane/Development/ext/google/dart-source/dart/third_party/closure_compiler_src/lib/rhino/src/mozilla/js/rhino/xmlimplsrc/build.xml

compile:

compile-all:

compile:
    [javac] Compiling 3 source files to /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/classes

jar:
      [jar] Building jar: /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/rhino1_7R3pre/js.jar

rhino-jarjar:
   [jarjar] Building jar: /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/Debug_x64/closure_out/lib/rhino.jar

Verify exit code of build task 'PhaseScriptExecution Script-83F146809089295397E58BF0.sh'
Build task failed without generating error messages.

** BUILD FAILED **

The following build commands failed:
        Check dependencies
        PhaseScriptExecution "Action "build_closure_compiler"" /Users/shane/Development/ext/google/dart-source/dart/xcodebuild/dart-compiler.build/Debug_x64/closure_compiler.build/Script-83F146809089295397E58BF0.sh
(2 failures)
BUILD FAILED
[~/Development/ext/google/dart-source/dart]$

@DartBot
Copy link
Author

DartBot commented May 13, 2012

This comment was originally written by [email protected]


Should this bug be closed, I dont find this an issue anymore. The only change that needs to be done now is the following.

19:15:04-adam@Adams-MacBook-Air:~/dart_bleeding/dart/tools
$ svn diff
Index: gyp/configurations_xcode.gypi
===================================================================

--- gyp/configurations_xcode.gypi (revision 7573)
+++ gyp/configurations_xcode.gypi (working copy)
@@ -8,8 +8,8 @­@
       'Dart_Base': {
         'xcode_settings': {
           # To switch to the LLVM based backend change the two lines below.

  •      #'GCC_VERSION': 'com.apple.compilers.llvmgcc42',
    
  •      'GCC_VERSION': '4.2',
    
  •      'GCC_VERSION': 'com.apple.compilers.llvmgcc42',
    
  •      #'GCC_VERSION': '4.2',
    
               'GCC_C_LANGUAGE_STANDARD': 'ansi',
               'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
               'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti

@DartBot
Copy link
Author

DartBot commented Jun 9, 2012

This comment was originally written by [email protected]


Switching GCC_VERSION does not fix it for me; I still get:

Verify exit code of build task 'PhaseScriptExecution Script-85526B89821EAEBE18292E1E.sh'
Build task failed without generating error messages.

=== BUILD NATIVE TARGET libdart_export OF PROJECT dart-runtime WITH CONFIGURATION DebugIA32 ===

** BUILD FAILED **

The following build commands failed:
    PhaseScriptExecution "Action "build_dartc"" /Users/leese/dart_code/dart/xcodebuild/dart-compiler.build/DebugIA32/dartc.build/Script-85526B89821EAEBE18292E1E.sh

Whether or not a workaround exists for my setup, this is a bug for two reasons:

  1. PhaseScriptExecution has an error and the only thing it can tell me is that it can't tell me what the error is?

  2. This is just one of many tweaks I've found online that are supposed to make dart build on Lion. The necessity of these tweaks is a bug; find the tweaks people are making and fix the build script to handle these cases. The build script certainly doesn't provide any information on what it doesn't like about my combination of tools.

@sethladd
Copy link
Contributor

This patch works for an XCode 4 + Lion config:

https://github.com/kevmoo/dart-repo/commit/3ccbfadc63d7c72c6b9315fe5720b56715e147e7.patch

It would be awesome to merge this with the main build scripts.

@DartBot
Copy link
Author

DartBot commented Sep 5, 2012

This comment was originally written by [email protected]


I am getting the same output as comment #­8 from above (http://code.google.com/p/dart/issues/detail?id=18#c8 ), even after applying the patch at https://github.com/kevmoo/dart-repo/commit/3ccbfadc63d7c72c6b9315fe5720b56715e147e7.patch

Any ideas?

@DartBot
Copy link
Author

DartBot commented Sep 5, 2012

This comment was originally written by [email protected]


Kevin's patch doesn't fix my issue either. Is there any way to get more information out of the build scripts? Is there code I should modify to get the build scripts to print out how far they've progressed?

@DartBot
Copy link
Author

DartBot commented Sep 6, 2012

This comment was originally written by [email protected]


I ran into the same problem. I fixed it by rerunning "gclient sync; gclient runhooks" after adding the llvm version patch above. Since this modifies the gyp file in the project, you have to regenerate the xcode project as well, which I believe one of these does.

@DartBot
Copy link
Author

DartBot commented Sep 13, 2012

This comment was originally written by [email protected]


That appears to have worked! Thanks!

@sethladd
Copy link
Contributor

Tested and verified with Mountain Lion and XCode 4.4 and Kevin's patch.


cc @dgrove.

@iposva-google
Copy link
Contributor

This depends on http://crbug.com/147515

@iposva-google
Copy link
Contributor

Added this to the M2 milestone.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Use area-infrastructure for SDK infrastructure issues, like continuous integration bot changes.
Projects
None yet
Development

No branches or pull requests

5 participants