WurstScript icon indicating copy to clipboard operation
WurstScript copied to clipboard

Build output map with empty war3map.j, on Raspberry Pi

Open jmrico01 opened this issue 5 years ago • 9 comments

Describe the bug

I recently got a Raspberry Pi 4, and decided it would be fun to use it as a CI runner for Wurst map builds. Since this is Java, it must simply work anywhere, right? Turns out, it almost works! However, it seems the output map has an empty war3map.j, even though the code is correctly compiled and saved in temp/output.j.

Environment is a Raspberry Pi 4 (ARM linux), with Java version:

openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-post-Raspbian-1deb10u2)
OpenJDK Server VM (build 11.0.9.1+1-post-Raspbian-1deb10u2, mixed mode)

Starting only with my map project and WurstSetup.jar:

  1. java -jar WurstSetup.jar install wurstscript
  2. java -jar ~/.wurst/WurstSetup.jar install
  3. java -jar ~/.wurst/WurstSetup.jar build base.w3x -runcompiletimefunctions -injectobjects -stacktraces -noExtractMapScript -opt
  4. I move the output map in _build to a Windows machine and inspect with an MPQ editor. Everything looks good except war3map.j is 0 bytes. temp/output.j has all the code, though...

EDIT: I also tried replacing all java -jar ~/.wurst/WurstSetup.jar commands with the standard ~/.wurst/grill - same results.

compiler.log

Speculation

When I do a Windows build, compiler.log at first is similar/equal to the one in the Pi. After build is done, the previous logs get totally overwritten, and in the new ones, there is a final MPQ editing section with just Added file war3map.j and a few others. This suggests to me that there are 2 MPQ editing/packing passes in the Wurst build, # 1 with almost everything except the war3map.j, and # 2 with the rest. It's possible that the 2nd one just isn't running on the Pi. There is no Added file war3map.j log there.

~~EDIT: Just saw https://github.com/wurstscript/WurstScript/pull/937, not sure if that would address this.~~ not relevant, nvm

jmrico01 avatar Dec 08 '20 05:12 jmrico01

You should use the package manager commands grill build etc. as described in the CI docker image https://hub.docker.com/r/frotty/wurstscript #937 is only for the runmap command.

Frotty avatar Dec 08 '20 10:12 Frotty

Just tried ~/.wurst/grill build base.w3x, but it didn't seem to change anything. I also tried re-running the install step with grill, but still the same.

jmrico01 avatar Dec 08 '20 14:12 jmrico01

I misread the original post and thought u were calling wurstscript.jar instead of setup/grill. So except for some suspicious runargs it seems fine and should work. Can you check if grill build works correctly on your normal (windows?) machine to verify that it's a problem on the rasp only?

Frotty avatar Dec 09 '20 10:12 Frotty

Yep, been doing grill build base.w3x on my Windows machine, and everything works as expected. In the Pi, the war3map.j is 0 bytes but everything else is OK.

jmrico01 avatar Dec 11 '20 07:12 jmrico01

So it sounds like a jmpq issue since the output.j is correctly generated, but not inserted into the map? Would probably need to investigate in that direction. The unit tests run on Linux, so it sounds like a more intricate problem.

Frotty avatar Dec 11 '20 10:12 Frotty

Yeah that sounds right. Weird because everything else gets inserted - I have an imports folder with a bunch of files, and those end up in the map no problem. My current workaround is to have a post-build step that inserts the temp/output.j into the built map as war3map.j.

jmrico01 avatar Dec 11 '20 15:12 jmrico01

any update on this?

Frotty avatar Feb 11 '21 14:02 Frotty

Not exactly the same environment, but I recently tried this on a new mac with an Apple silicon chip (ARM 64bit) and saw no issues. I also had to fix some pjass errors before the build fully worked, so now I'm wondering if it was those errors causing the issue to begin with. I can re-test on my raspberry pi in a few weeks.

jmrico01 avatar Dec 28 '23 16:12 jmrico01

Okay, might also have been fixed in the meantime. Some test case would be helpful.

Frotty avatar Dec 28 '23 16:12 Frotty