Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
73 stars 54 forks source link

Examples (with duplicate source modules) do not build anymore #1683

Open ReinhardKeil opened 1 month ago

ReinhardKeil commented 1 month ago

Describe the bug

Examples that used to build previously do not generate anymore.

This is using https://github.com/Arm-Examples/mlek-cmsis-pack-examples

> cbuild c:\w\mlek-cmsis-pack-examples\mlek.csolution.yml --context-set --update-rte --packs --context object-detection.Debug+AVH-SSE-300
error csolution: source modules added by multiple components:
  filename: C:/Users/reikei01/AppData/Local/Arm/Packs/ARM/ml-embedded-eval-kit-uc-api/22.8.0-Beta/source/math/PlatformMath.cc
    - component: ARM::ML Eval Kit:Common:Math@1.0.0
      from-pack: ARM::ml-embedded-eval-kit-uc-api@22.8.0-Beta
    - component: ARM::ML Eval Kit:Vision:Object detection@1.0.0
      from-pack: ARM::ml-embedded-eval-kit-uc-api@22.8.0-Beta
error csolution: processing context 'object-detection.Debug+AVH-SSE-300' failed
error cbuild: exit status 1
Process failed with exit code 1

Proposed Solution Change: error csolution: source modules added by multiple components: To: warning csolution: source modules defined by multiple components, duplicate ignored:

The component ARM::ML Eval Kit:Vision:Object detection@1.0.0 would then no longer add the source module.

Environment

brondani commented 1 month ago

This is intended behaviour: https://github.com/Open-CMSIS-Pack/devtools/issues/1572 For backward compatibility this error becomes a warning when running on cbuildgen mode.

KimmoVaisanen-AlifSemi commented 1 month ago

We are seeing this same problem with our DFP package, where we have some common source files. We are already fixing the issue but we already have quite many projects out that take the latest cmsis-toolbox and therefore causing some unnecessary headache.

Could it be possible to have this changed to a warning level by default for some period of time? Then we have some time to get fixed packages out?

jkrech commented 1 month ago

Please note that this is not only an arbitrary check for identifying duplicated source modules. The CMakeLists.txt generator cbuild2cmake, which has become the default generator in CMSIS-Toolbox 2.5.0 creates build structures based on components. Therefore there will be multiple objects with the same symbols contributed by separate components which the linker will fall over. For CMSIS-Toolbox 2.5.0 please use the --cbuildgen option to use the previous CMakeLists.txt generator.

KimmoVaisanen-AlifSemi commented 1 month ago

Is there a way to change the command of the VSCode CMSIS Solution extensions' Build (hammer) button?

jkrech commented 1 month ago

Unfortunately I did not find any settings in the CMSIS Solution extension to change this parameter. In this case I recommend reverting the CMSIS-Toolbox to version 2.4.0 where cbuildgen is the default using the vcpkg-configuration.json in a project folder.

  "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.4.0"
MatthiasHertel80 commented 1 month ago

Since the examples are now updated with a fixed pack version, the following needs to be changed in mlek.csolution.yml to replicate the issue: - pack: ARM::ml-embedded-eval-kit-uc-api@23.2.0 change to - pack: ARM::ml-embedded-eval-kit-uc-api@22.8.0-Beta

jkrech commented 4 days ago

We will limit our efforts of addressing the issue of duplicated source file from multiple components. This will be a "hack" rather than a proper solution as we will not attempt to make a "smart choice" from which component the file is taken