Skip to content

Conversation

@martacarbone
Copy link
Contributor

@martacarbone martacarbone commented Dec 5, 2025

Motivation

Currently the examples (and other static data) are stored inside the arduino home folder.
Current location: ~/.local/share/arduino-app-cli

This is needed because at some point the arduino-flasher-cli will support keeping user data, by preserving the user partition (where the arduino home folder is mounted). And we cannot keep some static data in the preserved paths, otherwise that data would not match the software version that gets installed in the root partition (which is not preserved).

Change description

/home/arduino/.local/share/arduino-app-cli/assets -> 
/home/arduino/.local/share/arduino-app-cli/examples -> /var/lib/arduino-app-cli/examples
/home/arduino/.local/share/arduino-app-cli/bootloader_burned.flag -> /var/lib/arduino-app-cli/bootloader_burned.flag
/home/arduino/.local/share/arduino-app-cli/properties.msgpack -> /var/lib/arduino-app-cli/properties.msgpack

Additional Notes

dpkg --install handle obsolete .local file deletion for upgrade from a version lower than the current on (0.7.0)
dpkg --remove delete the system files but the configuration files
dpkg --purge remove all packages related files from the system

Test

Test #1

The package status is purged (no file or configurations present on the system)
dpkg --install arduino-app-cli-0.8.0-1_arm64.deb
This is a fresh installation, no old files will be deleted because it is supposed they do no exists.
After the istallation examples are in /var/lib/arduino-app-cli and the application
configuration dir is created in /home/arduino/.config/arduino-app-cli

Test #2

The 0.8.0 package is installed over a previous 0.7.0 installation.
This is an upgrade, old files /home/arduino/.local will be deleted.
dpkg --install arduino-app-cli-0.8.0-1_arm64.deb
After the installation we should have the same results of Test#1

Test #3

dpkg --remove arduino-app-cli
All removed but the configuration file in /home/arduino/.config/arduino-app-cli

Test #4

dpkg --purge arduino-app-cli
All removed, no more trace of the package files in the system.

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@lucarin91
Copy link
Contributor

I would also move the properties.msgpack and the lock file in /var/lib/arduino-app-cli.

Copy link
Contributor

@lucarin91 lucarin91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would split this PR into two:

  1. move .cache and data folders somewhere else
  2. move .local/share/ stuff somewhere else

@martacarbone martacarbone force-pushed the issue_118_move_examples branch from 58de2bb to 2c18d71 Compare December 8, 2025 23:08
@Xayton Xayton linked an issue Dec 9, 2025 that may be closed by this pull request
@lucarin91
Copy link
Contributor

I would split this PR into two:

  1. move .cache and data folders somewhere else
  2. move .local/share/ stuff somewhere else

After some internal discussion, we decided to avoid 1. for now and only move .local/share into /var/.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move examples (and other data) out of the Arduino home folder

2 participants