topology2: Add support for SYMLINKs for topologies and convert the WCL DMIC functions to symlink to the PTL ones. - #11174
topology2: Add support for SYMLINKs for topologies and convert the WCL DMIC functions to symlink to the PTL ones.#11174ujfalusi wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new build commands should be adjusted to properly quote paths/arguments (and use VERBATIM where appropriate) to avoid build failures in common environments (e.g., build directories with spaces).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the topology2 build system to support generating topology outputs as symbolic links (via a new SYMLINKS list), and uses this to deduplicate WCL DMIC “function” topologies by symlinking them to the equivalent PTL outputs, reducing deployment size.
Changes:
- Add a
SYMLINKSmechanism in topology2 production builds to generate.tplgsymlinks. - Convert WCL DMIC function topologies to symlinks pointing to PTL DMIC function topologies.
- Update the top-level topology2 deployment copy step to preserve symbolic links.
File summaries
| File | Description |
|---|---|
| tools/topology/topology2/production/tplg-targets-ace3.cmake | Removes explicit WCL DMIC topology targets and adds SYMLINKS entries mapping WCL DMIC names to PTL DMIC outputs. |
| tools/topology/topology2/production/CMakeLists.txt | Implements building .tplg symlinks from SYMLINKS entries as part of topology2_prod. |
| tools/topology/topology2/CMakeLists.txt | Switches deployment copying to preserve symlinks when staging topology artifacts under target/. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # copy the topology files only to target, preserving symbolic links | ||
| COMMAND sh -c "cp -a production/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg/" | ||
| COMMAND sh -c "cp -a development/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/development/" |
| add_custom_command( | ||
| OUTPUT ${link_name}.tplg | ||
| COMMAND ${CMAKE_COMMAND} -E create_symlink ${link_target}.tplg ${link_name}.tplg | ||
| DEPENDS ${link_target}.tplg | ||
| ) |
Some topologies are byte-for-byte identical to an existing one and only need to be reachable under a different name. Add a SYMLINKS list, processed alongside TPLGS in production/CMakeLists.txt, that creates a real symlink instead of building a duplicate topology. cmake -E copy_if_different dereferences symlinks when deploying the build output, turning them back into regular file copies. Switch to "cp -a" so the deploy step preserves symlinks as symlinks. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
WCL DMIC function topologies are byte-for-byte identical to the PTL ones, only reachable under a different name. Drop the duplicated TPLGS entries and list them in SYMLINKS instead, so they are built as symlinks to the PTL topologies rather than separately compiled duplicates. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
10957a1 to
dd2eeae
Compare
|
Changes since v1:
|
PR 11174: test resultsRun date: 2026-09-07 12:57 UTC Tested commit: dd2eeae5fabadb1cefa96059f80496885ed4ace6 |
|
should be taken for 2.15 release. |
Add support for SYMLINKS array which can be used to create a symlink to an existing topology with a different name to handle duplication.
The first user of this will be WCL's DMIC function topologies since they are identical to the PTL functions.
The resulting target will look like this:
We can use this symlink mode to reduce the size of the topology deployment by converting the identical topologies to symlinks later.