Skip to content

Add post install script support for tools #1631

Closed

Description

Describe the current behavior

Arduino IDE 1.x has a "post install script" feature that runs a specific script after Boards Manager installation.

This feature has been added to Arduino CLI for boards platforms (#893) and documented in the Arduino Platform Specification. However, it turns out that it was only partially implemented.

In addition to running the post install script from the platform at the time of installation, Arduino IDE 1.x does the same for tools.

The potentially useful support for post install scripts in tools has not been added to Arduino CLI.

To reproduce

Observe base line behavior of Arduino IDE 1.x

Use Arduino IDE 1.8.19 to install ATTinyCore:avr@1.5.2 according to these instructions:

https://github.com/SpenceKonde/ATTinyCore/blob/master/Installation.md#boards-manager-installation

🙂 Notice that the Arduino IDE console shows a warning about skipping the post install script for the ATTinyCore:micronucleus@2.5-azd1b tool installation:

Warning: non trusted contribution, skipping script execution (C:\Users\per\AppData\Local\Arduino15\packages\ATTinyCore\tools\micronucleus\2.5-azd1b\post_install.bat)

Skipping post install scripts for "untrusted contributions" is an obsolete behavior which was removed from Arduino CLI (#911). The important thing to note is that this shows the post install script support is intended to be available for tools as well as boards platforms.

Observe mismatched behavior of Arduino CLI

$ arduino-cli version
arduino-cli.exe  Version: nightly-20220121 Commit: 5beeba4 Date: 2022-01-21T01:26:28Z

$ arduino-cli core update-index --additional-urls http://drazzy.com/package_drazzy.com_index.json
Updating index: package_index.json downloaded / 439.91 KiB   29.10%
Updating index: package_index.json.sig downloaded
Updating index: package_drazzy.com_index.json downloaded/ 190.61 KiB   37.62%

$ arduino-cli core uninstall --additional-urls http://drazzy.com/package_drazzy.com_index.json ATTinyCore:avr
Uninstalling ATTinyCore:avr@1.5.2...
Platform ATTinyCore:avr@1.5.2 uninstalled
Uninstalling arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7, tool is no more required...
Tool arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7 uninstalled
Uninstalling arduino:avrdude@6.3.0-arduino18, tool is no more required...
Tool arduino:avrdude@6.3.0-arduino18 uninstalled
Uninstalling ATTinyCore:micronucleus@2.5-azd1b, tool is no more required...
Tool ATTinyCore:micronucleus@2.5-azd1b uninstalled

$ arduino-cli core install --verbose --additional-urls http://drazzy.com/package_drazzy.com_index.json ATTinyCore:avr | grep 'post_install'

😢 Notice that Arduino CLI did not execute C:\Users\per\AppData\Local\Arduino15\packages\ATTinyCore\tools\micronucleus\2.5-azd1b\post_install.bat during the installation.

Describe the request

Treat post install scripts in tool archives during Boards Manager installations in same way platform archives are currently handled.

Environment

  • CLI version: arduino-cli.exe Version: nightly-20220121 Commit: 5beeba4 Date: 2022-01-21T01:26:28Z
  • OS and platform: Windows 10

Additional context

The support for the post install script in ATTinyCore:micronucleus@2.5-azd1b is anticipated:

SpenceKonde/ATTinyCore#569

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

topic: codeRelated to content of the project itselftype: enhancementProposed improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions