Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sumpfralle opened this issue Apr 30, 2022 · 4 comments
Open

Comments

@sumpfralle
Copy link

sumpfralle commented Apr 30, 2022

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 file lacked the executable permission. This could be fixed with chmod +x freecol/freecol.
  • The file contained CRLF line endings (dos/windows style).
    • Thus it was not executable: bash: freecol/freecol: /bin/sh^M: bad interpreter: No such file or directory
    • the ^M marks the carriage return (\r) which is not supposed to be there and which is interpreted as being part of the filename
    • this could be fixed with: fromdos freecol/freecol

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
Copy link
Member

mpope042 commented May 1, 2022

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
Copy link
Author

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:

  • replace tabs in all *.java files with spaces
  • fixTabsWindows: replace line endings of all *.java files with CRLF (probably not used)
  • fixTabsUnix: replace line endings of all *.java files with LF (probably not used)

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
Copy link
Member

mpope042 commented May 2, 2022

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
Copy link
Contributor

stiangre commented May 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants