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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thescripts
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
orgit clone --branch proper-crlf [email protected]:official-stockfish/Stockfish.git
because the branchproper-crlf
already contains the file.