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

Fix EOL related build issues on Windows #2077

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

madmini
Copy link

@madmini madmini commented Jun 14, 2024

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

Copy link

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed

Copy link
Contributor

@NeroBurner NeroBurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. No change in behavior on supported platforms (i.e. Linux) and possible fix for Windows builds. Just suggesting a few comments for future "us" to know why we don't have native line endings

.gitattributes Show resolved Hide resolved
.gitattributes Outdated Show resolved Hide resolved
@NeroBurner NeroBurner requested a review from a team September 18, 2024 19:36
madmini and others added 2 commits September 19, 2024 02:26
only affects windows users
add reminder why this is necessary directly to file

Co-authored-by: NeroBurner <[email protected]>
Copy link
Contributor

@NeroBurner NeroBurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good. I'm scheduling for 1.16.0 as 1.15.0 feels close

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

Successfully merging this pull request may close these issues.

2 participants