Skip to content
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

chrome-gnome-shell: Fix missing introspection data #87744

Merged
merged 2 commits into from May 15, 2020
Merged

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented May 13, 2020

Motivation for this change

It was crashing with:

TypeError: gobject `__main__+ChromeGNOMEShell' doesn't support property `application_id'

– that is the constructor of parent class Gio.Application does not recognize the kwarg.

This is typically caused by missing pygobject overrides but I think ones for Gio are built-in into pygobject.

Even weirder, adding just ${gobject-introspection}/lib/girepository-1.0 seems to fix the issue so it might be missing the whole typelib.
But then why does not it fail when importing it?

from gi.repository import GLib, Gio

For now, I am adding the Gio typelib which should been done from the start but more debugging should be done since weirdness like this can bring more bugs.

Fixes: #87740

cc @worldofpeace @glasserc

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

* format with nixpkgs-fmt
* reorder attributes
* inline version
It was crashing with:

    TypeError: gobject `__main__+ChromeGNOMEShell' doesn't support property `application_id'

– that is the constructor of parent class Gio.Application does not recognize the kwarg.

This is typically caused by missing pygobject overrides but I think ones for Gio are built-in into pygobject.

Even weirder, adding just `${gobject-introspection}/lib/girepository-1.0` seems to fix the issue so it might be missing the whole typelib.
But then why does not it fail when importing it?

	from gi.repository import GLib, Gio

For now, I am adding the Gio typelib which should been done from the start but more debugging should be done since weirdness like this can bring more bugs.

Fixes: NixOS#87740
@ofborg ofborg bot added the 6.topic: GNOME GNOME desktop environment and its underlying platform label May 13, 2020
@ofborg ofborg bot requested review from worldofpeace and hedning May 13, 2020 15:11
@jtojnar jtojnar merged commit 32b8ed7 into NixOS:master May 15, 2020
@jtojnar jtojnar deleted the ch-g-s branch May 15, 2020 21:58
@wmertens
Copy link
Contributor

wmertens commented Dec 6, 2021

I'm seeing this issue still - chrome-gnome-shell is still v10.1 and I'm seeing this error in the Chrome terminal output:

Mon Dec 06 19:57:51 😢  ERR 127 wmertens-nixos ~/Projects/Cap on master*
3078 $ /nix/store/05sszdlgbmx7xc0j5wl8b7ycp1496ipc-python3.9-pygobject-3.42.0/lib/python3.9/site-packages/gi/types.py:217: Warning: g_param_spec_pool_lookup: assertion 'pool != NULL' failed
  _gi.type_register(cls, namespace.get('__gtype_name__'))
/nix/store/05sszdlgbmx7xc0j5wl8b7ycp1496ipc-python3.9-pygobject-3.42.0/lib/python3.9/site-packages/gi/types.py:217: Warning: g_param_spec_pool_insert: assertion 'pool != NULL' failed
  _gi.type_register(cls, namespace.get('__gtype_name__'))
Traceback (most recent call last):
  File "/nix/store/i8qn9l78z22p55c753mfwsli7yl8l47j-chrome-gnome-shell-10.1/bin/.chrome-gnome-shell-wrapped", line 585, in <module>
    app = ChromeGNOMEShell(run_as_service)
  File "/nix/store/i8qn9l78z22p55c753mfwsli7yl8l47j-chrome-gnome-shell-10.1/bin/.chrome-gnome-shell-wrapped", line 59, in __init__
    Gio.Application.__init__(
TypeError: gobject `__main__+ChromeGNOMEShell' doesn't support property `application_id'

@jtojnar
Copy link
Contributor Author

jtojnar commented Dec 6, 2021

@wmertens I cannot reproduce, works for me in both Firefox and Chromium. Could you please make sure you do not have ~/.config/google-chrome/NativeMessagingHosts/org.gnome.chrome_gnome_shell.json pointing to the old version?

@wmertens
Copy link
Contributor

@jtojnar thanks for following up, I dropped the ball here.

The file you mention had a different extension url so I replaced it but that didn't help, even after restarting chrome.

I also tried removing it, to no avail. Error remains the same.

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 16, 2022

@wmertens I am not concerned about the URL but the path key.

@wmertens
Copy link
Contributor

Ah - it was a regular file for me. What creates it?

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 16, 2022

Maybe you did and forgot about it?

@wmertens
Copy link
Contributor

Hmm, unless it was part of instructions at some point, I didn't create it. It also doesn't get recreated, (but the native host still breaks).

I'll try removing the extension from Chrome and re-adding

@jtojnar
Copy link
Contributor Author

jtojnar commented Feb 16, 2022

I think we recommended creating the file in the past (though there were no official docs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chrome-gnome-shell: gobject __main__+ChromeGNOMEShell' doesn't support property application_id'
2 participants