FreeCol / freecol

FreeCol: FreeCol is a turn-based strategy game based on the old game Colonization, and similar to Civilization. The objective of the game is to create an independent nation.
GNU General Public License v2.0
581 stars 170 forks source link

Build: `freecol` script is not executable and uses wrong line-endings #108

Open sumpfralle opened 2 years ago

sumpfralle commented 2 years ago

I downloaded the latest nightly build (freecol-nightly-20220420.zip).

It contained the script freecol in the directory freecol.

This script had two issues:

The original script in the repository looks good: packaging/common/freecol.sh (executable flag and correct line ending).

Thus I guess, that build.xml needs some adjustments.

Thank you for your time!

mpope042 commented 2 years ago

The only place in build.xml that refers to the freecol script is where it simply copies it into the build staging directory. Looks like an installer/packager problem, not something in our code.

sumpfralle commented 2 years ago

I took a look at the ant documentation for copy:

File permissions are not retained when files are copied

Thus I proposed specific setpermissions rules in #110.

Regarding the linebreak conversion (from unix to windows): I have no idea, what could cause this. The fixcrlf documentation describes, how lineendings could be converted by ant. But build.xml contains only three of these operations:

Thus I have no idea, how these CRLF could end up in the start script.

After running ant -noinput -buildfile build.xml nightly-release locally, they surprisingly did not appear in the generated zip file. I cannot imagine, what could differ between github's build environment (ubuntu-latest) and mine (Debian).

Maybe #110 accidentally fixes the lineending issue. But that's just a wild hope ...

mpope042 commented 2 years ago

File permissions are not retained when files are copied

Ugh, I should have guessed ant was being difficult. Thanks for the pointer. However, I applied your patch, but the permissions are still 644 in the freshly built zip. Did it work for you?

Similarly, I can not replicate the CRLF behaviour. The file is still in unix format in the zip for me... however my machine is not what is being used to build the nightlies.

stiangre commented 2 years ago

@sumpfralle : Are you experiencing the same issue using the new development build?