|
|
DescriptionRemove g_get_home_dir()
$HOME is always set, and the xdg spec only wants $HOME, so remove a glib
call.
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
R=thestig@chromium.org
Committed: https://crrev.com/b36c7065b2b4ae075db74e94bd2b80fa45e253a5
Cr-Commit-Position: refs/heads/master@{#348819}
Patch Set 1 #
Messages
Total messages: 16 (4 generated)
rvargas@chromium.org changed reviewers: + thestig@chromium.org - rvargas@chromium.org
rvargas@chromium.org changed reviewers: + rvargas@chromium.org
Lei, do you mind reviewing this?
rvargas@chromium.org changed reviewers: - rvargas@chromium.org
On 2015/09/14 22:24:54, rvargas (slow to respond) wrote: > Lei, do you mind reviewing this? Sure. I'm curious what's the motivation for this CL? Is it simply that if one interprets the XDG spec as saying $HOME is always set, so this is effectively dead code?
And for the record, g_get_home_dir() was added 6.6 years ago in r9162. Wee!
On 2015/09/14 22:43:22, Lei Zhang wrote: > Sure. I'm curious what's the motivation for this CL? Is it simply that if one > interprets the XDG spec as saying $HOME is always set, so this is effectively > dead code? Yup. > And for the record, g_get_home_dir() was added 6.6 years ago in r9162. Wee! Ah, technology. How things change in just a few years!
My reading of the XDG spec is that it falls back to $HOME/foo when $XDG_DATA_HOME and $XDG_CONFIG_HOME are not set. i.e. If $XDG_{CONFIG,DATA}_HOME is set, XDG does not actually care about $HOME. Also, if $HOME is empty, $HOME/foo just evals to /foo, which is still a valid, but likely not writable path. So $HOME "should" be set, but does not "must" be set. My take is that on one hand, it does seem silly to not have $HOME set, so that's a vote for this CL. OTOH, knowing Linux users, a few out there probably doesn't have it set, for whatever reason. If it's just 6 lines of code is the difference between making these silly users happy and breaking Chromium for them, maybe just leave this alone? I tried unsetting $HOME, and Chromium launches, prints a few errors, but seems to work for the most part.
There is also a stackexchange on this, although I didn't want to put that in a commit message: http://unix.stackexchange.com/questions/123858/is-the-home-environment-variab... Chrome does falls back to /tmp, which would probably be closer to what a user without $HOME wants. Mainly I want to remove as many glib calls as possible, and maybe kill the glib dependency someday (even if it is hidden behind a USE_GLIB macro, having multiple build configurations for one platform is just silly).
On 2015/09/15 00:21:25, knthzh wrote: > There is also a stackexchange on this, although I didn't want to put that in a > commit message: > http://unix.stackexchange.com/questions/123858/is-the-home-environment-variab... > > Chrome does falls back to /tmp, which would probably be closer to what a user > without $HOME wants. > > Mainly I want to remove as many glib calls as possible, and maybe kill the glib > dependency someday (even if it is hidden behind a USE_GLIB macro, having > multiple build configurations for one platform is just silly). I don't think stackexchange is the authoritative answer, but it does link to the Open Group Base Specifications, which I find more convincing. Specifically: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html HOME: The system shall initialize this variable at the time of login to be a pathname of the user's home directory. See <pwd.h>. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap01.html shall: For an implementation that conforms to POSIX.1-2008, describes a feature or behavior that is mandatory. An application can rely on the existence of the feature or behavior. Given the above, I'm going to say lgtm. When the users we break yell at us, we can tell them to follow the POSIX standard. :)
The CQ bit was checked by knthzh@gmail.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1339573003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1339573003/1
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/b36c7065b2b4ae075db74e94bd2b80fa45e253a5 Cr-Commit-Position: refs/heads/master@{#348819}
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/b36c7065b2b4ae075db74e94bd2b80fa45e253a5 Cr-Commit-Position: refs/heads/master@{#348819} |