Task Engine Analysis in an SPT file fails, while it succeeds in the editor. (Note that only two out of 393 tests fail.)

Spoofax version:

Eclipse: org.eclipse.platform.ide 4.6.2.M20161124-1400
Spoofax: org.metaborg.spoofax.eclipse 2.2.0.20170131-125021-master
System: Mac OS X x86_64 10.12.2

Spoofax version that did not have this issue:
Jan 31 11:17

Test case stack trace:

This test cased failed:
ERROR @ (81, 117) : Failed to analyze the input fragment, which is required to evaluate some of the test expectations.
org.metaborg.core.analysis.AnalysisException: Analysis failed
Stratego stack trace:
editor_analyze_0_0
__analyze_all_3_1
analyze_all_4_1
analyze_all_no_builtins_4_1
with_1_1
map_1_0
analysis_add_messages_1_0
with_1_1
analysis_get_messages_1_0
with_1_1
filter_1_0
r_2754
origin_track_forced_1_0
c_2810
_2_0
pp_message_0_0
map_1_0
pp_message_0_0
pp_uri_0_0
call_in_language_0_2

	at org.metaborg.spoofax.core.analysis.taskengine.TaskEngineAnalyzer.analyzeAll(TaskEngineAnalyzer.java:146)
	at org.metaborg.spoofax.core.analysis.taskengine.TaskEngineAnalyzer.analyzeAll(TaskEngineAnalyzer.java:112)
	at org.metaborg.spoofax.core.analysis.taskengine.TaskEngineAnalyzer.analyze(TaskEngineAnalyzer.java:88)
	at org.metaborg.spoofax.core.analysis.taskengine.TaskEngineAnalyzer.analyze(TaskEngineAnalyzer.java:1)
	at org.metaborg.core.analysis.AnalysisService.analyze(AnalysisService.java:27)
	at org.metaborg.spoofax.core.analysis.SpoofaxAnalysisService.analyze(SpoofaxAnalysisService.java:17)
	at org.metaborg.spoofax.core.analysis.SpoofaxAnalysisService.analyze(SpoofaxAnalysisService.java:1)
	at org.metaborg.mbt.core.run.TestCaseRunner.run(TestCaseRunner.java:75)
	at org.metaborg.spt.core.run.SpoofaxTestCaseRunner.run(SpoofaxTestCaseRunner.java:43)
	at org.metaborg.spt.testrunner.eclipse.TestRunner.runAll(TestRunner.java:190)
	at org.metaborg.spt.testrunner.eclipse.RunAllHandler$RunTestsJob.run(RunAllHandler.java:103)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.metaborg.core.MetaborgException: Invoking Stratego strategy editor-analyze failed unexpectedly
Stratego trace:
	editor_analyze_0_0
	__analyze_all_3_1
	analyze_all_4_1
	analyze_all_no_builtins_4_1
	with_1_1
	map_1_0
	analysis_add_messages_1_0
	with_1_1
	analysis_get_messages_1_0
	with_1_1
	filter_1_0
	r_2754
	origin_track_forced_1_0
	c_2810
	_2_0
	pp_message_0_0
	map_1_0
	pp_message_0_0
	pp_uri_0_0
	call_in_language_0_2
org.spoofax.interpreter.core.InterpreterException: Exception during evaluation: Exception in interpreter: Executing primitive call_strategy failed unexpectedly
	at org.metaborg.spoofax.core.stratego.StrategoCommon.handleException(StrategoCommon.java:157)
	at org.metaborg.spoofax.core.stratego.StrategoCommon.invoke(StrategoCommon.java:118)
	at org.metaborg.spoofax.core.analysis.taskengine.TaskEngineAnalyzer.analyzeAll(TaskEngineAnalyzer.java:143)
	... 11 more

ERROR @ (81, 117) : Expected analysis to succeed
Submitted by Daco Harkes on 1 February 2017 at 14:31

On 1 February 2017 at 16:13 Daco Harkes commented:

Cause: the foreign call interface in strategy changed, the language called in to needs to be specified in the yaml file now.

Fix: add analysis language to test project yaml file as compile dependency:

id: org.metaborg:icedust.test:0.5.1-SNAPSHOT
name: IceDust
metaborgVersion: 2.2.0-SNAPSHOT
dependencies:
  compile:
  - org.metaborg:icedust:0.5.1-SNAPSHOT
  - org.metaborg:org.metaborg.meta.lang.spt:${metaborgVersion}
  - org.metaborg:org.metaborg.meta.lang.analysis:${metaborgVersion}
build:
  useBuildSystemSpec: true

Issue can be closed.


On 1 February 2017 at 16:14 Gabriël Konat commented:

Make sure to add that dependency to your pom.xml file as well, because build: useBuildSystemSpec: true will cause the pom.xml file to be used instead of the metaborg.yaml file when building from Maven.


On 1 February 2017 at 16:15 Gabriël Konat closed this issue.

Log in to post comments