-
-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Describe the request
arduino-cli checks once every 24 hours for updates, and notifies the user. In cases where the user has installed arduino-cli from their system package manager, this is not terribly useful. They may take it as a prompt to update their system, but a user who is trying to stay updated with the very latest version of arduino-cli
should be installing it themselves without their package manager. Conversely, a user who has it installed through their package manager is probably fine lagging behind on updates a bit.
I personally find it to be primarily an annoyance in this situation, so I went looking for ways to disable this message as a packager.
The logic for deciding when to check for automatic updates is controlled by the shouldCheckForUpdate
function in service_check_for_updates.go
Currently, there are four ways to disable automatic update checks:
- Set a flag in the user's configuration file
- Set an environment variable
- Add
git-snapshot
ornightly
somewhere in the version string at link time - Patch the function
The first two seem out of turn for a package to do.
Setting git-snapshot
or nightly
seems awkward as it it supposed to indicate a dev build, and if other code starts to make logic decisions by that, it could break things. It would also be misleading in any logs and confusing in bug reports.
Patching the function isn't great either because then we're not shipping upstream code anymore, and it's annoying when bumping versions.
If this is a use case arduino-cli would like to support, it would be nice to have a dedicated mechanism for this. Perhaps a new link-time variable could be added to github.com/arduino/arduino-cli/internal/version
that can indicate arduino-cli has been built for distribution in a package repository, which disables the automatic update checking?
This could then also be printed as part of the version string, so the version
command clearly indicates a user is not using a first party build.
Arduino CLI version
Operating system
Linux
Issue checklist
- I searched for previous requests in the issue tracker
- I verified the feature was still missing when using the nightly build
- My request contains all necessary details