Skip to content

topology2: Add support for SYMLINKs for topologies and convert the WCL DMIC functions to symlink to the PTL ones. - #11174

Open
ujfalusi wants to merge 2 commits into
thesofproject:mainfrom
ujfalusi:peter/wcl-dmic2
Open

topology2: Add support for SYMLINKs for topologies and convert the WCL DMIC functions to symlink to the PTL ones.#11174
ujfalusi wants to merge 2 commits into
thesofproject:mainfrom
ujfalusi:peter/wcl-dmic2

Conversation

@ujfalusi

@ujfalusi ujfalusi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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:

-rw-r--r-- 1 pujfalus pujfalus  24403 Sep  7 14:18 sof-ptl-dmic-2ch-id2.tplg
-rw-r--r-- 1 pujfalus pujfalus  24403 Sep  7 14:18 sof-ptl-dmic-2ch-id3.tplg
-rw-r--r-- 1 pujfalus pujfalus  24403 Sep  7 14:18 sof-ptl-dmic-2ch-id4.tplg
-rw-r--r-- 1 pujfalus pujfalus  24403 Sep  7 14:18 sof-ptl-dmic-2ch-id5.tplg
-rw-r--r-- 1 pujfalus pujfalus  23787 Sep  7 14:18 sof-ptl-dmic-4ch-id2.tplg
-rw-r--r-- 1 pujfalus pujfalus  23787 Sep  7 14:18 sof-ptl-dmic-4ch-id3.tplg
-rw-r--r-- 1 pujfalus pujfalus  23787 Sep  7 14:18 sof-ptl-dmic-4ch-id4.tplg
-rw-r--r-- 1 pujfalus pujfalus  23787 Sep  7 14:18 sof-ptl-dmic-4ch-id5.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-2ch-id2.tplg -> sof-ptl-dmic-2ch-id2.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-2ch-id3.tplg -> sof-ptl-dmic-2ch-id3.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-2ch-id4.tplg -> sof-ptl-dmic-2ch-id4.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-2ch-id5.tplg -> sof-ptl-dmic-2ch-id5.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-4ch-id2.tplg -> sof-ptl-dmic-4ch-id2.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-4ch-id3.tplg -> sof-ptl-dmic-4ch-id3.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-4ch-id4.tplg -> sof-ptl-dmic-4ch-id4.tplg
lrwxrwxrwx 1 pujfalus pujfalus     25 Sep  7 14:18 sof-wcl-dmic-4ch-id5.tplg -> sof-ptl-dmic-4ch-id5.tplg

We can use this symlink mode to reduce the size of the topology deployment by converting the identical topologies to symlinks later.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 SYMLINKS mechanism in topology2 production builds to generate .tplg symlinks.
  • 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.

Comment thread tools/topology/topology2/CMakeLists.txt Outdated
Comment on lines +11 to +13
# 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/"
Comment on lines +45 to +49
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>
@ujfalusi

ujfalusi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Changes since v1:

  • Use quotes to handle spaces in path/names.

@intel-sofci

intel-sofci commented Sep 7, 2026

Copy link
Copy Markdown

PR 11174: test results

Run date: 2026-09-07 12:57 UTC

Tested commit: dd2eeae5fabadb1cefa96059f80496885ed4ace6

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@ujfalusi

ujfalusi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

should be taken for 2.15 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants