Open-CMSIS-Pack / cpackget

Open-CMSIS-Pack Package Installer
Apache License 2.0
24 stars 15 forks source link

[cpackget] Unable to download a pack file that contains the build identifier #385

Open Torbjorn-Svensson opened 1 week ago

Torbjorn-Svensson commented 1 week ago

Describe the bug

Imagine a pack index file that contains a pack and the pack file contains the build identifier. Example:

<pdsc url="https://www.keil.com/pack/" vendor="ARM" name="CMSIS" version="6.1.0+foo" />

Then we try to install it using cpackget:

cpackget add --verbose ARM::CMSIS@6.1.0+foo

The command would generate output that ends with:

D: bad status: 404
E: "https://www.keil.com/pack/ARM.CMSIS.6.1.0.pack": bad request

But it should try to download https://www.keil.com/pack/ARM.CMSIS.6.1.0+foo.pack instead. In the .pdsc file embedded in the .pack file, the release node is:

  <releases>
    <release date="2024-02-30" version="6.1.0+foo">
      the change log entries...
   </release>
  </releases>

To Reproduce See above.

Expected behavior The pack file should be downloaded.

Environment (please complete the following information):

Additional context Obviously, we did not see the problem with the ARM.CMSIS.6.1.0 pack, but an internal pack. The steps above should highlight the question regardless of the pack name. The .pack files is named including the metadata/build identifier on the server.

jkrech commented 3 days ago

When installing a pack file from disk with meta information in the version: ARM.CMSIS.6.0.0-dev35+geb1d42a.pack the file will be stored in .Download without meta information ${CMSIS_PACK_ROOT}/.Download/ARM.CMSIS.6.0.0-dev35.pack the content of the pack version will be extracted into a version folder without meta information ${CMSIS_PACK_ROOT}/ARM/CMSIS/6.0.0-dev35/

The pdsc file contains the meta information in the <release> attribute <release version="6.0.0-dev35+geb1d42a"> however the tools reading pdsc files must ignore the meta information.

*.cbuild-pack.yml:

  resolved-packs:
    - resolved-pack: ARM::CMSIS@6.0.0-dev35
      selected-by-pack:
        - ARM::CMSIS@6.0.0-dev35+geb1d42a

The schema of PackIndex.xsd as well as the schema of PACK.xsd support version including meta information.

Therefore the current limitation needs to be corrected.