Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cpackget] Explicit installation may fail #357

Closed
ReinhardKeil opened this issue Oct 14, 2024 · 2 comments
Closed

[cpackget] Explicit installation may fail #357

ReinhardKeil opened this issue Oct 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@ReinhardKeil
Copy link

ReinhardKeil commented Oct 14, 2024

Describe the bug

When installing a newly published pack, an error like this may appear.

cpackget add Keil::[email protected]
I: Adding pack "Keil::[email protected]"
E: pack version not found in the pdsc file

It works fine after the execution of cpackget update-index as covered in the documentation. However the UX experience could be better.

To Reproduce

Remove in the CMSIS_PACK_ROOT folder:

  • The folder Keil\B-U585I-IOT02A_BSP
  • The file .\Web\B-U585I-IOT02A_BSP.pdsc
  • From file .\Web\index.pidx the <pdsc url reference to B-U585I-IOT02A_BSP.

Execute: cpackget add Keil::[email protected]

As a user you get this line from the web portal, and you perhaps don't know that cpackget update-index should be executed first.

Expected Behavior

Execute: cpackget add Keil::[email protected] should install a published pack without errors.

This may require some changes.

  • Auto-update public index file when used but only once per day and when connection available #355 suggest to execute update-index --sparse once a day. This should be also executed when an explicit pack version is given and this pack version is not found in index.pidx as --sparse effectively only updates this file.
  • When the *.PDSC file of a pack is missing, but the index.pidx indicates the availablity, only this *.PDSC should be downloaded.
  • Then the normal pack installation should work.

Envrionment:

  • OS: Windows
  • cpackget 2.1.4
@jkrech
Copy link
Member

jkrech commented Oct 29, 2024

When installing a public pack, the index.pidx needs to be opened.
a) if index.pidx does not exist, invoke the behavior of cpackget init https://www.keil.com/pack/index.pidx -> bail out on error
b) if index.pidx exists - open index.pidx and read <timestamp>
c) if <timestamp> date is smaller than host date invoke behavior of capckget update-index --sparse -> bail out on error
d) now continue with the behavior of cpackget add packID, locating pack in index.pidx, downloading pdsc file if version in index is higher than version in pdsc file.
e) reading pdsc file <releases> section to find latest or specified version. If no version match found bail out.
f) read url attribute from release tag or construct download url from elements <url> <vendor> <name> version . pack

@jkrech jkrech moved this from Backlog to In progress in CMSIS-Toolbox 2.7.0 Nov 5, 2024
@jkrech jkrech added the enhancement New feature or request label Nov 5, 2024
@jkrech
Copy link
Member

jkrech commented Dec 10, 2024

Validating nightly build of CMSIS-Toolbox from 2024-12-09:
With an outdated in .Web/index.pidx the cpackget add command download the index.pidx.

cpackget add YTMicro::[email protected]
I: Respond: 200:200 OK (online)
I: Downloading index.pidx...
I: 100% |██████████████████████████████████████████████████████████████████████████████| (210/210 kB, 298 kB/s)
I: Downloading YTMicro.YTM32B1LD0_DFP.pdsc...
I: 100% |██████████████████████████████████████████████████████████████████████████████| (3.4/3.4 kB, 5.3 MB/s)
I: Adding pack "YTMicro::[email protected]"
I: Downloading YTMicro.YTM32B1LD0_DFP.1.1.1.pack...
I: 100% |██████████████████████████████████████████████████████████████████████████████| (209/209 kB, 240 kB/s)
I: Extracting files to c:\tmp\cmsis-packs\YTMicro\YTM32B1LD0_DFP\1.1.1...
I: 100% |███████████████████████████████████████████████████████████████████████████████████| (15/15, 407 it/s)

Also in case the CMSIS_PACK_ROOT folder is empty, the cpackget add will bootstrap the initialization of the required folders.

@jkrech jkrech closed this as completed Dec 10, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in CMSIS-Toolbox 2.7.0 Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

3 participants