Commit Graph

230 Commits

Author SHA1 Message Date
Jakub Kocka
5fdf02ef03 Merge branch 'fix/win_tests' into 'master'
Fix Windows build system timeouts by saving failed command output to files

See merge request espressif/esp-idf!52502
2026-09-21 18:01:02 +08:00
Alexey Lapshin
8834cb9a5e fix(cmake): detect toolchain response-file recursion via path prefix
Skip only @response-file flags under IDF_TOOLCHAIN_BUILD_DIR using
quote-aware parse and cmake_path(IS_PREFIX). Cache the toolchain build
dir as REALPATH so prefix checks compare against a stable path spelling.
2026-09-19 10:44:09 +08:00
Jakub Kocka
c082e6a25d ci(tools): Keep Windows build-system work dir short and logs off the live log
Relative CI_PROJECT_DIR after cd nested --work-dir under tools/test_build_system
and blew MAX_PATH. Save failed-command output next to artifacts instead of
streaming a 12 KB record that still hangs shard 3/6.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 20:45:13 +08:00
Jakub Kocka
fa7372d1c4 ci(tools): Verify submodules were copied into the idf_copy worktree
git worktree add leaves every submodule as an empty directory, and the
copy loop skipped any submodule it could not read from the source repo.

The placeholder then stayed in the copy and the build failed much later
in an unrelated component, as a missing mbedtls/include or tlsf.c

Check each submodule in the destination after copying it. If one is
still a placeholder, drop the worktree and create the copy with
shutil.copytree, which does not depend on the submodule state of the source checkout
2026-09-17 20:45:13 +08:00
Jakub Kocka
93f39c9169 ci(tools): Avoid live-log the hints test failure on Windows 2026-09-17 20:45:13 +08:00
Sudeep Mohanty
6933b41314 Merge branch 'feat/ulp_component_split' into 'master'
refactor(ulp): separate the ULP coprocessor code from the driver

Closes IDF-15957

See merge request espressif/esp-idf!52268
2026-09-15 11:49:23 +02:00
Roland Dobai
2e6d41c2e9 Merge branch 'task/buildv2_gdbinit_multi_exec' into 'master'
feat(cmakev2): parameterize gdbinit for multi-executable builds

Closes IDF-15860

See merge request espressif/esp-idf!51239
2026-09-10 10:59:42 +02:00
Marius Vikhammer
b38c8a0625 Merge branch 'feat/llvm-opt-integration' into 'master'
feat(compiler): add ESP-IDF LLVM optimization enablement framework

See merge request espressif/esp-idf!51154
2026-09-07 10:11:37 +08:00
Sudeep Mohanty
4756c1ec75 test(cmakev2): add gdbinit single and multi-binary tests
Cover the default single-executable output directory and per-executable
gdbinit generation in a multi-binary build.
2026-09-04 13:00:09 +08:00
Roland Dobai
c63f12f2d0 Merge branch 'fix/kconfig_test_format' into 'master'
fix: KConfig test output format

See merge request espressif/esp-idf!52329
2026-09-03 12:52:44 +02:00
chenqian
25046e7959 feat(compiler): add ESP-IDF LLVM optimization enablement framework
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-03 13:02:58 +08:00
Daniel Paul
1c70539375 fix: KConfig test output format 2026-09-02 13:19:40 +02:00
Marius Vikhammer
ff6371a140 Merge branch 'task/remove_build_components_var_in_buildv2' into 'master'
change(build): drop BUILD_COMPONENTS support and migrate test_apps to not use it for buildv2

Closes IDF-15859

See merge request espressif/esp-idf!51695
2026-09-02 19:19:08 +08:00
Sudeep Mohanty
cb2b2f9b78 refactor(ulp): build the ULP coprocessor code as per-architecture components
A ULP program is built against ulp_riscv, lp_core or ulp_fsm, each stating its
own sources, dependencies and memory layout. Sources shared with the driver
stay in components/ulp.
2026-09-02 09:31:07 +02:00
Sudeep Mohanty
1bec6e09d9 refactor(ulp): make the ULP subproject directory explicit
components/ulp/cmake holds the project that builds a ULP program. Name it
subproject, as the bootloader does.
2026-09-02 09:31:07 +02:00
Jakub Kocka
2a07ad46e7 ci(tools): Clip idf.py failure logs so Windows log_cli cannot stall
pytest.ini enables log_cli, so logging the full ninja stdout after a
failed first-time build is one multi-MB ERROR. That hung shard 3/6 for
hours after the hints test. Log the last 80 lines; keep the full output
on the exception and at DEBUG.
2026-09-01 09:18:32 +02:00
Jakub Kocka
02a689149c ci(tools): Don't abort idf_copy when a worktree submodule is a gitlink
git worktree add materializes submodules as gitlink files. rmtree() cannot
remove those, and exists()+iterdir() on a source gitlink raises and falls
back to shutil.copytree, which leaves mbedtls/include as a file. Unlink
dest gitlinks and only copy populated source directories.
2026-09-01 09:18:31 +02:00
Sudeep Mohanty
b91f894234 change(build): reject BUILD_COMPONENTS in all cmakev2 builds
The compatibility shim populated BUILD_COMPONENTS from the library
interface's linked-components list so that consumers reading it kept
working. Those consumers now query the library interface directly, so
drop the shim population and reject reads of the property
unconditionally.
2026-08-26 15:28:18 +02:00
Roland Dobai
e37a7ae137 Merge branch 'feat/cmakev2-configdep' into 'master'
feat: Adopt rebuild optimization tool (configdep) in cmakev2

Closes IDF-15301

See merge request espressif/esp-idf!51263
2026-08-24 13:53:47 +02:00
Jan Beran
8b213b517d feat: Adopt rebuild optimization tool (configdep) in cmakev2 2026-08-20 15:57:10 +08:00
Marius Vikhammer
5c0facdaba fix(cmakev2): include config-selected default components 2026-08-20 11:09:58 +08:00
Marius Vikhammer
71ec4f2699 Merge branch 'fix/buildv2_ldgen_template_rebuild_test' into 'master'
fix(test_build_system): fix ldgen template rebuild test for build system v2

See merge request espressif/esp-idf!51732
2026-08-20 11:08:46 +08:00
Daniel Paul
7e6fc433cc chore: Pin the testing versions of components 2026-08-18 20:51:54 +08:00
Daniel Paul
39de6e1429 fix: Kconfig test - Make assertion whitespace-insensitive 2026-08-18 20:51:54 +08:00
Daniel Paul
b764f073ac feat: Consume root-managed components from IDF Component Manager 2026-08-18 20:51:54 +08:00
Jakub Kocka
5889cba730 ci(tools): Fix worktree submodule copy of gitlink files 2026-08-17 11:53:09 +02:00
Sudeep Mohanty
5f546d080a fix(test_build_system): fix ldgen template rebuild test for build system v2
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-17 07:59:40 +02:00
Frantisek Hrbata
a9de9dc172 Merge branch 'fix/ldgen_template_fingerprint' into 'master'
fix(ldgen): add the linker template to the generation fingerprint

See merge request espressif/esp-idf!51620
2026-08-10 08:31:03 +02:00
Frantisek Hrbata
5d4e96aeb8 fix(ldgen): add the linker template to the generation fingerprint
ldgen skips regeneration when a fingerprint over the section names, the
linker fragment files, sdkconfig and Kconfig is unchanged. The linker
script template was not part of that fingerprint, even though everything
outside its mapping placeholders is copied into the generated script
verbatim.

The build system regenerates the preprocessed template whenever any of
its inputs changes, not only when a linker fragment changes. When such a
change reaches ldgen but leaves the section names alone, the fingerprint
still matches, generation is skipped, and the image is linked against the
previously generated script. The skip path updates the mtime of the
output, so nothing in the build output shows that the change was dropped.

Add the template to the fingerprint so that regenerating it always
regenerates the linker script.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2026-08-07 10:39:10 +02:00
Renz Bagaporo
dfc3f54445 test(cmake): verify included linker scripts trigger preprocessing 2026-08-06 09:18:13 +09:00
Alexey Gerenkov
72732994ef Merge branch 'feature/enable_atomic_lock_policy_on_riscv' into 'master'
feat(build): add CONFIG_COMPILER_CXX_ATOMIC_LOCK_POLICY option

See merge request espressif/esp-idf!49913
2026-08-04 20:05:40 +08:00
Renz Bagaporo
1f5cba3070 fix(ulp): clarify buildv2 child marker
Rename the internal ULP child-build marker to __ULP_BUILDV2 so component CMake files make the build-system scope explicit.

Document that the marker is currently set only by the IDF_BUILD_V2 ULP child path.
2026-07-29 13:08:23 +09:00
Renz Bagaporo
83cdcc1da3 fix(ulp): use builtin v2 project for legacy embed
Route ulp_embed_binary() through a built-in CMake v2 default ULP project instead of generating a compatibility project with a synthetic main component.

Attach legacy ULP sources directly to the ULP executable, pass the parent component include view through the existing ULP_S_SOURCES/COMPONENT_* channel, and remove the generated legacy project templates plus the component path ownership validation bypass they required.

Update the build-system coverage to assert that the builtin child project builds and rebuilds when parent-owned ULP sources change.
2026-07-29 13:08:23 +09:00
Renz Bagaporo
dc813d91ea test(build_system): fix buildv2 pytest coverage
Allow the reconfigure test to assert the buildv2 activation message when pytest runs with --buildv2.

Make the ULP API probe use CMake-friendly forward-slash paths and an explicit ULP toolchain/custom-toolchain setting so the direct cmake configure works on Windows as well as Linux.
2026-07-29 13:08:23 +09:00
Renz Bagaporo
48374cb8fa test(build_system): add CMake v2 ULP legacy shim coverage 2026-07-29 13:08:22 +09:00
Alexey Lapshin
77420a6f78 Merge branch 'feature/use_zcmp_by_default' into 'master'
feat(build): add ZCMP workaround post-build check

See merge request espressif/esp-idf!49764
2026-07-28 14:00:37 +04:00
Alexey Lapshin
b3ae652f21 feat(build): add CONFIG_COMPILER_CXX_ATOMIC_LOCK_POLICY option
libstdc++ selects between a lock-free and a mutex-based policy for
std::shared_ptr reference counting based on this macro. Enabling this
option forces the lock-free policy, which avoids pulling in the
mutex-based implementation and can reduce code size.

Note: the lock-free policy avoids embedding a mutex in each control
block, saving about 88 bytes per shared_ptr, and improves performance
by using atomic operations instead of mutex locking.

Note: this option changes the ABI of libstdc++ atomic/shared_ptr
helpers. It can be incompatible when linking against prebuilt
libraries that were compiled without it, leading to link errors or
undefined runtime behavior. Only enable it if all C++ objects and
libraries in the build use the same setting.
2026-07-23 18:20:25 +07:00
Alexey Lapshin
631ad9033c feat(build): add RISC-V ZCMP post-link workaround check
Validate linked RISC-V executables when
CONFIG_COMPILER_ENABLE_RISCV_ZCMP is enabled on affected chips.
Disassemble each function and reject mstatus.MIE clears that lack an
earlier mintthresh write of 0xff.

Handle csrrci, csrrw, and register-mask csrrc patterns while ignoring
csrrs. Add build-only coverage for valid and invalid sequences with
CMake v1 and v2.

Stop the hardware stack guard before switching stacks during restart,
and keep ZCMP disabled for TEE test apps that still require the
workaround.
2026-07-22 13:04:20 +07:00
Daniel Paul
ee93f899c2 chore: Remove old root managed components tests 2026-07-21 16:01:27 +02:00
Renz Christian Bagaporo
faca8f56a3 Merge branch 'feat/cmakev2_ulp_full_subproject' into 'master'
feat(ulp): initial support for building ULP projects as full subprojects under CMake v2

See merge request espressif/esp-idf!50134
2026-07-16 21:00:32 +08:00
Marek Fiala
8c08c75f48 feat(tools): adopt esp-pylib for idf.py logging and errors
Migrate idf.py and its actions to the shared esp-pylib library:
- add esp-pylib (and esp-pylib[ide]) to the core/ide requirements
- base FatalError on esp_pylib.errors.FatalError, keeping the idf.py ctx cleanup
- replace the local raw-ANSI helpers (red_print/yellow_print/print_warning/
  color_print) with esp_pylib.logger.log (warn/err/note/hint) across the
  idf.py actions
- install esp_pylib exception reporting at the idf.py entry point and silence
  the logger during shell completion
- update affected tests for the new prefixes/line wrapping
- add normalize_output() helper and unify terminal env in conftest to handle
  Rich line-wrapping in CI assertions

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 20:19:07 +08:00
Renz Bagaporo
7d75f85221 feat(ulp): build ULP full subprojects as CMake v2 children 2026-07-15 09:14:35 +09:00
Martin Vychodil
2573bf3988 Merge branch 'feat/bdl_ioctl_checker' into 'master'
feat(esp_blockdev): add build-time ioctl command reservation overlap checker

Closes IDF-15799

See merge request espressif/esp-idf!49670
2026-06-19 12:40:28 +08:00
Martin Vychodil
ddc9c5fc40 fix(test_build_system): require components in ioctl overlap checker tests
Wire esp_blockdev, comp_a, and comp_b into the test app dependency graph
so ioctl def files are registered and the POST_BUILD overlap checker runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 15:57:04 +02:00
Tomáš Rohlínek
a9f545bcea feat(esp_blockdev): add build-time ioctl command reservation overlap checker 2026-06-16 11:38:22 +02:00
Jan Beran
4b12e9a132 fix: update version of esp-idf-configdep in tools.json 2026-06-11 11:05:10 +02:00
Jakub Kocka
2e5d930e6b fix(tools): Windows builds when paths contain spaces (prefix_map, ldgen, CI)
- Harden prefix_map.cmake for paths with spaces on Windows

- ldgen: fragments-list-file, list normalization, CMake integration (tools/cmake + cmakev2)

- CI exclude list for check_tools; test_spaces bundle tweak

Made-with: Cursor
2026-06-04 14:45:05 +08:00
Roland Dobai
941bc94ec6 Merge branch 'feat/generate_per_component_headers' into 'master'
feat(kconfig): add support for per option based build optimization

Closes IDF-8957

See merge request espressif/esp-idf!41966
2026-06-02 19:46:09 +02:00
Jan Beran
3abb4c095b test: add esp-idf-configdep integration tests
Add build-level tests verifying configdep selective rebuild behavior:
- test_configdep.py: selective rebuild (only affected .obj rebuilt) and
  ELF string verification after Kconfig toggle
- test_rebuild_configdep.py: full rebuild graph tests with configdep enabled,
  including the two-build "settle" pattern for .cdep stub timestamps

Place the configdep test app in tools/test_build_system/configdep_test_app/
alongside the build system test infrastructure. Split configdep-specific
rebuild coverage from pure CMake/Ninja rebuild tests (test_rebuild.py runs
with configdep disabled via a module-local idf_py fixture).
2026-06-02 01:26:10 +08:00
Marek Fiala
f8799b8bba feat(tools): idf.py --help custom CMake targets rich-click style 2026-06-01 20:07:27 +08:00