fabiankr/Cocoduino — Issue #1: Cocoaduino can't find make
Author: chockenberry
Created: 2012-03-03 19:52:45+00:00
State: open

I have Cocoaduino installed in ~/Desktop/Arduino (along with the standard Arduino app.) When I launch the Cocoaduino and do a build, I get this error:

----
In file: "Traceback (most recent call last)":
In file: "Unknown": File "/Users/craig/Desktop/Arduino/Cocoduino.app/Contents/Resources/bin/ino-cocoduino", line 10, in
In file: "Unknown": main()
In file: "Unknown": File "/Users/craig/Desktop/Arduino/Cocoduino.app/Contents/Resources/bin/../ino-cocoduino.egg/ino/runner.py", line 63, in main
In file: "Unknown": args.func(args)
In file: "Unknown": File "/Users/craig/Desktop/Arduino/Cocoduino.app/Contents/Resources/bin/../ino-cocoduino.egg/ino/commands/build.py", line 225, in run
In file: "Unknown": self.scan_dependencies()
In file: "Unknown": File "/Users/craig/Desktop/Arduino/Cocoduino.app/Contents/Resources/bin/../ino-cocoduino.egg/ino/commands/build.py", line 206, in scan_dependencies
In file: "Unknown": used_libs = self._scan_dependencies(self.e.src_dir, lib_dirs, inc_flags)
In file: "Unknown": File "/Users/craig/Desktop/Arduino/Cocoduino.app/Contents/Resources/bin/../ino-cocoduino.egg/ino/commands/build.py", line 164, in _scan_dependencies
In file: "Unknown": subprocess.call(['make', '-f', makefile, 'all'])
In file: "Unknown": File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 486, in call
In file: "Unknown": File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
In file: "Unknown": File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
In file: "OSError": [Errno 2] No such file or directory
----

I'm no expert at Python, but this looks like it's having problems launching "make" as a subprocess. So I tried this:

$ echo $PATH
/Users/craig/bin:/Developer/Tools:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/lib/postgresql81/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
$ export PATH=$PATH":/Applications/Xcode.app/Contents/Developer/usr/bin/"
$ echo $PATH
/Users/craig/bin:/Developer/Tools:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/lib/postgresql81/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Applications/Xcode.app/Contents/Developer/usr/bin/
$ which make
/Applications/Xcode.app/Contents/Developer/usr/bin//make
$ open ~/Desktop/Arduino/Cocoduino.app/

And now I can build and run without any problems.

Since it's not a requirement with Xcode 4.3 to update your PATH environment variable, it would be a good idea for Cocoaduino to find the Xcode app package and set the environment before launching the build/run process.