InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Fix EOL related build issues on Windows

Open madmini opened this issue 1 year ago • 1 comments

Proper fix for #1275 that does no longer require manual intervention.

On Windows, git has core.autocrlf=true set at system level, hence any Windows user who has not changed their global git config will checkout all text files with CRLF line endings. For some files this seems to cause build issues.

With this change, I can build using docker on Windows 11 as follows:

git clone https://github.com/madmini/InfiniTime.git --branch fix/eol-on-windows
cd InfiniTime
git submodule update --init
docker run --rm -it -v ${PWD}:/sources infinitime/infinitime-build

Without the change, the build fails with an error that matches the one described in #1275:

...
[ 34%] Linking C static library libnimble.a
[ 34%] Built target nimble
gmake: *** [Makefile:91: all] Error 2

Note: when changing between branches with varying .gitattributes with checkout instead of directly cloning with --branch, resetting the line endings is more complicated:

git clone https://github.com/madmini/InfiniTime.git
# CRLF line endings
git checkout fix/eol-on-windows
# still CRLF line endings
git rm --cached -r .
git reset --hard
# LF line endings

madmini avatar Jun 14 '24 18:06 madmini

Build size and comparison to main:

Section Size Difference
text 372944B 0B
data 948B 0B
bss 22536B 0B

github-actions[bot] avatar Jun 14 '24 18:06 github-actions[bot]

If you rebase this onto main the CI should work now #2166 is merged

mark9064 avatar Nov 17 '24 23:11 mark9064

If you rebase this onto main the CI should work now #2166 is merged

done

madmini avatar Nov 18 '24 08:11 madmini