west build command in CI/CD pipeline

Dear all,

I do want to ensure the quality of my BLE FW by adding a CI pipeline in azure.

However, I'm having a hard time getting "west build" command to work in any other terminal than the nRF connect terminal (would for instance like to run the command via PowerShell for an easy implementation in the pipeline).

Any one having any experience of this?

Kind regards

Parents Reply Children
  • Hello, thanks for the reply.

    My main concern is that the west-command isn't working in any other terminal than the nrf connect terminal.

    So I assume that i must update the environmental path for this, though i'm uncertain which path to specify

  • Yes, in this case it seems that you have to set an environment variable as west is found. This is described in the section “‘west’ is not recognized as an internal or external command, operable program or batch file.’" under the link I provided you.

    Check where your west.exe is located, most likely it is in your python scripts folder. (I have it here: C:\Users\Bernhard\AppData\Local\Programs\Python\Python310\Scripts). In case it is there, this folder should be added to your path variable.

  • Yes and that is perhaps my main question. I have installed the nrf sdk via the toolchain manager and the nrf-extensions in vs-code. I have netither installed python nor west manually on my computer and I cant find the west-path (the default path that the nrf sets up when installing via toolchain manager) where can i find this path?

  • Ah, I see. Despite also doing an install using the Toolchain Manager I am having a separate Python instance installed, and I also installed west manually for it.

    "Installing over the Toolchain Manager will install all Python dependencies into a local environment in the Toolchain Manager app, not the system." (explained here: Requirements — nRF Connect SDK 2.3.99 documentation (nordicsemi.com))

    I had a look at my installation and found the path where this local Python instance is located (assuming the default path setup by the Toolchain manager): C:\ncs\toolchains\v2.2.0\opt\bin

    In the Scripts folder at this location (C:\ncs\toolchains\v2.2.0\opt\bin\Scripts) the west.exe is located.

    I tested the following myself. Adding both of these paths to the Path environment variable should make it work. Adding the path of the Scripts folder is needed to find west.exe and the bin folder needs to be added that Python itself is found.

    However, I am not sure if this is the best way to do this. In case you are doing something else with Python on your PC  this version will be used and also new packages will be installed to this local Python version created by the Toolchain Manager.

    Probably it may be better to manually install Python on the System and install west (pip3 install west) and add the paths of the system Python installation and the scripts folder of this installation (where the west.exe than should be located) to the Path variable.

Related