ponylang / ponyup

The Pony toolchain multiplexer
BSD 2-Clause "Simplified" License
196 stars 13 forks source link

Ensure that storage paths conform to relevant platform standards. #50

Closed jemc closed 4 years ago

jemc commented 5 years ago

This ticket was created out of the following Zulip conversation: https://ponylang.zulipchat.com/#narrow/stream/190367-tooling/topic/Pony.20storage.20locations/near/181969568

Relevant excerpt from my comments there:


Regarding the $HOME/.pony/ponyup that [it was mentioned that] ponyup is currently using, I'll just mention that it's often considered impolite to litter the home folder with many app-specific subdirs (though many apps do this). It's preferred (explicitly by XDG), to keep them within $HOME/.config or similar instead of sprawling out across the top of the $HOME directory everywhere.

From the XDG spec (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html):

$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

I see that Matthias Wahl 's package respects that spec, so that's a great option [if ponyup could take it on as a dependency]

SeanTAllen commented 5 years ago

We should do this before we announce ponyup as it would be a breaking change and we'd minimize the impact.

SeanTAllen commented 5 years ago

@Theodus any comments or objections?

Theodus commented 5 years ago

I have no objections to this.

cquinn commented 5 years ago

I like the https://github.com/mfelsche/pony-appdirs package, but think it would be a useful option to allow non-GUI apps on macOS to request Unix-style paths instead of macOS desktop paths. Most command-line users on Mac treat it like the Unix that it is, and would not be happy with tool config files down under ~/Library/Application\ Support/

Maybe add another option to AppDirs constructor to indicate the program would prefer unix_style paths.

mfelsche commented 5 years ago

Totally doable. Either I do this part in the appdirs repo itself or when included into ponyup. Ehatever works best for you, just hit me up, how you want it. I can do it the way you prefer.

cquinn commented 5 years ago

In the Pony Dev Sync, we also talked about the option of moving pony-appdirs under the ponylang org. What are your thoughts on that? If we did that move (and maybe even if we didn't), we could include pony-appdirs as a submodule in Ponyup, as well as in Corral so that these projects could bootstrap without build-time dependency resolution.

mfelsche commented 5 years ago

This is already done: https://github.com/ponylang/pony-appdirs

One thing though is that in its current form pony-appdirs depends on stable to pull in a dependency, but this can be easily circumvented by copying the dependency into the appdirs source tree if need be.

cquinn commented 5 years ago

Oh, we didn't know about that move during the sync. I wonder what @SeanTAllen thinks about a ponylang repo having dependencies on an outside one. Should we also move that package over to ponylang, or just copy the one file over?

Copying seems easier for now, but maybe we should put together a ponylang package of useful helper code like pony-maybe.

cquinn commented 5 years ago

I'll copy my suggestion comment over to https://github.com/ponylang/pony-appdirs

mfelsche commented 4 years ago

@cquinn I think we are good from the pony-appdirs side.