-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce dotfile bloat #10016
Comments
+1 My proposal at #4630 was maybe a bit too bold, but moving all julia files to a single dir will increase clarity for everybody. |
Yes, +1 to that. |
I started looking at this; I guess the main thing is how to unify a move to ~/.julia/juliarc.jl with base/pkg/dir.jl I'll continue looking at this in the future if no one else does. |
Awesome, thanks for working on this! I wonder, would it be useful to have some kind of migration facility for people upgrading from older releases? Something like A) If ~/.julia/juliarc.jl exists, use that. B) If C) For the 0.5 release, remove the code implementing (B). And equivalently for other moved dotfiles, except that maybe it isn't necessary to print a message that ~/.julia_history has been moved since it's not a file a user is expected to need to care about per se. A problem with this is if users don't migrate in one step, but rather go back and forth between 0.3 and 0.4 over a period of time before stopping using 0.3. Perhaps copy the files rather than moving, or maybe just print a warning message and let the users sort it out on their own? IIRC when matplotlib switched from ~/.matplotlibrc to ~/.matplotlib/matplotlibrc it resorted to just nagging rather than copying/moving anything. So perhaps an alternative (B) would be B.1) If ~/.julia/juliarc.jl does not exist, but ~/.juliarc.jl exists, use ~/.juliarc.jl and print a warning message to stderr that this is deprecated? |
I'd rather we not do B. A lot of us are going to have parallel installations of both 0.3 and 0.4 for a while. There was a similar change in the default location for packages between 0.2 and 0.3. We can do B.1 but I'm not sure the warning is really necessary. |
Startup warnings are really annoying! I don't think getting people to follow a new arbitrary file location is a god reason, and we're not in a hurry to convert everyone. How about just making new versions aware of both conventions, but create files in the new location, on first run on a clean machine? If we first make a move, we should probably consider optionally loading dot-files from the vX.X folders, so that |
Just an FYI, I'm not going to get to this anytime soon. I don't guess it's too tough, but would require more time than I have to spend on julia to boot up and learn the required tools. |
Julia could at least follow the approach of Git and use an XDG directory if it exists. Or it'd be nice to be able to customize the location with an environment variable. |
Bump. |
I should point out that if |
That said we could have |
Since you've very unfortunately chosen to not use XDG, could you please provide a mechanism to move If you'd like to review some case studies of tools which have adopted XDG, here's is a non-exhustive (but fairly decent) list: https://wiki.archlinux.org/index.php/XDG_Base_Directory_support (Please try reconsider as most of your points against it were inaccurate or semantically debatable.) |
Maybe |
or startup.jl, we describe it that way in the command line flag |
I like startup.jl yes. |
As I said when someone originally brought up XDG, it would be fine to have XDG as an opt-in thing, but XDG generally assumes Linux only. For Julia, having a consistent, predictable experience across Windows, macOS and Linux is more important than following XDG and having a totally different experience on Linux than everywhere else. If you have any suggestions about how opt-in XDG would work, we can certainly consider supporting it. |
|
Have a JULIA_CONFIG_DIR environment variable? |
So if |
I agree that XDG (XBDS) isn't entirely appropriate for languages and their ecosystems. XBDS itself was a "base" specification written in at least 2004 (version 0.5), meant to be used internally across the XDG (now FDO) projects. But XBDS itself has turned out to be somewhat of a nice idea for others as well and seen fairly wide adoption across many non-desktop projects, most of which have left legacy paths intact to not break those user's systems (e.g. git). To avoid embarking in a voyage on the semantic gulf, let's step back and consider the larger picture. Projects like systemd provide a tool called systemd-path(1), a small part of their ongoing file-hierarchy(7) effort. Running this command at the moment will print out the following (unfortunately hardcoded at the moment) locations (among many):
Ultimately the purpose, in my opinion, is to provide a controlled way to structure user home directories, much like Windows and MacOS already do. Where the data finally ends up going is largely an exercise in bikeshedding. If you decide to use I can't be of much help implementing this, but I hope you don't view the XBDS as for desktops only, or wholly inappropriate for your needs going forward. Thanks for reading. |
We could follow the breakdown of XDG into config, cache and data directories (I'm not sure we need runtime). These could be controlled by |
Everyone seems to be talking about Linux, but this is also an issue on Windows. The only thing more annoying than spamming the home directory on Linux is spamming the user-profile directory on Windows. Windows programs should write their files in AppData. |
This would be good to have for 1.0. |
The situation for Windows is especially bad. |
The main thing missing here is a plan. If someone who actually knows about XDG or Windows could provide a straightforward, concrete proposal, that would help. So far, the main actionable points seem to be:
I have no idea how XDG or Windows fit into this. How should this interact with XDG? Is there some environment variable Julia should pay attention to? What is "the situation" on Windows? |
See #4630 for a description of how Julia could follow XDG. Maybe Pkg3 changes the situation compared to when I filed the issue (one of my first issues!). |
Idea while we're moving dot files around: shard history file by month, i.e. write to
We can arrange for the history loading mechanism to load files on-demand if you go back in history far enough. This would make it easy to automatically delete or archive history files when they're old enough and it would automatically limit the size of history files to something reasonable. |
I’d argue that this is not useful at all. You then end up with by far the most programs following system standards – with Julia being one of the very few programs ignoring that. A much better approach would be to respect every system’s standard and then do a good abstraction from that. You should also have in mind that Julia will get increasing adoption, meaning that more and more users use Julia without being (core) developers – and thus don’t need these files and folders directly under I’m sure that most users don’t develop packages at all, and instead just use the REPL and execute the binary. So having a good package developing experience is more an exception-requirement. Developers however should easily be able to change these folders and files to reside in The “everything in |
Currently, to describe the location of
Multiply that by the number of different times we need to talk about the locations of files. |
Once we remove the deprecated |
That’s how it is – and certainly not your fault. But this would be a solid solution for all systems. And XDG should also be valid on FreeBSD, as far as I know. Maybe it would be helpful to provide some sort of
Good to hear, thanks! Although I still prefer the default to be the other way round… ;) |
Also, XDG seems to dictate that we have at least two separate locations for files:
I do not have a strong track record of respecting "how it is" when "how it is" is less than ideal 😈 |
There is also |
Yeah, I’d also like Windows (and maybe Mac) to disappear. 😜👌 I’d take I don’t think that you have to follow that XDG approach THAT strictly if it’s not that easy for you. I think having all Julia data at least in one or two well-known standard subfolders, would be enough for making everybody here happy. 😎 For me |
Care to take a crack at classifying all of the different things in
|
Note that one advantage of using standard system directories (XDG, Windows or Mac) is that they offer standard places where system administrators can put system-wide or site-wide default configuration files, package registries, etc. |
I assume everything to get into
It’s good practice to separate user’s working data (which is precious) from foreign data (which can easily be restored in most cases). It’s therefore not good, putting user’s development files into dot directories, as these for example easily get forgotten when making backups or the like (happened to me not just once). That dynamic runtime folder seems to just hold temporary data while an application runs. I assume that to be practically irrelevant for Julia.
Maybe @poettering can review this? |
That argument doesn't seem to apply to user files which is what we're talking about there... So we're looking at splitting our files up like this:
I have to say that I doubt that the typical Linux user would actually prefer this complex fractured layout to just having everything Julia-related under Once again, I have to express my opinion that this feels a lot like standards for their own sake. I do not see any practical advantage of this complex layout over having everything under |
Check. It’s just really nice, when you have your home not spammed with files you don’t need. And except for And as most users don’t develop packages, I vote for making |
The notion that only package developers need to be aware of what is in their |
The "dotfile bloat" part of this has been addressed, so I'm closing. If someone wants to implement the XDG stuff, they're welcome to make a PR. |
Those of us with old home directories have to live with a huge amount of various dotfiles/dotdirs under the home directory root, and every new piece of software adding its own config files or whatever directly under the home directory only makes it worse.
One solution would be to follow the XDG basedir spec (store stuff under ~/.config and ~/.local/XXX), but that was already shot down for Julia, see #4630 .
So, as it seems we're going to have to live with a ~/.julia directory, would it be possible to at least move the other dotfiles under that directory? That is, at least something like
~/.juliarc.jl => ~/.julia/juliarc.jl
~/.julia_history => ~/.julia/julia_history
and maybe some other file I have missed?
The text was updated successfully, but these errors were encountered: