[Windows] Build fails #26

Open
iarspider opened this Issue Mar 10, 2012 · 10 comments

Projects

None yet

2 participants

@iarspider

After fixing the issue #25 (unable to find avr-gcc), I tried to build some code, but got this:
Traceback (most recent call last): File "D:\Work\arduino-1.0\ino-0.3.3\bin\run.py", line 6, in <module> main() File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\runner.py", line 63, in main args.func(args) File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\commands\build.py", line 189, in run self.make('Makefile.sketch') File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\commands\build.py", line 138, in make makefile = self.render_template(makefile + '.jinja', makefile, **kwargs) File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\commands\build.py", line 130, in render_template contents = template.render(**ctx) File "C:\Python27\lib\site-packages\jinja2-2.6-py2.7.egg\jinja2\environment.py", line 894, in render return self.environment.handle_exception(exc_info, True) File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\commands\..\make\Makefile.sketch.jinja", line 4, in top-level template code {% set sketches = e.src_dir|glob('*.pde', '*.ino')|filemap(src_build_dir, e.names.cpp) %} File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\filters.py", line 39, in glob for entry in os.listdir(scan_dir): WindowsError: [Error 3] The system cannot find the path specified: 'src\\*.*'

@nkrkv
Member
nkrkv commented Mar 10, 2012

Are you in a directory that was filled with project skeleton after ino init? In other words: do you actually have src subdir in current directory?

@iarspider

Ah, I must have missed the quickstart part.

@iarspider iarspider closed this Mar 10, 2012
@iarspider iarspider reopened this Mar 10, 2012
@iarspider

`

python d:\uno init -t Blink

python d:\uno build -d d:\Work\arduino-1.0

Searching for Board description file (boards.txt) ... ←[92md:\Work\arduino-1.0\hardware\arduino\boards.txt←[0m
Searching for Arduino lib version file (version.txt) ... ←[92md:\Work\arduino-1.0\lib\version.txt←[0m
Detecting Arduino software version ... ←[92m1.0 (1.0)←[0m
Searching for Arduino core library ... ←[92md:\Work\arduino-1.0\hardware\arduino\cores\arduino←[0m
Searching for Arduino standard libraries ... ←[92md:\Work\arduino-1.0\libraries←[0m
Searching for Arduino variants directory ... ←[92md:\Work\arduino-1.0\hardware\arduino\variants←[0m
Searching for avr-gcc ... ←[92md:\Work\arduino-1.0\hardware\tools\avr\bin\avr-gcc←[0m
Searching for avr-g++ ... ←[92md:\Work\arduino-1.0\hardware\tools\avr\bin\avr-g++←[0m
Searching for avr-ar ... ←[92md:\Work\arduino-1.0\hardware\tools\avr\bin\avr-ar←[0m
Searching for avr-objcopy ... ←[92md:\Work\arduino-1.0\hardware\tools\avr\bin\avr-objcopy←[0m
Traceback (most recent call last):
File "D:\run.py", line 6, in
main()
File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\runner.py", line 6
3, in main
args.func(args)
File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\commands\build.py"
, line 189, in run
self.make('Makefile.sketch')
File "C:\Python27\lib\site-packages\ino-0.3.3-py2.7.egg\ino\commands\build.py"
, line 139, in make
ret = subprocess.call(['make', '-f', makefile, 'all'])
File "C:\Python27\lib\subprocess.py", line 493, in call
return Popen(_popenargs, *_kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 679, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
`

@iarspider

I guess it doesn't find make.exe (part of Arduino IDE/avr-gcc)

@nkrkv
Member
nkrkv commented Mar 10, 2012

Yes, it's a continue of issue #25. make is not found. To continue the battle you could replace

ret = subprocess.call(['make', '-f', makefile, 'all'])

with something like

ret = subprocess.call(['d:\full\path\to\make.exe', '-f', makefile, 'all'])
@iarspider

Well, that is even uglier than in issue 25. The best way to handle this would be to alter %PATH% variable before calling make - this will help make find the rest of the tools.

@nkrkv
Member
nkrkv commented Mar 10, 2012

I'm not consider to include these hacks as is. I suggest just to find all corner stones on Windows so that they could be carefully worked around eventually.

@iarspider

Another bump in the road: windows doesn't need '-p' in mkdir to create parent dirs automaticaly (with 'command extenstions' enabled - i.e. WinXP or newer, maybe Win2000), and echo doesn't need '-n'. And Windows have no built-in 'cat' (but arduino has it)

@iarspider

Linking firmware.elf d:\Work\arduino-1.0\hardware\tools\avr\bin\avr-gcc.exe -Os -Wl,--gc-sections -mmcu=atmega328p -o .build\firmware.elf .build\src\sketch.o -lmd:/work/arduino-1.0/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr5/crtm328p.o:(.init9+0x0): undefined reference to``main' make: *** [.build\firmware.elf] Error 1 Make failed with code 2
For some reason, main.cpp et al are not added as dependencies under Windows.

@iarspider

Found the source of the problem. I will now cleanup my hacks and make a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment