nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
301 stars 136 forks source link

Command line building in mcux.py fails on Linux due to wrong usage of subprocess.Popen #172

Open stefanct opened 4 months ago

stefanct commented 4 months ago

Passing a string w/o setting shell=True to Popen results in Python trying to execute a file named something like /cmd arg1 arg2 which is not what you want: https://github.com/nxp-mcuxpresso/mcux-sdk/blob/cf224e2df8c2d8ae5c4f27743259803c365a6a60/scripts/kconfig/mcux.py#L26 This results for example in FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/python /.../examples/evkmimxrt1020/demo_apps/hello_world/armgcc/../../../../../core/scripts/kconfig/menuconfig.py /.../examples/evkmimxrt1020/demo_apps/hello_world/armgcc/../../../../../core/Kconfig' when running make menuconfig in the hello world example (for the rt1020).

This should be changed to either splitting the string into its components, e.g., via shlex.split(command) or by adding shell=True.

mcuxsusan commented 4 months ago

Thanks for reporting the issue! I will check and provide you feedback later.