You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use XDG_CONFIG_HOME for .platformio directory #2872
You can override default location of .platformio folder using core_dir configuration option.
It is also possible to override the .platformio directory with the PLATFORMIO_CORE_DIR environment variable.
Configuration
Operating system: macOS 10.14
PlatformIO Version (platformio --version): 4.0.1b3
Description of problem
The ~/.platformio directory contains important config data including the user's custom boards. It's currently one of many hidden directories in my home folder. For most Unix-based systems these directories conventionally go in $XDG_CONFIG_HOME, which is usually ~/.local/share. This makes things neater for the user.
On Windows and macOS the variables XDG_CONFIG_HOME usually aren't defined, so you can use C:\Users\x\AppData\Roaming and ~/.local/share respectively (i.e., ~/.local/share does exist on macOS but isn't usually defined as XDG_CONFIG_HOME).
Steps to Reproduce
Run pio init
Observe new .platformio directory in $HOME
Reacted by Lyle Hanson, ObserverOfTime, StefanBruens, Klemens Schölhorn, Fabian, Nils K, Skruppy, Adam, Johannes Wüller and peelz
I think that allowing the user to override PIO's defaults is besides the point; that's a whole lot of directories which a user is forced to remap. The goal of the XDG Base Directory Specification is to free the user from the burden of having to manually manage each piece of software as a unique snowflake directory tree dumped somewhere random in their $HOME directory.
For example, what subdirectories of ~/.platformio are configuration which needs to be backed up and can be synced between development machines? What directories possibly contain credentials which should never be backed up? Which are runtime data which is necessary to have on hand? Which are cache directories and can safely be discarded if disk space is low? The XDG spec is a way to avoid the user having to figure out the answers to those questions for each piece of software we install. If PIO respected the preferences I've already expressed (and shouldn't have to say differently for every program I install), I'd know that ~/.config/platformio/* is configuration that I should back up, ~/.cache/platformio is safe to delete and can be recreated as needed, etc.
Please reconsider opening this issue. Complying with the XDG spec brings a lot of benefits and loses nothing. It's trivial to remain backwards compatible to support existing installations.
Reacted by Klemens Schölhorn, Fabian, Ari, G749, Nao Pross, Peter Hoeg, Nils K, Skruppy, Ellie Hermaszewska, Obed and 6 more
Activity
peterhoeg commentedon Aug 8, 2019
$XDG_CONFIG_HOMEis usually~/.configwhile$XDG_DATA_HOMEis~/.local/share.ivankravets commentedon Aug 17, 2019
Yes, we keep the same location through all systems. You can override it with http://docs.platformio.org/en/latest/envvars.html#envvar-PLATFORMIO_CORE_DIR
lhanson commentedon Oct 21, 2019
I think that allowing the user to override PIO's defaults is besides the point; that's a whole lot of directories which a user is forced to remap. The goal of the XDG Base Directory Specification is to free the user from the burden of having to manually manage each piece of software as a unique snowflake directory tree dumped somewhere random in their $HOME directory.
For example, what subdirectories of
~/.platformioare configuration which needs to be backed up and can be synced between development machines? What directories possibly contain credentials which should never be backed up? Which are runtime data which is necessary to have on hand? Which are cache directories and can safely be discarded if disk space is low? The XDG spec is a way to avoid the user having to figure out the answers to those questions for each piece of software we install. If PIO respected the preferences I've already expressed (and shouldn't have to say differently for every program I install), I'd know that~/.config/platformio/*is configuration that I should back up,~/.cache/platformiois safe to delete and can be recreated as needed, etc.Please reconsider opening this issue. Complying with the XDG spec brings a lot of benefits and loses nothing. It's trivial to remain backwards compatible to support existing installations.
felixsanz commentedon Jun 9, 2020
any update?
ivankravets commentedon Mar 31, 2022
See a temporary solution located in the top comment.
Perlovka commentedon Feb 1, 2025
+1