Spoofax console depends on nix-profile
Following exception occurs while starting Spoofax Console in Windows 7 : “
Fatal error in interpreter thread
”It seems that it is looking for libstratego-lib.ctree in an invalid directory.
Exception details :
Submitted by Adil Akhter on 22 February 2012 at 16:28java.lang.RuntimeException: java.io.IOException: Failed to find Stratego library C:\Users\username\.nix-profile\share\stratego-lib\libstratego-lib.ctree at org.spoofax.interpreter.ConcreteInterpreter.<init>(ConcreteInterpreter.java:82) at org.spoofax.interpreter.ConcreteInterpreter.<init>(ConcreteInterpreter.java:57) at org.spoofax.interpreter.ui.SpoofaxInterpreter.<init>(SpoofaxInterpreter.java:30) at org.spoofax.interpreter.ui.SpoofaxConsole.run(SpoofaxConsole.java:90) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Failed to find Stratego library C:\Users\username\.nix-profile\share\stratego\lib\libstratego-lib.ctree at org.spoofax.interpreter.ConcreteInterpreter.findLibrary(ConcreteInterpreter.java:111) at org.spoofax.interpreter.ConcreteInterpreter.<init>(ConcreteInterpreter.java:63) ... 4 more
Issue Log
This is unexpected. The idea is that the .ctree files will be loaded from the .jar (they are bundled inside the jar), but I apparently made a boo-boo here. Will try to reproduce.
I had a look at this, but couldn’t find out how to load library ctrees from a jar file in Java. The problem is that that ConcreteInterpreter tries to load the libraries from the nix store instead of a jar file. Why is the HybridInterpreter not used here instead of the ConcreteInterpreter btw? Maybe @karltk knows more.
Just checked, the ctrees are not bundled inside the jar.
I am having the same problem: without nix store I cannot run Spoofax.
This issue is only regarding the interactive Spoofax console, without a nix profile it doesn’t work but Spoofax still does. What do you mean by ‘cannot run Spoofax’?
Maybe as a quick “fix”, it would be good if ConcreteInterpreter.findLibrary fails with a warning (instead of an exception) and only available libraries get loaded. I could implement this change if you want.
I should have been more precise: By ‘cannot run Spoofax’ I meant that I get lots of exceptions. I assumed Spoofax as a whole is in an inconsistent state then. BTW the exceptions already occur if the console is only fired up to display messages.
Log in to post comments