Skip to content

Output from post install script is not printed #1675

Closed
@per1234

Description

@per1234

Describe the bug

Arduino boards platform authors may add a "post-install script" to their platform. Arduino CLI and Arduino IDE run this script at the end of the platform installation process.

🐛 Output from the script is not printed. This output might provide instructions to the user or information useful for troubleshooting an error during the script execution.

To Reproduce

$ arduino-cli version
arduino-cli  Version: nightly-20220224 Commit: 2f2cbe2 Date: 2022-02-24T01:31:21Z

$ arduino-cli core uninstall arduino:mbed_nano
Uninstalling arduino:mbed_nano@2.7.2...
Platform arduino:mbed_nano@2.7.2 uninstalled

$ arduino-cli core install arduino:mbed_nano@2.7.2
Tool arduino:openocd@0.11.0-arduino2 already installed
Tool arduino:arm-none-eabi-gcc@7-2017q4 already installed
Tool arduino:bossac@1.9.1-arduino2 already installed
Tool arduino:dfu-util@0.10.0-arduino1 already installed
Tool arduino:rp2040tools@1.0.2 already installed
Downloading packages...
arduino:mbed_nano@2.7.2 already downloaded
Installing platform arduino:mbed_nano@2.7.2...
Configuring platform....
Platform arduino:mbed_nano@2.7.2 installed

The process was not run as root, so it was necessary for the script to exit without configuring the udev rules as intended:

https://github.com/arduino/ArduinoCore-mbed/blob/2.7.2/post_install.sh#L12-L15

if [ "$EUID" -ne 0 ]
  then echo "Please run as root"
  exit
fi

🐛 The Arduino CLI output does not include the script output:

Please run as root

Expected behavior

Arduino CLI prints any output from the post-install script, as is done by Arduino IDE 1.x.

Desktop

  • OS: Ubuntu 20.04
  • nightly-20220224 Commit: 2f2cbe2 Date: 2022-02-24T01:31:21Z

Additional context

I realize that it is very questionable whether the output from the particular script used by the demo is of any value. But that only indicates a defect in the implementation of this specific script, not that script output is fundamentally worthless.

Related

Metadata

Metadata

Assignees

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions