GNOME Bugzilla – Bug 779335
Code assistance (pylint) doesn't work
Last modified: 2017-03-06 11:01:41 UTC
Using the nightly flatpak version of gnome-builder, I get the following error in terminal when editing Python files with pylint enabled: 20:38:50.0328 ide-diagnostics-manager[2]: WARNING: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown This repeats in the terminal over and over, pylint doesn't seem to work at all. gnome-code-assistance is installed on the host system.
Try running it with --talk-name=org.gnome.CodeAssist.* or --system-talk-name=org.gnome.CodeAssist.* (that's an option for flatpak-run not Builder)
It looks like our flatpak version of Builder was missing a --talk-name of org.gnome.CodeAssist.v1.*, so the dbus filter would never find the service. I've updated the json in gnome-apps-nightly, so a new build should be queued shortly. Once we have an answer back from that we can look at closing this as fixed.
The build has completed, go ahead and update Builder¹ and see if that fixes things for you. ¹ flatpak update --user org.gnome.Builder
Thanks! OK, so we're getting closer. The warning has gone away but has been replaced by this one: 07:00:16.0817 ide-diagnostics-manager[2]: WARNING: GDBus.Error:org.freedesktop.DBus.Python.FileNotFoundError: Traceback (most recent call last):
+ Trace 237197
retval = candidate_method(self, *args, **keywords)
app.service.parse(doc, options)
with open(doc.data_path) as f:
Indeed. We don't share a /tmp between the flatpak runtime and the host. So we'll need to move these files to somewhere like ~/.cache/gnome-builder/
*** Bug 779351 has been marked as a duplicate of this bug. ***
Created attachment 346941 [details] [review] unsavedfiles: store temporary files in .cache/gnome-builder/buffers We need a location for temporary files that allows us to access them from the host system (in the case we are moving between flatpak to host).
Comment on attachment 346941 [details] [review] unsavedfiles: store temporary files in .cache/gnome-builder/buffers This might fix it (although Nightly builds are not for some hours). Attachment 346941 [details] pushed as 3d5e5fe - unsavedfiles: store temporary files in .cache/gnome-builder/buffers
Let me know if this fixes things for you, and I'll update/close the bug.
Did the update get pushed out? Still seeing it trying to find stuff in /tmp Updating: org.gnome.Builder.Locale/x86_64/master from org.gnome.Builder-1-origin No updates. (env) [kazade@Lithium code]$ flatpak run org.gnome.Builder 10:32:07.0448 Json[59]: CRITICAL: json_node_get_node_type: assertion 'JSON_NODE_IS_VALID (node)' failed 10:32:07.0448 Json[59]: CRITICAL: json_node_get_node_type: assertion 'JSON_NODE_IS_VALID (node)' failed 10:32:07.0655 Json[59]: CRITICAL: json_node_get_node_type: assertion 'JSON_NODE_IS_VALID (node)' failed 10:32:07.0655 Json[59]: CRITICAL: json_node_get_node_type: assertion 'JSON_NODE_IS_VALID (node)' failed 10:32:08.0137 Json[59]: CRITICAL: json_node_get_node_type: assertion 'JSON_NODE_IS_VALID (node)' failed 10:32:08.0137 Json[59]: CRITICAL: json_node_get_node_type: assertion 'JSON_NODE_IS_VALID (node)' failed 10:32:13.0550 ide-diagnostics-manager[2]: WARNING: GDBus.Error:org.freedesktop.DBus.Python.FileNotFoundError: Traceback (most recent call last):
+ Trace 237212
I just got another update. The good news is, all warnings have gone away. The bad news is that pylint still doesn't seem to work. There's nothing in the terminal to say that it's gone wrong, I just don't see anything in Builder to indicate that it's doing anything. Actually wait, that's not quite accurate, there are now these warnings... 15:47:25.0035 ide-unsaved-files[50]: WARNING: Failed to open file “/home/kazade/.var/app/org.gnome.Builder/data/gnome-builder/drafts/franz/4053da96ef9a00090975b45c675a2ab85f2effe7”: No such file or directory 15:47:25.0035 ide-unsaved-files[50]: WARNING: Failed to open file “/home/kazade/.var/app/org.gnome.Builder/data/gnome-builder/drafts/franz/3ea3b96f1c76155fff9eaf08849be203d7f39145”: No such file or directory Presumably this is related to your commit above?
Those warnings are from loading drafts "aka unsaved buffers at shutdown". So they shouldn't be a problem. They JSON critical warnings are interesting though, are you using a flatpak manifest or maybe there are just json files in the tree that we are trying to parse and need better error checking? (I don't want to ever see CRITICIAL in the logs). Another thing you can do to troubleshoot, is to install "d-feet". Go to the "session" tab, and search for CodeAssist, and then navigate the object tree on the right to see if you can locate the document and if there are any diagnostics associated with it.
I just tested with git as of commit c31112561f10d227b55c56aac39f005cca9d9e5d and things are working from inside of a flatpak to the host-based gnome-code-assistance. (Tested with gnome-music/gnomemusic/__init__.py). As for pylint, it is disabled by default because it can cause code execution. So make sure that you've enabled the PyLint toggle in preferences.
OK weirdly pylint has just started working after latest updates (it wasn't working for me before either in the nightly builds or the system installed version of builder) So this issue is definitely resolved