-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds [ccache](https://ccache.dev/) support to the framework and improves general build performance. Of particular importance is keeping the CI runs efficient to conserve resources without sacrificing effectiveness. If they complete a bit faster too, that's a bonus :-) **Reduce CI installation overhead** Since we're using more CI cache space to cache builds, it's at a premium. Fortunately there's quite a lot of stuff we can remove so running a script (`clean-tools.py`) after tool installation (CI only) clears this out so it doesn't end up in the cache. In practice this saves about 1.4GB of (compressed) cache space. Also, for IDF4.3 we can reduce that to a single run for the standard `esp32` SOC. **Installer improvements** Optional packages (e.g. clang-format) only required for Host builds, so don't install them otherwise. Review Windows install scripts: - Install ninja, ccache - Check for undefined environment variables - Check if tools already installed, skip if so and print message - Don't overwrite MinGW if it already exists **Add ccache support** I've never used ccache so wondered what it was doing in the install scripts. Certainly didn't seem to be used anywhere so thinking we could remove it... Nope. Let's use it. Add `ENABLE_CCACHE` setting, and enable in CI builds. Stats (`ccache -sv`) shows half of the calls aren't cacheable. Turns out ccache doesn't support `-MM` which we use for generating header build dependency files. After some investigations turns out we can just use `-MMD` which has several benefits: 1. Allows 100% hit rate via ccache 2. Reduces number of compiler invocations required since `.d` files are generated at the same time as `.o` files 3. Previously, if a source file is moved we got an error such as `No rule to make target '...file.cpp', needed by '...file.cpp.d'. Stop.`. This no longer happens. 4. Works on Windows without `sed` workaround for paths so makefile is simpler/faster. Note that a typical ccache installation may add soft links which override system compilers. For example, `gcc` would actually run `/usr/lib64/ccache/gcc` instead of `/usr/bin/gcc`. If `ENABLE_CCACHE` isn't set then Sming overrides this behaviour (using `CCACHE_DISABLE`) to ensure behaviour consistent with other (cross-compiled) architectures. **Fixes** Update ws_parser submodule. During testing I was getting some complaints about the particular commit not being available. It looks like this repo. got rebased at some point and the current master has changed. No change to content. Python script fixes: `make ide-vscode` fails in Windows, and there's a regex fix to `boardtool.py`. Fix fallthrough warning in LiveDebug sample.
- Loading branch information
Showing
22 changed files
with
329 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,22 +13,18 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
variant: [esp32, esp32s2, esp32c3, esp32s3, esp32c2] | ||
idf_version: ["4.3", "4.4", "5.0", "5.2"] | ||
exclude: | ||
- variant: esp32s3 | ||
idf_version: "4.3" | ||
- variant: esp32c2 | ||
idf_version: ["4.4", "5.0", "5.2"] | ||
include: | ||
- os: ubuntu-latest | ||
variant: esp32 | ||
idf_version: "4.3" | ||
exclude: | ||
- variant: esp32c2 | ||
idf_version: "4.4" | ||
- os: macos-latest | ||
idf_version: "4.3" | ||
- os: macos-latest | ||
idf_version: "4.4" | ||
- os: macos-latest | ||
idf_version: "5.0" | ||
- os: windows-latest | ||
idf_version: "4.3" | ||
- os: windows-latest | ||
idf_version: "5.0" | ||
|
||
|
@@ -42,6 +38,7 @@ jobs: | |
SMING_ARCH: Esp32 | ||
SMING_SOC: ${{ matrix.variant }} | ||
INSTALL_IDF_VER: ${{ matrix.idf_version }} | ||
ENABLE_CCACHE: 1 | ||
|
||
steps: | ||
- name: Fix autocrlf setting | ||
|
@@ -86,6 +83,11 @@ jobs: | |
. Tools/ci/setenv.ps1 | ||
Tools/ci/install.cmd | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ matrix.os }}-${{ matrix.variant }}-${{ matrix.idf_version }} | ||
|
||
- name: Build and test for ${{matrix.variant}} with IDF v${{matrix.idf_version}} on Ubuntu / MacOS | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ jobs: | |
SMING_SOC: ${{ matrix.variant }} | ||
CLANG_BUILD: ${{ matrix.toolchain == 'clang' && '15' || '0' }} | ||
BUILD64: ${{ matrix.toolchain == 'gcc64' && 1 || 0 }} | ||
ENABLE_CCACHE: 1 | ||
|
||
steps: | ||
- name: Fix autocrlf setting | ||
|
@@ -72,6 +73,11 @@ jobs: | |
. Tools/ci/setenv.ps1 | ||
Tools/ci/install.cmd | ||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ matrix.os }}-${{ matrix.toolchain }}-${{ matrix.variant }} | ||
|
||
- name: Build and test for ${{matrix.variant}} on Ubuntu / MacOS | ||
env: | ||
CLANG_FORMAT: clang-format-8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
REM Esp8266 install.cmd | ||
|
||
if "%ESP_HOME%" == "" goto :undefined | ||
if exist "%ESP_HOME%" goto :installed | ||
|
||
set EQT_REPO=https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.2.0-gcc10.3 | ||
set EQT_TOOLCHAIN=x86_64-w64-mingw32.xtensa-lx106-elf-c791b74.230224.zip | ||
|
||
mkdir %ESP_HOME% | ||
curl -Lo %DOWNLOADS%/%EQT_TOOLCHAIN% %EQT_REPO%/%EQT_TOOLCHAIN% | ||
7z -o%ESP_HOME% x %DOWNLOADS%/%EQT_TOOLCHAIN% | ||
|
||
goto :EOF | ||
|
||
|
||
:undefined | ||
echo. | ||
echo ** Cannot install Esp8266 tools: ESP_HOME not defined | ||
echo. | ||
goto :EOF | ||
|
||
|
||
:installed | ||
echo. | ||
echo ** Skipping Esp8266 tools installation: '%ESP_HOME%' exists | ||
echo. | ||
goto :EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule ws_parser
updated
from e94a4b to 76797c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.