Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
76 stars 58 forks source link

User output for component selection is misleading #1187

Open ReinhardKeil opened 1 year ago

ReinhardKeil commented 1 year ago

Describe the problem The user output in case of missing components is confusing. The use case is: Create Network application with TCP service interface.

Current Output:

C:/Test/Network/Network/NetworkEx.cproject.yaml - warning csolution: dependency validation for context 'NetworkEx.Release+Device' failed:
SELECTABLE Keil::Network&MDK-Pro:Socket:TCP@7.18.0
  accept Network&MDK-Pro:CORE
  require CMSIS:CORE@5.0.1
  require Network:Interface

Expected (agreed) output:

C:/Test/Network/Network/NetworkEx.cproject.yaml - warning csolution: condition check fails for context: NetworkEx.Release+Device
component: Keil::Network&MDK-Pro:Socket:TCP            # additional components required
  failed: accept Network&MDK-Pro:CORE - possible selection:
    - component: Keil::Network&MDK-Pro:CORE&Release    # Network Core for Cortex-M (Release)
    - component: Keil::Network&MDK-Pro:CORE&Debug      # description
  failed: require CMSIS:CORE - possible selection:
    - component: ARM::CMSIS:CORE                       # description
  failed: require Network:Interface - possible selection:
    - component: Keil::Network&MDK-Pro:Interface:ETH   # description
    - component: Keil::Network&MDK-Pro:Interface:PPP   # description
    - component: Keil::Network&MDK-Pro:Interface:SLIP  # description

Expected output without # - pack: ARM::CMSIS@5.9.0:

C:/Test/Network/Network/NetworkEx.cproject.yaml - warning csolution: condition check fails for context: NetworkEx.Release+Device
component: Keil::Network&MDK-Pro:Socket:TCP            # additional components required
  failed: accept Network&MDK-Pro:CORE - possible selection:
    - component: Keil::Network&MDK-Pro:CORE&Release    # Network Core for Cortex-M (Release)
    - component: Keil::Network&MDK-Pro:CORE&Debug      # description
  failed: require CMSIS:CORE - no component found; add required pack
  failed: require Network:Interface - possible selection:
    - component: Keil::Network&MDK-Pro:Interface:ETH   # description
    - component: Keil::Network&MDK-Pro:Interface:PPP   # description
    - component: Keil::Network&MDK-Pro:Interface:SLIP  # description

Note: the components are displayed without version as this might be confusing. Component versions should be in general not part of project files (except in situations where a component must be absolute fixed) to simplify the upgrade process of packs. It is in most cases sufficient to just fix the pack version.

To Reproduce A project that exemplifies this is: Network.zip

Steps to reproduce the behavior:

csolution convert Network.csolution.yaml 

uncomment ARM:CMSIS@5.9.0 to see the alternative output.

Environment:

brondani commented 1 year ago

A discussion about the component dependencies output has been started as an enhancement in https://github.com/Open-CMSIS-Pack/devtools/issues/967 and it is still open, nothing has been agreed, so this should not be considered a bug.

A fundamental difference being introduced in the current issue is the expectation of presenting "possible selection" instead of the plain conditions. This requires further processing and implicitly assumes all "possible" packs are also loaded which goes against the current concept regarding pack loading in csolution.

Concerning the required dependency version it just reflects what is in the PDSC conditions and would be incomplete without it: From pack Keil::MDK-Middleware@7.16.0, Keil.MDK-Middleware.pdsc line 502-507:

    <condition id="CMSIS Core">
      <description>CMSIS Core for Cortex-M</description>
      <require Tcompiler="ARMCC"/>
      <require condition="Cortex-M Device"/>
      <require Cclass="CMSIS" Cgroup="CORE" Cversion="5.0.1"/>
    </condition>
ReinhardKeil commented 1 year ago

Related to #967

ReinhardKeil commented 8 months ago

Maybe a first improvement could be:

Instead of:

C:/Test/Network/Network/NetworkEx.cproject.yaml - warning csolution: dependency validation for context 'NetworkEx.Release+Device' failed:
SELECTABLE Keil::Network&MDK-Pro:Socket:TCP@7.18.0
  accept Network&MDK-Pro:CORE
  require CMSIS:CORE@5.0.1
  require Network:Interface

This text:

C:/Test/Network/Network/NetworkEx.cproject.yaml - warning csolution: component dependency validation for context 'NetworkEx.Release+Device' failed:
component: Keil::Network&MDK-Pro:Socket:TCP@7.18.0 - SELECTABLE
  accept Network&MDK-Pro:CORE
  require CMSIS:CORE@5.0.1
  require Network:Interface