Skip to content

Commit

Permalink
prefer computed python venv path (#1263)
Browse files Browse the repository at this point in the history
* prefer computed python venv path

* move appendIdfAndToolsToPath to computed py env

* update test python install python

* update default idf pythonInstallPath

* remove tasks json tests assert

* rm python ref existing setup

* re add src views to exclude

* hide changelog message

* use test workspace for settings.json

* rm customExtraPaths and sep customExtraVars

* rm idf.pythonBinPath from docs

* rm dfu settings

* update getting system python

* fix trace settings as number type

* update array to be rendered in settings ui

* rm adapterTargetName setting use sdkconfig instead

* add undefined workspace get sdkconfig file validation

* update docs

* fix embed python path in pyManager getSystemPython

* rm Scripts from getSystemPython

* fix lint
  • Loading branch information
brianignacio5 authored Sep 23, 2024
1 parent e31b39d commit 37489ec
Show file tree
Hide file tree
Showing 112 changed files with 1,369 additions and 1,605 deletions.
4 changes: 2 additions & 2 deletions .github/actions/idf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ENV CODE_VERSION="min"

ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
ENV NODE_VERSION v16.16.0
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
ENV NODE_VERSION v18.19.1
RUN . "${NVM_DIR}/nvm.sh" && nvm install ${NODE_VERSION} && nvm use --delete-prefix ${NODE_VERSION}

ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: "recursive"

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ jobs:
with:
run: /ui-entrypoint.sh

- name: See if screenshots are generated
if: failure()
run: ls /github/workspace/test-resources/screenshots

- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: test-resources/screenshots/*.png
path: /github/workspace/test-resources/screenshots
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,11 @@ We have implemented some utilities commands that can be used in tasks.json and l
```

- `espIdf.getExtensionPath`: Get the installed location absolute path.
- `espIdf.getOpenOCDScriptValue`: Return the value of OpenOCD_SCRIPTS from `idf.customExtraVars` or from system OpenOCD_SCRIPTS environment variable.
- `espIdf.getOpenOCDConfig`: Return the OpenOCD configuration files as string. Example `-f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg`.
- `espIdf.getOpenOcdScriptValue`: Return the value of OPENOCD_SCRIPTS computed from ESP-IDF Tools path or from `idf.customExtraVars` or from system OPENOCD_SCRIPTS environment variable.
- `espIdf.getOpenOcdConfig`: Return the openOCD configuration files as string. Example `-f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg`.
- `espIdf.getProjectName`: Return the project name from current workspace folder `build/project_description.json`.
- `espIdf.getToolchainGcc`: Return the absolute path of the toolchain gcc for the ESP-IDF target given by `idf.adapterTargetName` configuration setting and `idf.customExtraPaths`.
- `espIdf.getToolchainGdb`: Return the absolute path of the toolchain gdb for the ESP-IDF target given by `idf.adapterTargetName` configuration setting and `idf.customExtraPaths`.
- `espIdf.getToolchainGcc`: Return the absolute path of the toolchain gcc for the ESP-IDF target given by current IDF_TARGET in sdkconfig.
- `espIdf.getToolchainGdb`: Return the absolute path of the toolchain gdb for the ESP-IDF target given by current IDF_TARGET in sdkconfig.

See an example in the [debugging](./docs/DEBUGGING.md) documentation.

Expand Down
6 changes: 3 additions & 3 deletions docs/COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Please read [GCOV Code coverage](https://docs.espressif.com/projects/esp-idf/en/

Your ESP-IDF project should be configured to generate gcda/gcno coverage files using gcov as shown in [GCOV Code Coverage](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#gcov-source-code-coverage). Please take a look at the [ESP-IDF gcov Example](https://github.com/espressif/esp-idf/tree/master/examples/system/gcov) as example project.

Make sure you had properly configure the toolchain in `idf.customExtraPaths` or in your environment variable PATH since the gcov executable used is `{TOOLCHAIN_PREFIX}-gcov` (replacing TOOLCHAIN_PREFIX for your IDF_TARGET toolchain prefix).
Make sure you had properly configure the toolchain in `idf.toolsPath` or in your environment variable PATH since the gcov executable used is `{TOOLCHAIN_PREFIX}-gcov` (replacing TOOLCHAIN_PREFIX for your IDF_TARGET toolchain prefix).

The **ESP-IDF: Configure Project SDKConfig for Coverage** command can set required values in your project SDKConfig to enable Code Coverage.

## Editor Coverage

For the text editor highlighting, the **ESP-IDF: Add Editor Coverage** command execute a child process with `{TOOLCHAIN_PREFIX}-gcov` to parse all gcda generated files and generate a JSON report. You can remove the coverage highlight with **ESP-IDF: Remove Editor Coverage**.

> **NOTE:** This assumes you had configure your extension with Xtensa or RISC-V toolchain in `idf.customExtraPaths`.
> **NOTE:** This assumes you had configure your extension with Xtensa or RISC-V toolchain in `idf.toolsPath`.
For the text editor, we use the json object generated by the previous command to highlight each line if it is covered or if it is not. We don't highlight noncode lines.

Expand All @@ -30,4 +30,4 @@ You can customize highlight color using the extension settings. Visual Studio co

The **ESP-IDF: Get HTML Coverage Report for Project** execute a child process with `{TOOLCHAIN_PREFIX}-gcov` to parse all gcda generated files for the HTML report.

> **NOTE:** This assumes you had configure your extension with Xtensa toolchain in `idf.customExtraPaths`.
> **NOTE:** This assumes you had configure your extension with Xtensa or RISC-V toolchain in `idf.toolsPath`.
2 changes: 1 addition & 1 deletion docs/C_CPP_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For the default configuration, you must build your project beforehand in order t
}
```

> **NOTE:** When you create a project using the extension commands such as `Show Examples Projects`, `New Project`, `Create Project from Extension Template` or you add the configuration files to an existing project using the `Add .vscode Configuration Folder`, this file is created with the compilerPath of the configured toolchain for your current `idf.adapterTargetName`.
> **NOTE:** When you create a project using the extension commands such as `Show Examples Projects`, `New Project`, `Create Project from Extension Template` or you add the configuration files to an existing project using the `Add .vscode Configuration Folder`, this file is created with the compilerPath of the configured toolchain for your current `IDF_TARGET` in sdkconfig.
## Recursive search configuration

Expand Down
1 change: 0 additions & 1 deletion docs/DEBUGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ you can also use [Microsoft C/C++ Extension](https://marketplace.visualstudio.co
"program": "${workspaceFolder}\\build\\${command:espIdf.getProjectName}.elf"
},
"cwd": "${workspaceFolder}",
"environment": [{ "name": "PATH", "value": "${config:idf.customExtraPaths}" }],
"setupCommands": [
{ "text": "set remotetimeout 20" },
],
Expand Down
4 changes: 2 additions & 2 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This extension provides many features to ease development of ESP-IDF Projects.
- [System View Tracing Viewer](./SYS_VIEW_TRACING_VIEWER.md)
- Localization (English, Chinese, Spanish) of commands which you can also [add a language contribution](./LANG_CONTRIBUTE.md).
- [Code Coverage](./COVERAGE.md) for editor source highlighting and generate HTML reports.
- Search text editor's selected text in ESP-IDF documentation with **ESP-IDF: Search in Documentation...** right click command or with its [keyboard shortcut](#Available-commands). Results will be shown in ESP-IDF Explorer Tab if found on ESP-IDF Documentation based on your current vscode language, ESP-IDF version in `idf.espIdfPath` (latest otherwise) and `idf.adapterTargetName`.
- Search text editor's selected text in ESP-IDF documentation with **ESP-IDF: Search in Documentation...** right click command or with its [keyboard shortcut](#Available-commands). Results will be shown in ESP-IDF Explorer Tab if found on ESP-IDF Documentation based on your current vscode language, ESP-IDF version in `idf.espIdfPath` (latest otherwise) and current `IDF_TARGET` in sdkconfig.
- [ESP Rainmaker Support](./ESP_RAINMAKER.md)
- [Core Dump and GdbStub](./POSTMORTEM.md) postmortem mode.
- [CMake Editor](#CMake-Editor)
Expand Down Expand Up @@ -442,7 +442,7 @@ The **Add Arduino-ESP32 as ESP-IDF Component** command will add [Arduino-ESP32](

Click <kbd>F5</kbd> to start debugging. To configure the debug behaviour, please review [DEBUGGING](./DEBUGGING.md).

> **NOTE** For correct debug experience, first define the correct `idf.customExtraPaths` paths and `idf.customExtraVars` using [SETUP](./SETUP.md), `build` your project, choose the right serial port, `flash` the program to your device.
> **NOTE** For correct debug experience, first define the correct settings configuration using [SETUP](./SETUP.md), `build` your project, choose the right serial port, `flash` the program to your device.
## CMakeLists.txt Editor

Expand Down
1 change: 0 additions & 1 deletion docs/PROJECT_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Use the `ESP-IDF: Open Project Configuration` to manage the project configuratio
`idf.sdkconfigDefaults`

`idf.customExtraVars`
`idf.adapterTargetName`
`idf.flashBaudRate`
`idf.monitorBaudRate`

Expand Down
Loading

0 comments on commit 37489ec

Please sign in to comment.