project-generator / project_generator

Project generators for various embedded tools (IDE). IAR, uVision, Makefile, CoIDE, Eclipse and many more in the roadmap!
Apache License 2.0
272 stars 95 forks source link

Change current directory for make process. (for nmake) #484

Closed elfmimi closed 3 years ago

elfmimi commented 3 years ago

As far as I know, nmake does not have equivalent of -C option. So changing current directory is required. I used subprocess.call() with cwd named argument. ~But it seems this is not supported in Python 2.7 .~ ~If support for Python 2.7 is mandatory for the project , let me know. I will rework the patch.~

0xc0170 commented 3 years ago

Hi, how to reproduce the issue to understand this patch better?

0xc0170 commented 3 years ago

python 2.7 would be nice but we should stop supporting it anyway soon enough. It's still enabled in Travis as being tested (I assume this specific patch for nmake is not tested in Travis well)

elfmimi commented 3 years ago

Ah, here you are, the context. https://github.com/ARMmbed/DAPLink/discussions/770#discussioncomment-414558

0xc0170 commented 3 years ago

But it seems this is not supported in Python 2.7 .

As I read it, call in 2.7 should have args same as Popen (https://python.readthedocs.io/en/v2.7.2/library/subprocess.html#subprocess.Popen) so cwd should be supported. If that is the case, LGTM

elfmimi commented 3 years ago

oh yes, you are right. I tested and confirm that Python 2.7 call() do support cwd= argument. no problem then. :->