mirror of
https://github.com/esphome/esphome.git
synced 2026-10-03 01:35:59 +00:00
[esp32] Enable the precompiled header on the PlatformIO toolchain (#19825)
This commit is contained in:
@@ -13,7 +13,6 @@ import re
|
|||||||
from esphome.build_helpers.ccache import effective_ccache_basedir, parse_enable_env
|
from esphome.build_helpers.ccache import effective_ccache_basedir, parse_enable_env
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
PLATFORM_BK72XX,
|
PLATFORM_BK72XX,
|
||||||
PLATFORM_ESP32,
|
|
||||||
PLATFORM_LN882X,
|
PLATFORM_LN882X,
|
||||||
PLATFORM_NRF52,
|
PLATFORM_NRF52,
|
||||||
PLATFORM_RTL87XX,
|
PLATFORM_RTL87XX,
|
||||||
@@ -50,7 +49,6 @@ PCH_DEFAULT_HEADERS = ("esphome/core/pch_prefix.h",)
|
|||||||
PCH_SCRIPT_EXCLUDED_PLATFORMS = frozenset(
|
PCH_SCRIPT_EXCLUDED_PLATFORMS = frozenset(
|
||||||
{
|
{
|
||||||
PLATFORM_BK72XX,
|
PLATFORM_BK72XX,
|
||||||
PLATFORM_ESP32,
|
|
||||||
PLATFORM_LN882X,
|
PLATFORM_LN882X,
|
||||||
PLATFORM_NRF52,
|
PLATFORM_NRF52,
|
||||||
PLATFORM_RTL87XX,
|
PLATFORM_RTL87XX,
|
||||||
|
|||||||
@@ -546,10 +546,6 @@ ESP32_PLATFORMIO_TRIGGER_PATH_PREFIXES = (
|
|||||||
*_SMOKE_HARNESS_TRIGGER_PATH_PREFIXES,
|
*_SMOKE_HARNESS_TRIGGER_PATH_PREFIXES,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Standalone files that, when changed, trigger the PlatformIO compile test:
|
|
||||||
# - esphome/build_gen/platformio.py -- the PlatformIO build generator
|
|
||||||
# - script/test_build_components.py -- the harness the job invokes
|
|
||||||
# - .github/workflows/ci.yml -- the job's own definition
|
|
||||||
# Shared by every toolchain smoke-test job: the harness it invokes and the
|
# Shared by every toolchain smoke-test job: the harness it invokes and the
|
||||||
# workflow that defines it
|
# workflow that defines it
|
||||||
_SMOKE_HARNESS_TRIGGER_FILES = frozenset(
|
_SMOKE_HARNESS_TRIGGER_FILES = frozenset(
|
||||||
@@ -559,8 +555,14 @@ _SMOKE_HARNESS_TRIGGER_FILES = frozenset(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Standalone files that, when changed, trigger the PlatformIO compile test
|
||||||
ESP32_PLATFORMIO_TRIGGER_FILES = _SMOKE_HARNESS_TRIGGER_FILES | {
|
ESP32_PLATFORMIO_TRIGGER_FILES = _SMOKE_HARNESS_TRIGGER_FILES | {
|
||||||
|
# The PlatformIO build generator
|
||||||
"esphome/build_gen/platformio.py",
|
"esphome/build_gen/platformio.py",
|
||||||
|
# Decides which platforms take the pch script in esphome/platformio/,
|
||||||
|
# and the module that parses its switch and the ccache settings
|
||||||
|
"esphome/build_helpers/pch.py",
|
||||||
|
"esphome/build_helpers/ccache.py",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1089,6 +1089,9 @@ _ESP32_PLATFORMIO_FULL_LIST_FILES = [
|
|||||||
# PlatformIO subsystem (path-prefix trigger) + build generator
|
# PlatformIO subsystem (path-prefix trigger) + build generator
|
||||||
["esphome/platformio/runner.py"],
|
["esphome/platformio/runner.py"],
|
||||||
["esphome/platformio/toolchain.py"],
|
["esphome/platformio/toolchain.py"],
|
||||||
|
# Decides which platforms take the pch script
|
||||||
|
["esphome/build_helpers/pch.py"],
|
||||||
|
["esphome/build_helpers/ccache.py"],
|
||||||
["esphome/build_gen/platformio.py"],
|
["esphome/build_gen/platformio.py"],
|
||||||
# Workflow / harness files
|
# Workflow / harness files
|
||||||
["script/test_build_components.py"],
|
["script/test_build_components.py"],
|
||||||
@@ -1150,6 +1153,9 @@ def test_esp32_platformio_components_to_test_returns_full_list_on_infrastructure
|
|||||||
# Non-PlatformIO files in esphome/build_gen/ do NOT trigger the
|
# Non-PlatformIO files in esphome/build_gen/ do NOT trigger the
|
||||||
# full list -- only esphome/build_gen/platformio.py is a trigger.
|
# full list -- only esphome/build_gen/platformio.py is a trigger.
|
||||||
(["esphome/build_gen/espidf.py"], [], []),
|
(["esphome/build_gen/espidf.py"], [], []),
|
||||||
|
# The rest of build_helpers/ is not a trigger.
|
||||||
|
(["esphome/build_helpers/size_summary.py"], [], []),
|
||||||
|
(["esphome/build_helpers/ninja.py"], [], []),
|
||||||
# Docs / unrelated files -> empty.
|
# Docs / unrelated files -> empty.
|
||||||
(["README.md"], [], []),
|
(["README.md"], [], []),
|
||||||
([], [], []),
|
([], [], []),
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ def test_pch_checksum_tracks_closure_content(tmp_path: Path) -> None:
|
|||||||
assert base != pch.pch_checksum(tmp_path, ["root.h"], ["id"])
|
assert base != pch.pch_checksum(tmp_path, ["root.h"], ["id"])
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("platform", ["esp8266", "rp2"])
|
@pytest.mark.parametrize("platform", ["esp32", "esp8266", "rp2"])
|
||||||
def test_pch_script_enabled(platform: str, monkeypatch: pytest.MonkeyPatch) -> None:
|
def test_pch_script_enabled(platform: str, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||||
CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: platform}
|
CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: platform}
|
||||||
assert pch.pch_script_enabled()
|
assert pch.pch_script_enabled()
|
||||||
|
|||||||
Reference in New Issue
Block a user