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

Debug commands showing analyzed things fail on the command line #127

Open
Gohla opened this issue May 3, 2023 · 0 comments
Open

Debug commands showing analyzed things fail on the command line #127

Gohla opened this issue May 3, 2023 · 0 comments
Labels
C-Bug Category: bug. Not working as expected

Comments

@Gohla
Copy link
Member

Gohla commented May 3, 2023

Summary

Debug commands showing analyzed things (such as the parsed AST) fail on the command line with an error indicating that the constraint analysis result for the file cannot be found (see stacktrace at the end).

What you did

Run a debug command showing the analyzed AST (see terminal command at the end) on https://github.com/Gohla/spoofax3-lang-example.

What you expected to happen

Print the analyzed AST.

What actually happened

Exception is printed.

Context

  • Spoofax version: 0.19.6

Additional information

 ~/D/m/spoofax3-lang-example/example  ./../mod.cli/build/graal/mod show-analyzed-ast ./nested.mod
[main] INFO mb.statix.spoofax.STX_solve_multi_file - Files analyzed in 0.0 s
[main] INFO mb.statix.spoofax.STX_solve_multi_file - Files analyzed in 0.002 s
[main] INFO mb.statix.spoofax.STX_solve_multi_project - Project analyzed in 0.0 s
An exception occurred while executing command 'Show analyzed AST':
mb.constraint.pie.MissingResultException: Cannot get constraint analysis result for 'java##./nested.mod' as it is missing from the multi-file constraint analysis result
	at mb.constraint.pie.SingleFileMapper.lambda$apply$0(ConstraintAnalyzeMultiTaskDef.java:185)
	at mb.common.option.Option.mapOrElse(Option.java:146)
	at mb.common.result.Result.flatMapOrElse(Result.java:432)
	at mb.constraint.pie.SingleFileMapper.apply(ConstraintAnalyzeMultiTaskDef.java:172)
	at mb.constraint.pie.SingleFileMapper.apply(ConstraintAnalyzeMultiTaskDef.java:163)
	at mb.pie.api.NonIncrFunction.apply(NonIncrFunction.java:16)
	at mb.pie.api.MappedSupplier.get(MappedSupplier.java:17)
	at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:151)
	at org.example.mod.task.ModAnalyzeFile.exec(ModAnalyzeFile.java:48)
	at org.example.mod.task.ModAnalyzeFile.exec(ModAnalyzeFile.java:22)
	at mb.pie.api.Task.exec(Task.java:56)
	at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:130)
	at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:87)
	at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:194)
	at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:139)
	at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:81)
	at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:118)
	at mb.pie.runtime.exec.ExecContextImpl.require(ExecContextImpl.java:98)
	at mb.constraint.pie.ShowAnalyzedAstTaskDef.exec(ShowAnalyzedAstTaskDef.java:57)
	at org.example.mod.task.ModShowAnalyzedAst.exec(ModShowAnalyzedAst.java:28)
	at org.example.mod.task.ModShowAnalyzedAst.exec(ModShowAnalyzedAst.java:10)
	at mb.pie.api.Task.exec(Task.java:56)
	at mb.pie.runtime.exec.TaskExecutor.execInternal(TaskExecutor.java:130)
	at mb.pie.runtime.exec.TaskExecutor.exec(TaskExecutor.java:87)
	at mb.pie.runtime.exec.TopDownRunner.exec(TopDownRunner.java:194)
	at mb.pie.runtime.exec.TopDownRunner.executeOrGetExisting(TopDownRunner.java:139)
	at mb.pie.runtime.exec.TopDownRunner.require(TopDownRunner.java:81)
	at mb.pie.runtime.exec.TopDownRunner.requireInitial(TopDownRunner.java:59)
	at mb.pie.runtime.MixedSessionImpl.lambda$requireWithoutObserving$2(MixedSessionImpl.java:110)
	at mb.pie.runtime.SessionImpl.handleException(SessionImpl.java:221)
	at mb.pie.runtime.MixedSessionImpl.requireWithoutObserving(MixedSessionImpl.java:110)
	at mb.pie.runtime.MixedSessionImpl.requireWithoutObserving(MixedSessionImpl.java:104)
	at mb.spoofax.cli.CommandRunner.call(CommandRunner.java:60)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at mb.spoofax.cli.SpoofaxCli.run(SpoofaxCli.java:63)
	at mb.spoofax.cli.SpoofaxCli.run(SpoofaxCli.java:45)
	at org.example.mod.cli.Main.main(Main.java:45)
@Gohla Gohla added the C-Bug Category: bug. Not working as expected label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug Category: bug. Not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant