wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps

Home Page:https://wurstlang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stringhash interpreter errors when grill compiling in ubuntu wsl2

Cokemonkey11 opened this issue Β· comments

Describe the bug
grill build base_map.w3x on WSL2 using:

$ java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)

Results in:

$ grill build base_map.w3x
πŸ”₯ Grill warming up..
Custom WurstScript installation detected.
πŸ”₯ Ready. Version: <1.3.4.1-jenkins-WurstSetup-155>
πŸ”¨ Building project..
de.peeeq.wurstio.languageserver.requests.RequestFailedException: Could not compile project (error in running compiletime functions/expressions):
Error in File String.wurst line 208:
 You encountered a bug in the interpreter: java.lang.NoClassDefFoundError: net/moonlightflower/wc3libs/misc/StringHash
  at /mnt/c/Users/Cokem/workspace/gods-arena/./_build/dependencies/wurstStdlib2/wurst/_handles/primitives/String.wurst line 208
de.peeeq.wurstio.languageserver.requests.RequestFailedException: Could not compile project (error in running compiletime functions/expressions):
Error in File String.wurst line 208:
 You encountered a bug in the interpreter: java.lang.NoClassDefFoundError: net/moonlightflower/wc3libs/misc/StringHash
  at /mnt/c/Users/Cokem/workspace/gods-arena/./_build/dependencies/wurstStdlib2/wurst/_handles/primitives/String.wurst line 208
        at de.peeeq.wurstio.WurstCompilerJassImpl.runCompiletime(WurstCompilerJassImpl.java:116)
        at de.peeeq.wurstio.CompilationProcess.lambda$doCompilation$4(CompilationProcess.java:87)
        at de.peeeq.wurstio.TimeTaker.lambda$measure$0(TimeTaker.java:15)
        at de.peeeq.wurstio.TimeTaker$Default.measure(TimeTaker.java:33)
        at de.peeeq.wurstio.TimeTaker.measure(TimeTaker.java:14)
        at de.peeeq.wurstio.CompilationProcess.doCompilation(CompilationProcess.java:86)
        at de.peeeq.wurstio.Main.main(Main.java:146)
Caused by: Error in File String.wurst line 208:
 You encountered a bug in the interpreter: java.lang.NoClassDefFoundError: net/moonlightflower/wc3libs/misc/StringHash
  at /mnt/c/Users/Cokem/workspace/gods-arena/./_build/dependencies/wurstStdlib2/wurst/_handles/primitives/String.wurst line 208
  T     at de.peeeq.wurshio.CompiletimeFunctionRunner.sendErrors(CompiletimeFunctionRunner.java:154)
        at de.peeeq.wurstio.CompiletimeFunctionRunner.run(CompiletimeFunctionRunner.java:116)
        at de.peeeq.wurstio.WurstCompilerJassImpl.runCompiletime(WurstCompilerJassImpl.java:110)
        ... 6 more
Caused by: You encountered a bug in the interpreter: java.lang.NoClassDefFoundError: net/moonlightflower/wc3libs/misc/StringHash
  at /mnt/c/Users/Cokem/workspace/gods-arena/./_build/dependencies/wurstStdlib2/wurst/_handles/primitives/String.wurst line 208
Stack trace:
at : String.wurst, line 208
... when calling string_getHash("0") in Colors.wurst:295

Looks like it cannot find the wc3libs jar. Could be a problem with WSL and Windows using different file names (upper case vs lower case).

Can you check if it works if you install Wurst by running the setup tool on WSL?

If that does not help, please check:

  1. Go to Wurst install dir ~/.wurst
  2. Open wurstscript.jar with a zip editor and open META-INF/MANIFEST.MF in the jar. Does it contain wc3libs-7ece74aecc.jar?
  3. Does the Wurst install dir contain the file wc3libs-7ece74aecc.jar (all lowercase) with md5sum of 5b07afe51027b20d36bc51c6047cdff3?

Since posting this issue I seem to have a new problem, which may indicate some kind of filesystem corruption or similar:

$ grill build base_map.w3x
Error: Invalid or corrupt jarfile /home/blake/.wurst/WurstSetup.jar
$ ls -latr /home/blake/.wurst/
total 52892
...
-rw-r--r--  1 blake blake   449505 Oct 13 22:12 velocity-1.7.jar
-rw-r--r--  1 blake blake    18066 Oct 13 22:12 SimpleRegistry-f96dda96bd.jar
-rw-r--r--  1 blake blake 12328871 Oct 13 22:12 icu4j-61.1.jar
drwxrwxrwx  2 blake blake     4096 Oct 13 22:12 logs
drwxr-xr-x  2 blake blake     4096 Oct 13 22:15 WurstSetup.jar
drwxrwxrwx  4 blake blake    12288 Oct 13 22:15 .
drwxr-xr-x 29 blake blake     4096 Oct 18 00:04 ..
$ ls -latr /home/blake/.wurst/WurstSetup.jar/
total 16
drwxrwxrwx 4 blake blake 12288 Oct 13 22:15 ..
drwxr-xr-x 2 blake blake  4096 Oct 13 22:15 .

Of course, it is also possible that I or wurst tooling inadvertently did something dangerous.

I remediated with the following:

$ rm -rf /home/blake/.wurst/
$ wget https://grill.wurstlang.org/hudson/job/WurstSetup/lastSuccessfulBuild/artifact/downloads/WurstSetup.jar .
$ java -jar WurstSetup.jar help
πŸ”₯ Grill warming up..
WurstScript is not currently installed.
πŸ”₯ Ready. Version: <1.3.4.1-jenkins-WurstSetup-155>
⚠️ No wurst.build configuration file at current location.
Use one of the following commands: HELP, INSTALL, REMOVE, GENERATE, TEST, BUILD, SELF_UPDATE
java -jar WurstSetup.jar install wurstscript
πŸ”₯ Grill warming up..
WurstScript is not currently installed.
πŸ”₯ Ready. Version: <1.3.4.1-jenkins-WurstSetup-155>
⚠ No wurst.build configuration file at current location.
🌭 Installing WurstScript..
        Update available!
⏬  Downloading WurstScript..
        πŸ“₯ (45MB)
        πŸ“¦ Extracting..
βœ” Installed WurstScript
$ grill help
πŸ”₯ Grill warming up..
πŸ”₯ Ready. Version: <1.3.4.1-jenkins-WurstSetup-155>
⚠ No wurst.build configuration file at current location.
Use one of the following commands: HELP, INSTALL, REMOVE, GENERATE, TEST, BUILD, SELF_UPDATE

This seems to have fixed it, although I don't recall seeing this stacktrace from wc3libs in the past:

$ grill build base_map.w3x
πŸ”₯ Grill warming up..
πŸ”₯ Ready. Version: <1.3.4.1-jenkins-WurstSetup-155>
πŸ”¨ Building project..
net.moonlightflower.wc3libs.port.NotFoundException: java.lang.Exception: system not supported: Linux
        at net.moonlightflower.wc3libs.port.StdGameExeFinder.find(StdGameExeFinder.java:41)
        at net.moonlightflower.wc3libs.port.StdGameExeFinder.find(StdGameExeFinder.java:9)
        at net.moonlightflower.wc3libs.port.Finder.get(Finder.java:25)
        at de.peeeq.wurstio.utils.W3InstallationData.discoverExePath(W3InstallationData.java:71)
        at de.peeeq.wurstio.utils.W3InstallationData.<init>(W3InstallationData.java:28)
        at de.peeeq.wurstio.Main.main(Main.java:164)
Caused by: java.lang.Exception: system not supported: Linux
        ... 6 more
net.moonlightflower.wc3libs.port.NotFoundException: java.lang.Exception: system not supported: Linux
        at net.moonlightflower.wc3libs.port.StdGameVersionFinder.find(StdGameVersionFinder.java:43)
        at net.moonlightflower.wc3libs.port.StdGameVersionFinder.find(StdGameVersionFinder.java:12)
        at net.moonlightflower.wc3libs.port.Finder.get(Finder.java:25)
        at de.peeeq.wurstio.utils.W3InstallationData.discoverVersion(W3InstallationData.java:80)
        at de.peeeq.wurstio.utils.W3InstallationData.<init>(W3InstallationData.java:29)
        at de.peeeq.wurstio.Main.main(Main.java:164)
Caused by: java.lang.Exception: system not supported: Linux
        ... 6 more
Build succeeded. Output file: </mnt/c/Users/Cokem/workspace/gods-arena/./_build/Gods' Arena v0.9.9.w3x>
compilation finished (errors: 0, warnings: 3)
Warning in File Backpack.wurst line 5:
 The import ItemShopUI is never used
Warning in File Backpack.wurst line 11:
 The import Framehandle is never used
Warning in File FrameMultiboard.wurst line 11:
 Private variable <heroPickBackdrop> is never read.
πŸ—Ί Map has been built!

I recommend closing this. Mapfile works in game and I have no evidence that wurst did anything wrong to corrupt filesystem.