Skip to content

Conversation

@radurentea
Copy link
Collaborator

Description

Before this fix, if you had a project configured for multiple configurations, when setting an idf target, the relative paths inside esp_idf_project_configuration.json would get resolved to absolute paths.

Example of esp_idf_project_configuration.json can be seen in #1575.

Fixes #1575

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Steps to test this pull request

  1. Create multi-config esp-idf example.
  2. Create the following "esp_idf_project_configuration.json" file at the root level of the project:
{
  "prod1": {
    "build": {
      "compileArgs": [],
      "ninjaArgs": [],
      "buildDirectoryPath": "build_prod1",
      "sdkconfigDefaults": [
        "sdkconfig.prod_common",
        "sdkconfig.prod1"
      ]
    },
    "env": {},
    "idfTarget": "",
    "flashBaudRate": "",
    "monitorBaudRate": "",
    "openOCD": {
      "debugLevel": -1,
      "configs": [],
      "args": []
    },
    "tasks": {
      "preBuild": "",
      "preFlash": "",
      "postBuild": "",
      "postFlash": ""
    }
  }
}
  1. Select "prod1" profile from status bar or by using the command "ESP-IDF: Select Project Configuration"
  2. Set IDF target from status bar or by using the command "ESP-IDF: Set Espressif Device Target"

Setting the device target should not change the relative paths inside esp_idf_project_configuration.json to absolute paths.

How has this been tested?

As described above

Test Configuration:

  • ESP-IDF Version: 5.4
  • OS (Windows,Linux and macOS): Windows

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@radurentea radurentea self-assigned this Jun 2, 2025
@github-actions
Copy link

github-actions bot commented Jun 2, 2025

Download the artifacts for this pull request:
You can test these changes by installing this VSIX by click menu View -> Command Palette..., type Install from VSIX and then select downloaded esp-idf-extension.vsix file to install the extension.

@radurentea radurentea added this to the v1.11.0 milestone Jun 3, 2025
@radurentea radurentea marked this pull request as draft June 5, 2025 07:31
@radurentea radurentea force-pushed the bugfix/keep-original-paths-for-multi-config branch from 1e6b52d to 8cbf5b2 Compare June 6, 2025 08:39
@radurentea radurentea marked this pull request as ready for review June 18, 2025 07:04
Copy link
Collaborator

@brianignacio5 brianignacio5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@Fabricio-ESP Fabricio-ESP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed full path is not replaced on project configuration json.

@radurentea radurentea merged commit 009190b into master Jul 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting device target replaces relative paths in esp_idf_project_configurations.json (VSC-1706)

4 participants