Open-CMSIS-Pack / cpackget

Open-CMSIS-Pack Package Installer
Apache License 2.0
23 stars 14 forks source link

[cpackget] fails to install the packs specified in the `requirements` section (regression from 2.0.1) #283

Closed jkrech closed 6 months ago

jkrech commented 6 months ago

Describe the bug When installing the pack version NXP::EVK-MIMXRT1064_BSP@14.0.0 using this command:

cpackget add NXP::EVK-MIMXRT1064_BSP@14.0.0 -v

the expectation is that due to these <requirements>

<requirements>
    <packages>
      <package name="MIMXRT1064_DFP" vendor="NXP" version="14.0.0"/>
      <package name="CMSIS" vendor="ARM" version="5.6.0"/>
    </packages>
</requirements>

that if no pack version of NXP::MIMXRT1064_DFP >= 14.0.0 is already installed, the latest version listed in the .Web/index.pidx gets downloaded and installed. (similarly for "ARM::CMSIS >= 5.6.0")

Note: cpackget version 2.0.1 correctly installs NXP::MIMXRT1064_DFP@18.0.0 being the latest public version in my ./Web/index.pidx.

To Reproduce Steps to reproduce the behavior:

  1. Ensure that you do not have any of the packs NXP::EVK-MIMXRT1064_BSP@14.0.0 and NXP::MIMXRT1064_DFP installed
  2. cpackget add NXP::EVK-MIMXRT1064_BSP@14.0.0 -v
  3. See error:
    D: Downloading https://mcuxpresso.nxp.com/cmsis_pack/repo/NXP.MIMXRT1064_DFP.18.0.0.pack to C:\Users\user\AppData\Local\Arm\Packs\.Download\NXP.MIMXRT1064_DFP.18.0.0.pack
    D: Download not required, using the one from cache
    I: Adding pack NXP.MIMXRT1064_DFP.
    D: Installing "C:\Users\user\AppData\Local\Arm\Packs\.Download\NXP.MIMXRT1064_DFP.18.0.0.pack"
    D: Validating pack
    D: Inflating "NXP.MIMXRT1064_DFP.pdsc"
    D: Ensuring "C:\Users\user\AppData\Local\Temp\vCGxspJRfM\" directory exists
    D: Inflated 193693 bytes
    D: Initializing PdscXML object for "C:\Users\user\AppData\Local\Temp\vCGxspJRfM\NXP.MIMXRT1064_DFP.pdsc"
    D: Reading pdsc from file "C:\Users\user\AppData\Local\Temp\vCGxspJRfM\NXP.MIMXRT1064_DFP.pdsc"
    D: Making sure  is the latest release in NXP.MIMXRT1064_DFP.pdsc
    E: The latest release (18.0.0) in pack's pdsc (NXP.MIMXRT1064_DFP.pdsc) does not match pack version ""
    E: pack version is not the latest in the pdsc file

Expected behavior The expectation is that NXP::MIMXRT1064_DFP@18.0.0 gets successfully installed.

Environment (please complete the following information):

jkrech commented 6 months ago

Looks like a duplicate of: https://github.com/Open-CMSIS-Pack/cpackget/issues/282

edriouk commented 6 months ago

Two problems have identified and fixed:

  1. cpackget internally uses "_" as unlimited upper range, e.g. "1.2.3:_" utils.SemverCompareRange() is updated to support it.
  2. pack.resolveVersionModifier(): swapped version and range arguments to call utils.SemverCompareRange() corrected