build command from ncs extension does not work

NCS 2.7.0 with NCS Toolchain 2.7.0 and latest NCS SDK extension

When I right click on a build configuration, there is an menu item  "Copy Build Command"

which produced this command:

west build --build-dir d:/Flipperz/flipper_workspace2/app.git/app/build_thomas_c_track d:/Flipperz/flipper_workspace2/app.git/app --pristine --board thomas_c/nrf52840 --sysbuild -- -DNCS_TOOLCHAIN_VERSION="NONE"

When I run this command a the cmd prompt I get:

D:\Flipperz\flipper_workspace2>west build --build-dir d:/Flipperz/flipper_workspace2/app.git/app/build_thomas_c_track d:/Flipperz/flipper_workspace2/app.git/app --pristine --board thomas_c/nrf52840 --sysbuild -- -DNCS_TOOLCHAIN_VERSION="NONE"
-- west build: making build dir d:\Flipperz\flipper_workspace2\app.git\app\build_thomas_c_track pristine
-- west build: generating a build system
Traceback (most recent call last):
File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python37\Scripts\west.exe\__main__.py", line 7, in <module>
File "c:\python37\lib\site-packages\west\app\main.py", line 793, in main
app.run(argv or sys.argv[1:])
File "c:\python37\lib\site-packages\west\app\main.py", line 109, in run
self.run_command(argv)
File "c:\python37\lib\site-packages\west\app\main.py", line 345, in run_command
self.run_extension(args.command, argv)
File "c:\python37\lib\site-packages\west\app\main.py", line 418, in run_extension
config=self.config)
File "c:\python37\lib\site-packages\west\commands.py", line 135, in run
self.do_run(args, unknown)
File "D:\Flipperz\flipper_workspace2\zephyr\scripts\west_commands\build.py", line 239, in do_run
self._run_cmake(board, origin, self.args.cmake_opts)
File "D:\Flipperz\flipper_workspace2\zephyr\scripts\west_commands\build.py", line 593, in _run_cmake
if module.meta['name'] in allow_list and Path(self.source_dir).is_relative_to(module.project):
AttributeError: 'WindowsPath' object has no attribute 'is_relative_to'

I need to get this working so I can start automated builds as part of a continuous integration system..

Parents
  • It looks like you're encountering an issue due to an outdated Python version or an incompatibility between west and the Zephyr scripts on Windows. The error message:

    python
    AttributeError: 'WindowsPath' object has no attribute 'is_relative_to'

    suggests that is_relative_to is not recognized. This method was introduced in Python 3.9, but you're using Python 3.7:

    File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
Reply
  • It looks like you're encountering an issue due to an outdated Python version or an incompatibility between west and the Zephyr scripts on Windows. The error message:

    python
    AttributeError: 'WindowsPath' object has no attribute 'is_relative_to'

    suggests that is_relative_to is not recognized. This method was introduced in Python 3.9, but you're using Python 3.7:

    File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
Children
Related