ros-tooling/setup-ros

Windows is broken due to cppcheck 2.8 installation by chocolatey

Closed this issue · 2 comments

Description

setup-ros uses chocolatey to install some dependencies, including cppcheck.

Expected Behavior

cppcheck is installed correctly, the action keeps going.

Actual Behavior

Job fails at the chocolatey install step: https://github.com/ros-tooling/action-ros-ci/runs/6579049120?check_suite_focus=true#step:5:29

To Reproduce

Run action on Windows.

System (please complete the following information)

  • OS: Windows
  • ROS 2 Distro: any

Additional context

This worked fine yesterday for ros-tooling/action-ros-ci#749, but it was installing cppcheck 2.7

  cppcheck v2.7 [Approved]
  cppcheck package files install completed. Performing other installation steps.
  Downloading cppcheck 64 bit
    from 'https://github.com/danmar/cppcheck/releases/download/2.7/cppcheck-2.7-x64-Setup.msi'
  
  Download of cppcheck-2.7-x64-Setup.msi (21.55 MB) completed.
  Hashes match.
  Installing cppcheck...
  cppcheck has been installed.
  PATH environment variable does not have C:\Program Files\Cppcheck in it. Adding...
    cppcheck may be able to be automatically uninstalled.
  Environment Vars (like PATH) have changed. Close/reopen your shell to
   see the changes (or in powershell/cmd.exe just type `refreshenv`).
   The install of cppcheck was successful.
    Software installed as 'MSI', install location is likely default.

https://github.com/ros-tooling/action-ros-ci/runs/6562956458?check_suite_focus=true#step:5:29

It's now trying to install cppcheck 2.8 and failing:

  cppcheck v2.8 [Approved]
  cppcheck package files install completed. Performing other installation steps.
  Downloading cppcheck 64 bit
    from 'https://github.com/danmar/cppcheck/releases/download/2.8/cppcheck-2.8-x64-Setup.msi'
  
  Download of cppcheck-2.8-x64-Setup.msi (16.49 MB) completed.
  Hashes match.
  Installing cppcheck...
  ERROR: Running ["C:\Windows\System32\msiexec.exe" /i "C:\Users\runneradmin\AppData\Local\Temp\chocolatey\cppcheck\2.8\cppcheck-2.8-x64-Setup.msi" /quiet ADDLOCAL=CppcheckCore,CLI,GUI,Translations,ConfigFiles,PlatformFiles,PythonAddons,CRT /norestart ] was not successful. Exit code was '3010'. See log for possible error messages.
    cppcheck may be able to be automatically uninstalled.
   The install of cppcheck was successful.
    Software installed as 'MSI', install location is likely default.

https://github.com/ros-tooling/action-ros-ci/runs/6579049120?check_suite_focus=true#step:5:29

Exit code 3010 seems to mean that the system should be rebooted:

  Packages requiring reboot:
   - cppcheck (exit code 3010)
  
  The recent package changes indicate a reboot is necessary.
   Please reboot at your earliest convenience.

https://github.com/ros-tooling/action-ros-ci/runs/6579049120?check_suite_focus=true#step:5:94

Not sure why it's now happening with version 2.8, but we could probably pin cppcheck to 2.7.

ci.ros2.org seems to install cppcheck version 1.90: https://github.com/ros-infrastructure/ros2-cookbooks/blob/de9d4cc159f2c4402e4636c458ad4bc535d0610d/cookbooks/ros2_windows/recipes/chocolatey_installs.rb#L11

This is also the version I have on my Ubuntu 20.04 system, so we could pin to that.