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] cpackget fails to install pack: STMicroelectronics.stm32u5xx_hal_drivers.2.0.0-alpha.1.1 (regression in version 0.9.2 vs. 0.9.0) #158

Closed
jkrech opened this issue Feb 24, 2023 · 4 comments · Fixed by #165
Assignees
Labels
bug Something isn't working CMSIS-Toolbox 2

Comments

@jkrech
Copy link
Member

jkrech commented Feb 24, 2023

Raised here: Open-CMSIS-Pack/devtools#772
Describe the bug
installing a pack with the name STMicroelectronics.stm32u5xx_hal_drivers.2.0.0-alpha.1.1 fails with internal tool error:

panic: runtime error: index out of range [1] with length 1

To Reproduce
Steps to reproduce the behavior:
Hi

I got a regression using the new cpackget version.

$ cpackget.exe -V
cpackget version 0.9.0 (C) 2022 Linaro

$ cpackget.exe add STMicroelectronics.stm32u5xx_hal_drivers.2.0.0-alpha.1.1
I: Using pack root: "xxx\cmsis_pack_root"
I: Adding pack "STMicroelectronics.stm32u5xx_hal_drivers.2.0.0-alpha.1.1"
I: Extracting files to xxx\cmsis_pack_root\STMicroelectronics\stm32u5xx_hal_drivers\2.0.0-alpha.1.1...

I am now using the latest version:

$ cpackget.exe -V
cpackget version 0.9.2 (C) 2022-2023 Linaro

$ cpackget.exe add STMicroelectronics.stm32u5xx_hal_drivers.2.0.0-alpha.1.1
I: Using pack root: "xxx\cmsis_pack_root"
I: Adding pack "STMicroelectronics.stm32u5xx_hal_drivers.2.0.0-alpha.1.1"
I: Extracting files to xxx\cmsis_pack_root\STMicroelectronics\stm32u5xx_hal_drivers\2.0.0-alpha.1.1...
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/open-cmsis-pack/cpackget/cmd/installer.(*PacksInstallationType).PackIsInstalled(0xc00017b500, 0xc0001e0410)
        /home/runner/work/cpackget/cpackget/cmd/installer/root.go:959 +0x1159
github.com/open-cmsis-pack/cpackget/cmd/installer.(*PackType).loadDependencies(0xc0001e0750)
        /home/runner/work/cpackget/cpackget/cmd/installer/pack.go:573 +0x23d
github.com/open-cmsis-pack/cpackget/cmd/installer.AddPack({0xc000028480?, 0x38?}, 0x1, 0x0, 0x0, 0x0, 0x0?)
        /home/runner/work/cpackget/cpackget/cmd/installer/root.go:158 +0xadf
github.com/open-cmsis-pack/cpackget/cmd/commands.glob..func1(0x1a85a40?, {0xc000064e10?, 0x1?, 0x1?})
        /home/runner/work/cpackget/cpackget/cmd/commands/add.go:96 +0x571
github.com/spf13/cobra.(*Command).execute(0x1a85a40, {0xc000064de0, 0x1, 0x1})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000004300)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(0x1aa5a40?)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968 +0x19
main.main()
        /home/runner/work/cpackget/cpackget/cmd/main.go:24 +0xca

Expected behavior
just like cpackget 0.9.0 install the specified pack.

Environment (please complete the following information):

  • OS: any
  • Version: ?

Additional context
N/A

@jkrech jkrech added bug Something isn't working CMSIS-Toolbox 2 labels Feb 24, 2023
@jeromecoutant
Copy link

Tested with Windows

@lud0v1c
Copy link
Contributor

lud0v1c commented Feb 24, 2023

Can you please share the pack's PDSC file? It's an error reading the pack's requirements.

@jeromecoutant
Copy link

  <requirements>
    <packages>
      <package vendor="STMicroelectronics" name="stm32u5xx_dfp" version="2.0.0-alpha.1.9"/>
      <package vendor="ARM" name="CMSIS" version="5.9.0"/>
    </packages>
  </requirements>

@lud0v1c
Copy link
Contributor

lud0v1c commented Feb 28, 2023

It's related to the version being used and the fact that it has a more complex patch number (-alpha.1.9) and its internal representation. Probably best to skip dependency installation of packs such as this for now, with the -n flag, until patched.

@jkrech jkrech assigned thorstendb-ARM and unassigned lud0v1c Mar 7, 2023
thorstendb-ARM added a commit that referenced this issue Mar 21, 2023
…xx_hal_drivers.2.0.0-alpha.1.1 (regression in version 0.9.2 vs. 0.9.0) #158

fixed:
- checking dependencies version requirement through ':'

Function equalizes version requirement to be handled in a generic way in the further functions. While checking for 2x '.' (e.g. '1.2.0') for a version this did not take into account that there is also '1.2.0-alpha.1.0' which has more than two dots.
thorstendb-ARM added a commit that referenced this issue Mar 28, 2023
…xx_hal_drivers.2.0.0-alpha.1.1 (regression in version 0.9.2 vs. 0.9.0) #158 (#165)

fixed:
- checking dependencies version requirement through ':'

Function equalizes "version" requirement to be handled in a generic way in the further functions. While checking for 2x '.' (e.g. '1.2.0') for a version this did not take into account that there is also '1.2.0-alpha.1.0' which has more than two dots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CMSIS-Toolbox 2
Projects
No open projects
Status: Done
4 participants