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

When cloned Stockfish sources using Windows Git client but using MSYS2 or CygWin make, an error was given in .sh files due to DOS CR/LF. #5753

Closed

Conversation

maximmasiutin
Copy link
Contributor

@maximmasiutin maximmasiutin commented Jan 7, 2025

Under Windows with CygWin, you could simply compile StockFish by running bash.exe and then from the prompt make -j profile-build, but DOS CR/LF lines in .sh files in the scripts directory gave error such as ../scripts/get_native_properties.sh: line 2: $'\r': command not found, so we have to specify that .sh files have LF only even under Windows.

This error also happens when using MSYS2 (mingw) but cloned the Stockfish source code earlier using Windows Git client.

P.S. Switching branches after the repository is cloned does not change CR/LF. If the .gitattributes file is in the master branch, the clone will take it into consideration. Otherwise, use git clone --branch proper-crlf [email protected]:maximmasiutin/Stockfish.git or git clone --branch proper-crlf [email protected]:official-stockfish/Stockfish.git because the branch proper-crlf already contains the file.

…ing bash.exe and then from the prompt `make -j profile-build`, but DOS CR/LF lines in .sh files in the `scripts` directory gave error such as `../scripts/get_native_properties.sh: line 2: $'\r': command not found`, so we have to specify that .sh files have LF only even under Windows. This error also happens when using MSYS2 (mingw) but cloned the Stockfish source code earlier using Windows Git client.
@RogerThiede
Copy link

I think this is reasonable, and to justify it more we should clarify how to reproduce because it will be based on settings that differ on Unix Emulators versus the OS it's running on, let alone what each developer set themselves. For example, git for Windows defaults core.autocrlf to true while git for Cygwin/MinGW/WSL defaults core.autocrlf to false.

git config --get core.autocrlf
git config --get core.eol

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

Successfully merging this pull request may close these issues.

3 participants