nRF Connect for VSCode does not recognize host toolchain when building for native_sim on Linux

Using VSCode with nRF Connect extension on Ubuntu Linux 22/04 with nRF SDK 3.0.1 and nRF Toolchain 3.0.1 installed

I can create a build configuration for Zephyr's hello_world sample app to build for the native_sim board and build without any issue but the IDE extension keeps asking for a pristine build afterwards despite no build errors being reported. In the VSCode output console (where extensions print log info) it  keeps on printing "Unable to find the toolchain at path: /usr/bin/gcc" like this.

[13:57:28] west build --build-dir /home/nicolaslebedenco/Geotab/gemini/external/zephyr/samples/hello_world/build /home/nicolaslebedenco/Geotab/gemini/external/zephyr/samples/hello_world --pristine --board native_sim/native/64 --sysbuild --
[13:57:36] Success.
[13:57:36] ========== Stale build configuration (hello_world - build/hello_world) ==========
[13:57:36] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:36] ========== Stale build configuration (hello_world - build/hello_world) ==========
[13:57:36] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:36] ========== Stale build configuration (hello_world - build) ==========
[13:57:36] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:36] ========== Stale build configuration (hello_world - build/hello_world) ==========
[13:57:36] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:36] ========== Stale build configuration (hello_world - build/hello_world) ==========
[13:57:36] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:37] ========== Stale build configuration (hello_world - build) ==========
[13:57:37] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:37] ========== Stale build configuration (hello_world - build/hello_world) ==========
[13:57:37] Unable to find the toolchain at path: /usr/bin/gcc
[13:57:37] ========== Stale build configuration (hello_world - build) ==========
[13:57:37] Unable to find the toolchain at path: /usr/bin/gcc


The problem is that since the extension is not convinced that the project was built it hides all action buttons. All I get is this:




so it becomes impossible to debug/run without having to resort to custom launch commands or manually configuring gdb which defeats the purpose of using the extension in the first place.



  • Hi Nicolas,

    Could you attach your Support Information here?

    Regards,

    Priyanka

  • Hi Nicolas,

    I am checking this internally with the developers and will get back to you.

    -Priyanka

  • Hi Nicolas,

    Thank you for reporting this. It is a known internal issue and we will be working on this.

    -Priyanka

  • The problem appears to be with the compiler choice; Could not find CMAKE_C_COMPILER using the following names: gcc

    Here an build log:

    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v3-zettalink/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: native_posix, qualifiers: native
    Parsing C:/ncs/v3-zettalink/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'C:/ncs/v3-zettalink/nrf/lib/dect_nrplus/tests/ztester/build_2/_sysbuild/empty.conf'
    Merged configuration 'C:/ncs/v3-zettalink/nrf/lib/dect_nrplus/tests/ztester/build_2/_sysbuild/empty.conf'
    Configuration saved to 'C:/ncs/v3-zettalink/nrf/lib/dect_nrplus/tests/ztester/build_2/zephyr/.config'
    Kconfig header saved to 'C:/ncs/v3-zettalink/nrf/lib/dect_nrplus/tests/ztester/build_2/_sysbuild/autoconf.h'
    --
    *****************************
    * Running CMake for ztester *
    *****************************

    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v3-zettalink/nrf/lib/dect_nrplus/tests/ztester
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v3-zettalink/zephyr/.cache
    -- Zephyr version: 4.0.99 (C:/ncs/v3-zettalink/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: native_posix, qualifiers: native
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/0b393f9e1b/opt/zephyr-sdk)
    -- Found toolchain: host (gcc/ld)
    CMake Error at C:/ncs/v3-zettalink/zephyr/cmake/compiler/host-gcc/generic.cmake:5 (find_program):
    Could not find CMAKE_C_COMPILER using the following names: gcc
    Call Stack (most recent call first):
    C:/ncs/v3-zettalink/zephyr/cmake/modules/FindHostTools.cmake:115 (include)
    C:/ncs/v3-zettalink/zephyr/cmake/modules/dts.cmake:9 (find_package)
    C:/ncs/v3-zettalink/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
    C:/ncs/v3-zettalink/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v3-zettalink/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:29 (find_package)

Related