Closed manotam closed 1 month ago
It seems you had XDG_DATA_DIRS
set prior to running command?
Homebrew's glib
automatically looks up correct directory, but only if XDG_DATA_DIRS
isn't set as that overrides the defaults:
https://gitlab.gnome.org/GNOME/glib/-/blob/2.80.4/glib/gutils.c#L2691-2698
gchar *data_dirs = (gchar *) g_getenv ("XDG_DATA_DIRS");
/* These checks are the same as the ones that g_win32_get_system_data_dirs_for_module()
* does. Please keep them in sync.
*/
#ifndef G_OS_WIN32
if (!data_dirs || !data_dirs[0])
data_dirs = "/usr/local/share/:/usr/share/";
If you set XDG_DATA_DIRS
, then you will need to make sure to add correct path to your system config as Homebrew cannot install into system's /usr/share
.
It seems you had
XDG_DATA_DIRS
set prior to running command?
FYI - on most distributions this variable will be set. This will conflict with brew installed applications as is the case here. There must be a more sensible solution than homebrew users having to manually set or unset XDG_DATA_DIRS.
FYI - on most distributions this variable will be set.
I can confirm this to be true even on GUI-less Ubuntu and Debian server installations with no X11 or Wayland apps installed. The "culprit" is snapd
, a cross-distro containerised packaging platform that installs /etc/profile.d/apps-bin-path.sh
, in which is the following:
# Ensure base distro defaults xdg path are set if nothing filed up some
# defaults yet.
if [ -z "$XDG_DATA_DIRS" ]; then
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi
that makes Homebrew's glib
adjustment null and void.
Since snapd
is widely installed by default, I think brew shellenv
needs to add Homebrew's share
dir to XDG_DATA_DIRS
if it exists, otherwise we'll likely be running into the same issue with other glib
-enabled formulae down the line.
I can confirm this to be true even on GUI-less Ubuntu and Debian server installations with no X11 or Wayland apps installed. The "culprit" is
snapd
, a cross-distro containerised packaging platform that installs/etc/profile.d/apps-bin-path.sh
, in which is the following:
FYI - Flatpak is equally a "culprit" in this case as it does something similar in /etc/profile.d/flatpak.sh
.
For example, on my Ubuntu system, my XDG_DATA_DIRS looks like this:
$ echo $XDG_DATA_DIRS
/usr/share/ubuntu-wayland:/usr/share/gnome:/home/lundmar/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
- My
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.
This is confusing to me given https://github.com/Homebrew/brew/blob/635a776fce1b63b1be554ca39b0cdc5911b4bd95/Library/Homebrew/extend/os/linux/diagnostic.rb#L62-L73
I'm not sure why this brew doctor
warning was not displayed for this user.
This is confusing to me given https://github.com/Homebrew/brew/blob/635a776fce1b63b1be554ca39b0cdc5911b4bd95/Library/Homebrew/extend/os/linux/diagnostic.rb#L62-L73
I'm not sure why this
brew doctor
warning was not displayed for this user.
Wouldn't the environment variable get filtered out by brew
?
@cho-m 🤦🏻 yes, of course. Might be worth passing this through as a HOMEBREW_XDG_DATA_DIRS
so we can check it here?
Also, check_xdg_data_dirs
is currently scoped to Linux, but glib
is used In various cross-platform formulae, and I was able to replicate the OP's issue on macOS, so I think it makes sense for the check to be cross-platform as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Installed lxi-tools and ran
lxi-gui
I reached out to the creators of the tool (here the issue and workaround) and suggested to list that issue here. However, I am not sure how to reach out to the creator of the brew instructions for this distro. In case this is misplaced please reach out to me how I can contact the creator. Thanks!
What happened (include all command output)?
output:
(lxi-gui:2864): GLib-GIO-ERROR **: 17:08:47.333: Settings schema 'io.github.lxi-tools.lxi-gui' is not installed Trace/breakpoint trap (core dumped)
What did you expect to happen?
gui launching
Step-by-step reproduction instructions (by running
brew
commands)