feat(go/adbc): align default trace path with ADBC config layout#4527
Conversation
| - Windows: ``%APPDATA%\ADBC\Traces`` | ||
| - macOS: ``~/Library/Application Support/ADBC/Traces`` | ||
| - Linux: ``$XDG_CONFIG_HOME/adbc/traces`` or ``~/.config/adbc/traces`` |
There was a problem hiding this comment.
I'm not sure if these dirs are the right call here. Since traces are more like log files than config files, shouldn't traces go in the equivalent of $XDG_DATA_HOME? I'm still a +1 on this PR but I wonder if there's any benefit to storing traces in a non-roaming location.
There was a problem hiding this comment.
Hmm, that's a fair point.
Following https://pypi.org/project/appdirs/ maybe it should be:
~/Library/Logs/ADBC~/.cache/adbc/traces%LOCALAPPDATA%\ADBC\Traces
?
There was a problem hiding this comment.
Ah, platformdirs uses ~/.local/state for Linux.
There was a problem hiding this comment.
That corresponds to $XDG_STATE_HOME
There was a problem hiding this comment.
Hrm, yeah maybe XDG_DATA_HOME isn't right either. Maybe we can find some examples, I'll look.
There was a problem hiding this comment.
I wasn't able to find anything examples that help and this makes sense now that I think about it: Software that produces logs and traces is usually installed at the system level so XDG base dir stuff doesn't come up. i.e., traces would just go in /var/log/$app.
$XDG_STATE_HOME seems like a good fit:
The $XDG_STATE_HOME contains state data that should persist between (application) restarts, but that is not important or portable enough to the user that it should be stored in $XDG_DATA_HOME
So I'd go with:
- macOS:
~/Library/Application Support/ADBC/Traces - Linux:
$XDG_STATE_HOME/adbc/tracesor$HOME/.local/state/adbc/tracesif$XDG_STATE_HOMEis not set - Windows:
%LOCALAPPDATA%\ADBC\Traces
My reasoning for my choice for macOS above is two-fold: (1) platform dirs uses that dir for user_state_dir (2) it's just simpler to use a single dir for everything on a platform without a clearly-defined pattern for XDG base dirs.
Update the Go driverbase adbcfile trace writer to use the ADBC config-directory layout
Use temp directories for the existing rotating-file tests
Closes #4501