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

platformio failing with --ide eclipse #217

Closed
BluDotz opened this issue May 26, 2015 · 1 comment
Closed

platformio failing with --ide eclipse #217

BluDotz opened this issue May 26, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@BluDotz
Copy link

BluDotz commented May 26, 2015

I am trying to create a project for use with the Eclipse IDE, and am using the command "platformio init --ide eclipse". However, this generates the following error output and the command comes to a grinding halt....

Error: Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/platformio/main.py", line 75, in main
cli(None, None)
File "/Library/Python/2.7/site-packages/click/core.py", line 664, in call
return self.main(_args, *_kwargs)
File "/Library/Python/2.7/site-packages/click/core.py", line 644, in main
rv = self.invoke(ctx)
File "/Library/Python/2.7/site-packages/click/core.py", line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Python/2.7/site-packages/click/core.py", line 837, in invoke
return ctx.invoke(self.callback, *_ctx.params)
File "/Library/Python/2.7/site-packages/click/core.py", line 464, in invoke
return callback(_args, *_kwargs)
File "/Library/Python/2.7/site-packages/platformio/commands/init.py", line 90, in cli
pg.generate()
File "/Library/Python/2.7/site-packages/platformio/ide/projectgenerator.py", line 81, in generate
f.write(self._render_tpl(tpl_path).encode("utf8"))
File "/Library/Python/2.7/site-packages/platformio/ide/projectgenerator.py", line 87, in _render_tpl
return bottle.template(content, *_self._tplvars)
File "/usr/local/bin/bottle.py", line 3596, in template
return TEMPLATES[tplid].render(kwargs)
File "/usr/local/bin/bottle.py", line 3400, in render
self.execute(stdout, env)
File "/usr/local/bin/bottle.py", line 3387, in execute
eval(self.co, env)
File "", line 82, in
NameError: name 'env_name' is not defined

When I look at the files generated by the command, I find that a ".cproject" has been created, but not a ".project" file. Moreover, the ".cproject" file is completely empty.

My suspicion - having had a very quick look at the platformio code - is that either it has difficulties handling hidden files, or that there is problem during the substitution of the "project_name" parameter in the tpl files.

But you will know your code better than me, so you will probably get to the source of the problem quicker than me.

@ivankravets ivankravets added this to the 2.0.1 milestone May 26, 2015
@ivankravets ivankravets self-assigned this May 26, 2015
@ivankravets
Copy link
Member

Thanks for the report. I see this bug. The problem is caused by empty platformio.ini. You don't have any environments specified in it. You can use platformio init --ide eclipse --board HERE_BOARD_TYPE or define environments manually.

P.S: I'm going to fix it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants