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 791936 - ide-vala-index.vala is broken because of recent vala parser update
ide-vala-index.vala is broken because of recent vala parser update
Status: RESOLVED OBSOLETE
Product: gnome-builder
Classification: Other
Component: plugins
3.27.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-25 01:17 UTC by ryu.insang
Modified: 2018-01-11 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
parser: Allow custom invocations of parse_file() (2.92 KB, patch)
2017-12-28 08:35 UTC, Rico Tzschichholz
committed Details | Review

Description ryu.insang 2017-12-25 01:17:09 UTC
This is the related vala update.



commit 2dc47785171f8f62f7f017939681e0d5cf3e9847
Author: Rico Tzschichholz <ricotz@ubuntu.com>
Date:   Thu Dec 14 10:23:14 2017 +0100

    Release taken references to CodeContext after using it
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712694
---
 vala/valaparser.vala | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index ec5e34e82..6228ba98e 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -76,6 +76,7 @@ public class Vala.Parser : CodeVisitor {
        public void parse (CodeContext context) {
                this.context = context;
                context.accept (this);
+               this.context = null;
        }
 
        public override void visit_source_file (SourceFile source_file) {




We have these lines in ide-vala-index.vala

		public ValaIndex (Ide.Context context)
		{
			...
			this.parser = new Vala.Parser ();
			this.parser.parse (this.code_context);
			...
		}



		void reparse ()
		{
			this.report.clear ();

			foreach (var source_file in this.code_context.get_source_files ()) {
				if (source_file.get_nodes ().size == 0) {
					this.parser.visit_source_file (source_file);
					if (source_file is Ide.ValaSourceFile) {
						(source_file as Ide.ValaSourceFile).dirty = false;
					}
				}
			}
		}


Vala.Parser.visit_source_files() tries to use Vala.CodeContext internally but it is set as null already. It shows messages like this and indexing job seems to fail.

10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_code_context_get_run_output: assertion 'self != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_parser_parse_using_directives: assertion 'ns != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_parser_parse_declarations: assertion 'parent != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_code_context_get_run_output: assertion 'self != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_parser_parse_using_directives: assertion 'ns != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_code_context_get_root: assertion 'self != NULL' failed
10:16:45.0013                                    (null)[ 17591]: CRITICAL: vala_parser_parse_declarations: assertion 'parent != NULL' failed
Comment 1 Christian Hergert 2017-12-25 01:20:03 UTC
Rico, any thoughts on if there is a better way for us to handle this in Builder?
Comment 2 Rico Tzschichholz 2017-12-28 08:35:42 UTC
Created attachment 366037 [details] [review]
parser: Allow custom invocations of parse_file()

Use CodeContext of SourceFile if needed
Comment 3 Rico Tzschichholz 2018-01-02 13:46:43 UTC
Comment on attachment 366037 [details] [review]
parser: Allow custom invocations of parse_file()

Attachment 366037 [details] pushed as 71da3b8 - parser: Allow custom invocations of parse_file()
Comment 4 GNOME Infrastructure Team 2018-01-11 10:52:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-builder/issues/339.