Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch ESP-IDF versions #1173

Merged
merged 7 commits into from
Apr 25, 2024
Merged

Switch ESP-IDF versions #1173

merged 7 commits into from
Apr 25, 2024

Conversation

brianignacio5
Copy link
Collaborator

@brianignacio5 brianignacio5 commented Mar 28, 2024

Description

Add ESP-IDF version switcher.

Fixes #1095

Type of change

  • New feature (non-breaking change which adds functionality)

Steps to test this pull request

Provide a list of steps to test changes in this PR and required output

  1. Click on "ESP-IDF: Select Current ESP-IDF Version". See same list of versions as ESP-IDF: Configure ESP-IDF extension existing setups.
  2. Select another version.
  3. See new version shown in status bar and settings updated in workspace folder .vscode/settings.json
  4. Click on status bar esp-idf version will launch command on step 1.
  • Expected behaviour:
    New selected version is applied to local workspace folder.

  • Expected output:

How has this been tested?

Test Configuration:

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

Checklist

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

@brianignacio5 brianignacio5 self-assigned this Mar 28, 2024
Copy link

github-actions bot commented Mar 28, 2024

Download the artifacts for this pull request:

@brianignacio5 brianignacio5 added this to the v1.8.0 milestone Mar 29, 2024
@brianignacio5 brianignacio5 marked this pull request as ready for review March 29, 2024 11:12
@AndriiFilippov
Copy link
Collaborator

@brianignacio5 hi !

Tested under:
OS - Windows 10
ESP-IDF: v5.2

there is no command "ESP-IDF: Select Current ESP-IDF Version"

@brianignacio5
Copy link
Collaborator Author

@brianignacio5 hi !

Tested under: OS - Windows 10 ESP-IDF: v5.2

there is no command "ESP-IDF: Select Current ESP-IDF Version"

I've tested on Windows and indeed there is. Can you provide troubleshooting information @AndriiFilippov ?

Copy link
Collaborator

@radurentea radurentea left a comment

Choose a reason for hiding this comment

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

LGTM!
Tested on Linux Fedora WS 39

@AndriiFilippov
Copy link
Collaborator

AndriiFilippov commented Apr 3, 2024

@brianignacio5 hi !

Great, now I see only actual ESP-IDF versions.
Does this list update in real time or only once during Extension configuration ?

Because I have installed some IDF using Eclipse IDE(v4.4.7) and cmd(master) -> restart VS Code -> can't see those IDFs in the list.

image

image

@brianignacio5
Copy link
Collaborator Author

brianignacio5 commented Apr 8, 2024

@brianignacio5 hi !

Great, now I see only actual ESP-IDF versions. Does this list update in real time or only once during Extension configuration ?

Because I have installed some IDF using Eclipse IDE(v4.4.7) and cmd(master) -> restart VS Code -> can't see those IDFs in the list.

image

image

This only shown the ESP-IDF setups previously configured with ESP-IDF: Configure ESP-IDF Extension. We don't have a way to find existing ESP-IDF setups until this PR #1028 is merged.

EDIT: Actually it will try to populate all ESP-IDF setups specified in $IDF_TOOLS_PATH/esp_idf.json where IDF_TOOLS_PATH is obtained from current idf.toolsPath

@JarrettR
Copy link

Looks great
W10, tested with a variety of different v4.4 patch versions

@AndriiFilippov
Copy link
Collaborator

@brianignacio5 hi !

Tested under:
OS - Windows 10

everything works fine but current version does not get updated in Status Bar during version switch

image

@AndriiFilippov
Copy link
Collaborator

AndriiFilippov commented Apr 11, 2024

@brianignacio5 hi !

LGTM 👍
able to switch versions v5.1.2 / v5.2 / v4.4.7 and build/flash/monitor project ✔️
do see new version shown in status bar ✔️
do see settings updated in workspace folder .vscode/settings.json ✔️
after configuring extension via "ESP-IDF: Configure ESP-IDF Extension" do see new version added to the
"ESP-IDF: Select Current ESP-IDF Version" list ✔️
do see the new feature follow "Notification mode" rules (do not see any notifications under Silent mode ✔️

@radurentea
Copy link
Collaborator

Hi @brianignacio5,

I've re-tested on Linux Fedora WS 39, it seems that there is a bug if you have IDF Tools installed in the same folder (ex: .espressif):

When you use command Configure ESP-IDF Extension to change to a different version (ex: from 5.2.1 to 4.4.7) the result it's not being reflected in the Status bar component, but it's being set if I check .vscode/settings.json.

Steps to reproduce:

  1. Have 2 versions of esp-idf installed (both using the same esp-idf tools path)
  2. Change version using ESP-IDF: Configure ESP-IDF Extension command
  3. Choose "Use existing setup"
  4. Pick the other version (it's important to have the same IDF Tools path)

I've also notice one scenario that can be a bit confusing for some users. For example:

They have worskpace folder as their scope and have the settings set for v4.4.7. (In global settings they use v5.2.1) They create a new project using the Show Examples Projects command. This project will be created from esp idf 4.4.7 examples which can be incompatible with v5.2.1, so if they try to build it without changing the version again to 4.4.7 build will fail.

I'm not sure if there is a better way than documentation to inform the users about this scenario or about how switching the versions work. Maybe there is a way to analyze the project (at least for esp-idf example projects) to see if it's compatible with the esp-idf version they are using? What do you think?

@brianignacio5
Copy link
Collaborator Author

Hi @brianignacio5,

I've re-tested on Linux Fedora WS 39, it seems that there is a bug if you have IDF Tools installed in the same folder (ex: .espressif):

When you use command Configure ESP-IDF Extension to change to a different version (ex: from 5.2.1 to 4.4.7) the result it's not being reflected in the Status bar component, but it's being set if I check .vscode/settings.json.

Steps to reproduce:

  1. Have 2 versions of esp-idf installed (both using the same esp-idf tools path)
  2. Change version using ESP-IDF: Configure ESP-IDF Extension command
  3. Choose "Use existing setup"
  4. Pick the other version (it's important to have the same IDF Tools path)

I've also notice one scenario that can be a bit confusing for some users. For example:

They have worskpace folder as their scope and have the settings set for v4.4.7. (In global settings they use v5.2.1) They create a new project using the Show Examples Projects command. This project will be created from esp idf 4.4.7 examples which can be incompatible with v5.2.1, so if they try to build it without changing the version again to 4.4.7 build will fail.

I'm not sure if there is a better way than documentation to inform the users about this scenario or about how switching the versions work. Maybe there is a way to analyze the project (at least for esp-idf example projects) to see if it's compatible with the esp-idf version they are using? What do you think?

Hi @radurentea I fixed this status bar update in the last commit.

With regards to ESP-IDF examples, this issue was already present before. Thing is that examples are loaded using IDF_PATH setting and when you read them the workspace folder always have preference on top of global User settings. We could

  1. show the ESP-IDF version in the Examples UI
  2. Copy the IDF settings in current directory in the newly created project (just IDF_PATH, tools and python for example)

@brianignacio5 brianignacio5 merged commit 2cd052f into master Apr 25, 2024
6 checks passed
@brianignacio5 brianignacio5 deleted the feature/idf-version-switch branch April 25, 2024 10:47
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.

[Feature Request]: Better ESP-IDF Version management (VSC-1259)
4 participants