Open retnikt opened 4 years ago
I'm not aware of how widely used this XDG directory spec is. Following common pattens would be useful, if these are common patterns; I have not previously heard of this convention.
cc @kevmoo @bwilkerson @jonahwilliams for thoughts
I hadn't heard of it either, but then it's well outside my wheelhouse. Personally I have no preference about where we store cached files.
https://maex.me/2019/12/the-power-of-the-xdg-base-directory-specification/
TIL
On Sun, Apr 19, 2020, 08:35 Brian Wilkerson notifications@github.com wrote:
I hadn't heard of it either, but then it's well outside my wheelhouse. Personally I have no preference about where we store cached files.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/sdk/issues/41560#issuecomment-616164114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEFCWHMJQA6BDHS7NACWLRNMK3NANCNFSM4MLHM7DA .
@devoncarew @bwilkerson – I'm a fan of following conventions and not dirtying up directories.
If at some point, if we want to entertain moving things around I'm not against this. 🤷
I'm not against it either. The first question is how to prioritize this against the other work that needs to be done.
Here is a partial list of applications that have adopted it: https://wiki.archlinux.org/index.php/XDG_Base_Directory#Supported
They include:
To name some of the more notable ones
Any update on the priority of this issue?
The .dart
folder is hard-coded in https://github.com/dart-lang/sdk/blob/master/pkg/dartdev/lib/src/analytics.dart and .dartServer
in https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/file_system/physical_file_system.dart and https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/benchmark/benchmarks.dart
These foldernames don't appear seem to appear elsewhere in the codebase so making a PR should be doable :)
I think approaching this with following kind of implementation would be good:
Moving the conf file to the new location automatically is pretty nice too but will annoy some people using dotfile managers when their dotfiles have changed on their own.
For caching files, it's already possible to set pub
to use other cache dir than ~/.pub-cache
with PUB_CACHE
environment variable. Logic here: https://github.com/dart-lang/sdk/blob/master/pkg/nnbd_migration/tool/src/package.dart#L32
I think this should use $XDG_CACHE_HOME/pub
as default, $HOME/.cache/pub
as 1st fallback (XDG default) and the $HOME/.pub-cache
as 2nd fallback.
The XDG spec is being adopted in Flutter here: https://github.com/flutter/flutter/issues/59430 It'd be nice to have it in dart too :)
Any update on this one? Is it being considered?
any updates? The XDG convention makes it easier to organize files and not clutter the home directory. I know it may not be the top priority, but it would certainly help if you guys would implement it.
In dart pub
we're moving all configuration files to:
$XDG_CONFIG_HOME/dart/
$HOME/.config/dart/
~/Library/Application Support/dart/
%APPDATA%/dart/
Migration: If a config file exists in the new location we use it, otherwise we read config file from old location.
@jonasfj did you mean to close the whole issue? I'd assume that analyzer also needs to change?
Nope, that was unintentional... I think GitHub just decided to close it :)
Hello, is there any progress? .dart
is still in my $HOME. I have defined $XDG_CONFIG_HOME
before. And it's a fresh install for dart. When i execute dart pub
, .dart
appears in my home.
❯ pwd
/home/einsam/.dart
❯ tree .
.
├── dartdev.json
└── README.txt
0 directories, 2 files
❯ echo $XDG_CONFIG_HOME
/home/einsam/.config
Currently, on Linux, Dart stores some data in
~/.dart
and~/.dartServer
, which is annoying because it clutters up the user's home directory. Please consider following the XDG Base Directory spec by moving these files to appropriate locations specified in the environment variables$XDG_CONFIG_HOME
,$XDG_DATA_HOME
, and$XDG_CACHE_HOME
. (typically, and by default,~/.config
,~/.local/share
, and~/.cache
).dart --version
) = 2.7.2