-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Follow more XDG conventions #4542
Conversation
… var is set). This addresses the comment at oven-sh#1678 (comment) > … I have yet to see see any other program use a `.` prefix for folders > *inside* the XDG convention folders. This may cause the folder to be > unexpectedly hidden when viewing it in a file explorer app or running > `ls` without `-a`. (That is, someone may expect `~/.cache` to be > hidden — but that all folders are visible once they are viewing that > hidden folder.) The only previous workaround would have been to set `$BUN_INSTALL`, but that affects more than the cache directory. (And people who have been using `$XDG_CACHE_HOME` presumably want to opt into the convention that all cache directories are grouped into a single place that is easy to audit and clean, separate from all config data.) Since this: - only affects the subset of users who have explictly opted into `$XDG_CACHE_HOME`, and - only affects cache data, which is meant to be safe to abandon/lose at any moment, … it shouldn't be harmful to leave the old directory lying around and allow a new one to be created. But it would also be possible to move the existing directory with an additional change.
I think this would be a nice step, but nit on the title: this PR currently only covers the cache dir. There are also various other config and data paths in Bun that don't follow the XDG conventions. In addition, some people believe would probably prefer for programs not to strictly adhere to the Linux-centered XDG conventions, but instead to use platform-specific defaults (e.g. |
Ah I didn't know there's more places. I've used that crate in some projects and it's def fantastic. I've referred to it when doing stuff outside Rust too In that case... I guess I'd expect this to be switching on the OS in the Zig layer before getting to XDG_ and HOME handling. I don't know how many other layers (c++? js?) also need updates. I'm about to sign off for the night, but feel free to run with this or even cancel my PR. Some of my assumptions were off |
@lgarron I updated the PR title; aside from that, do you think this looks like a good incremental step forward? |
I would really like to see XDG specs implementation first. I hope it won't spread over months in order to include support for all platforms... Also I think most of MacOS and Windows users don't really care about where their apps store data, comparing to Linux and BSD. It should be implemented, but Linux specs go first imo. @lgarron are changes only include install script? if yes, it's probably very easy to finish in order to get merged. I can't imagine new fresh tool like bun can end up getting to this table: https://wiki.archlinux.org/title/XDG_Base_Directory |
I added bun to the "Support > Partial" table, along with a workaround shell export that I think is sufficient to work around until the related XDG issue is resolved. It's a wiki, anyone can edit it. :) Feel free to update it later, I'm not an Arch user so I may forget about it |
I can't practically # for the wiki, as I don't seem to have access to a system that allows me to answer the anti-spam filter. However, I would suggest something like this:
|
Thank you :)
Me neither but I have followed the issue and I would be very happy to remove this variable from my environment. I've left a comment above variable so that's not a problem 👍
Yes, thank you. I already read install script and shared this finding in issue thread: #1678 (comment) @booniepepper I also left some maybe useful info for you about XDG specs implementation: #1678 (comment)
If you need it, you can just use minimal alpine docker image. This is the way you register on gentoo wiki also for example. And current captcha for arch wiki is
|
Thanks, that worked! 😀
I was trying to make the point that setting So right now it's not simple as "set I think we're probably all agreed in this thread that the least confusing if all of |
We aren't going to do this breaking change right now, but might revisit in the future |
What does this PR do?
I'm new to the codebase but I got hyped about the 1.0 release at the last hour
(If I'm following right) This should be the last little bit needed to close #1678 and prevent future breakage based on install locations
It also builds off of #4438 from @lgarron
How did you verify your code works?
make zig
and it workedzig fmt
on the changed files