After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779335 - Code assistance (pylint) doesn't work
Code assistance (pylint) doesn't work
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
: 779351 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-02-27 20:42 UTC by Luke Benstead
Modified: 2017-03-06 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
unsavedfiles: store temporary files in .cache/gnome-builder/buffers (2.92 KB, patch)
2017-02-28 23:35 UTC, Christian Hergert
committed Details | Review

Description Luke Benstead 2017-02-27 20:42:39 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.
Comment 1 Matthew Leeds 2017-02-27 21:32:21 UTC
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)
Comment 2 Christian Hergert 2017-02-27 21:39:17 UTC
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.
Comment 3 Christian Hergert 2017-02-27 21:57:22 UTC
The build has completed, go ahead and update Builder¹ and see if that fixes things for you.

¹ flatpak update --user org.gnome.Builder
Comment 4 Luke Benstead 2017-02-28 07:04:23 UTC
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):
  • File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 707 in _message_cb
    retval = candidate_method(self, *args, **keywords)
  • File "/usr/libexec/gnome-code-assistance/backends/py/gnome/codeassistance/transport_dbus.py", line 255 in Parse
    app.service.parse(doc, options)
  • File "/usr/libexec/gnome-code-assistance/backends/py/gnome/codeassistance/python/__init__.py", line 76 in parse
    with open(doc.data_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: dbus.String('/tmp/builder_codeassistant_MROPWY.py')

Comment 5 Christian Hergert 2017-02-28 22:07:22 UTC
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/
Comment 6 Christian Hergert 2017-02-28 22:07:48 UTC
*** Bug 779351 has been marked as a duplicate of this bug. ***
Comment 7 Christian Hergert 2017-02-28 23:35:00 UTC
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 8 Christian Hergert 2017-02-28 23:35:54 UTC
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
Comment 9 Christian Hergert 2017-03-01 10:16:02 UTC
Let me know if this fixes things for you, and I'll update/close the bug.
Comment 10 Luke Benstead 2017-03-01 10:33:30 UTC
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):
  • File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 707 in _message_cb
    retval = candidate_method(self, *args, **keywords)
  • File "/usr/libexec/gnome-code-assistance/backends/py/gnome/codeassistance/transport_dbus.py", line 255 in Parse
    app.service.parse(doc, options)
  • File "/usr/libexec/gnome-code-assistance/backends/py/gnome/codeassistance/python/__init__.py", line 76 in parse
    with open(doc.data_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: dbus.String('/tmp/builder_codeassistant_G125VY.py')

Comment 11 Luke Benstead 2017-03-01 15:48:38 UTC
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?
Comment 12 Christian Hergert 2017-03-01 19:27:10 UTC
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.
Comment 13 Christian Hergert 2017-03-01 23:35:54 UTC
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.
Comment 14 Luke Benstead 2017-03-06 11:01:41 UTC
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