Skip to content

Want mechanism for package maintainers to disable automatic update checks at build time #2957

@faithanalog

Description

@faithanalog

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:

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

699ddc0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftopic: infrastructureRelated to project infrastructuretopic: packagingRelated to the release distribution packagetype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions