VSCode Build Configurator not matching .vscode-nrf-connect.json

Hello,

I have run across this issue, mostly while switching branches. 

The contents of the build directory file, .vscode-nrf-connect.json, are consistent but the build configurator that is part of the nRFConnect extention within vscode fails to pick it up properly or have a mis match. Consistently If I had a slight build difference in one branch then move to another, although the file contents are correct in both branches, the build configuration is broken within the extension.

I hope this can be addressed as it is an annoyance and a bit of a time eater.

Thank you

  • For context, here is the .vscode-nrf-connect.json file for one build

    {
      "toolchainPath": "${nrf-connect.toolchain:3.4.1}",
      "sdkPath": "${nrf-connect.sdk:3.4.1}",
      "board": "slx_blc/nrf54l15/cpuapp",
      "boardDir": "${workspaceFolder:Common}/_boards/boards/vendor/Evluma/slx_blc",
      "boardDirs": [
        "${workspaceFolder:Common}/_boards/boards/vendor/Evluma/slx_blc"
      ],
      "optimizations": "default",
      "cmakeArgs": [
        "-DSB_OVERLAY_CONFIG=${APP_DIR}/sysbuild/bE1B0.conf",
        "-DSLX-BLC_DEBUG_THREAD_INFO=Off"
      ],
      "confFiles": [
        "prj.conf",
        "prj_E1B0.conf"
      ],
      "buildDirectory": "bE1B0",
      "kconfigFragments": [],
      "snippets": [],
      "dtcOverlays": [
        "${workspaceFolder:Common}/_overlays/slx_blc_E1B0.overlay"
      ],
      "extraDtcOverlays": [],
      "boardRoot": "${workspaceFolder:Common}/_boards"
    }

    and here is a screen shot of the build configuration extension

  • Hi, this is a generated file for older SDKs, and only used as a fallback. Please do not version control or care about it.

    In 3.4.1, the `build/build_info.yml` is what is used to detect the build command.

    If your intention is to save and version control build commands, please use cmake presets instead:

    Then you load this when adding a configuration:

    It does not support 100% of the cmake presets spec. For a foolproof way, save the west command and use it rebuild after switching branches. This will refresh the `build_info.yml` with correct info:

Related