fuzziqersoftware / newserv

Phantasy Star Online game server, proxy, and reverse-engineering tools
MIT License
166 stars 37 forks source link

[newserv] Unable to build/make latest newserv for Shared EXP update #524

Closed gortr closed 4 months ago

gortr commented 4 months ago

Describe the bug Whenever I attempt to build the server from the latest updates after the,

-- Build files have been written to: /home/rygol/Desktop/LocalPSOServer

It throws an error that the Revision-generate.sh file is not found but it clearly exists within the src folder.

[ 1%] Generating src/Revision.cc, src/Revision.cc /bin/sh: 1: /home/rygol/Desktop/LocalPSOServer/src/Revision-generate.sh: not found make[2]: [CMakeFiles/newserv-Revision-cc.dir/build.make:74: src/Revision.cc] Error 127 make[1]: [CMakeFiles/Makefile2:84: CMakeFiles/newserv-Revision-cc.dir/all] Error 2 make: *** [Makefile:146: all] Error 2

The above is the complete error it throws, which is also within the screenshot as well alongside the src folder. I did build/make/install the latest phosg as well to make sure this wasn't an error on that end.

To reproduce When running the "cmake . && make" command or just "make" it causing the error in the screenshot below.

Screenshot Screenshot 2024-06-16 150458

fuzziqersoftware commented 4 months ago

This is quite odd; the script clearly exists and it should be executable, so I don't see why this wouldn't work. What happens if you do it manually by running ./Revision-generate.sh ./Revision.cc within the src directory?

gortr commented 4 months ago

After testing what would happen after attempting to manually run them it gave me this error,

bash: ./Revision-generate.sh: /bin/sh^M: bad interpreter: No such file or directory

Looked up what this could mean and found out it means there were line endings that didn't match the OS. I'm assuming this is mostly coded within Windows which would explain that. Luckily there is an easy fix for this for anyone else who may encounter this same issue. The way to confirm if it is the issue is by running "file Revision-generate.sh", this helps to confirm if it is the issue for anyone else that could have this exact issue.

To fix it, simply install dos2unix then run the command dos2unix Revision-generate.sh. Afterwards I tested running the make command again and it built everything no problem. This can officially be closed and resolved now :)

fuzziqersoftware commented 4 months ago

Interesting - thanks for sharing your findings. I've never seen this break on Linux before, but it makes sense. The codebase is actually primarily developed on macOS, but it was originally based on Aeon, which was indeed written on Windows. I'll change the line endings to non-Windows format so no one else will run into this again.