Closed danlu01 closed 5 years ago
Pity I don't have Windows to verify, I'm on macOS - no clue. @HHHartmann you're on Windows, aren't you? Can I invite you to try to reproduce this?
Sure. I will give it a try this afternoon.
Executing the command directly reveals the problem
root@6bd63424099b:/opt/nodemcu-firmware# /opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig/lxdialog/check-lxdialog.
sh
bash: /opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig/lxdialog/check-lxdialog.sh: /bin/bash^M: bad interpreter: No such file or directory
the files have windows style lineendings.
What is the work around?
Executing the command directly reveals the problem
root@6bd63424099b:/opt/nodemcu-firmware# /opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig/lxdialog/check-lxdialog. sh bash: /opt/nodemcu-firmware/sdk/esp32-esp-idf/tools/kconfig/lxdialog/check-lxdialog.sh: /bin/bash^M: bad interpreter: No such file or directory
the files have windows style lineendings.
Ouch. Users can fix this themselves when they clone the repo. Alternatively we could (maybe should) add a .gitattributes
file to the NodeMCU repo. Not sure if
* text=auto
*.sh text eol=lf
would be enough, though.
does it propagate to submodules? The tools directory has a nice template for that. Maybe we can take that for the root path.
tools/.gitattributes
# Enforce Unix newlines
*.css text eol=lf
*.html text eol=lf
*.js text eol=lf
*.json text eol=lf
*.less text eol=lf
*.md text eol=lf
*.svg text eol=lf
*.yml text eol=lf
*.py text eol=lf
*.sh text eol=lf
I've tried line ending fix before cloing:
git config core.autocrlf true
Still got the same errors.
Ouch. Users can fix this themselves when they clone the repo. Alternatively we could (maybe should) add a
.gitattributes
file to the NodeMCU repo. Not sure if* text=auto *.sh text eol=lf
would be enough, though.
that would convert lineendings to crlf on checkout which is what already happens.
after experimenting a bit it seems to me that there is no easy way to do this.
I can copy a .gitattributes file in sdk\esp32-esp-idf prior to updating the submodule i windows.
The it is OK.
I also found https://stackoverflow.com/questions/23667416/git-attributes-affecting-submodule which seems to cover the sme case.
So it seems that there is no one path way to check out the right thing.
So either checking out inside docker or having a two step checkout.
Should we change the documentation for checkout in the windows/docker scenario or have another script in docker to prepare-modules
which has to be executed once.
@marcelstoer which way should I go?
I'm hesitant...in order to analyze #58 I briefly borrowed a Windows machine today and also looked into this issue.
So either checking out inside docker
This is a no-go for me. Too far away from the regular development workflow.
Should we change the documentation for checkout in the windows/docker scenario
Yes, here and at https://nodemcu.readthedocs.io/en/dev-esp32/en/build/#docker-image
or having a two step checkout...have another script in docker to prepare-modules which has to be executed once.
I was thinking if/how we could automatically handle this correctly. Idea:
configure-esp32
detect if the SDK submodule contains files with Windows line breaks, if so
.gitattributes
from within the container (previously packaged into the Docker image) into the submodule foldersgit submodule update --recursive
@marcelstoer I also noticed that the files checked out under Windows are marked as changed in docker. So reverting the changes inside docker would also fix the line ends. So I would do that prior to each configure-esp32. Can we be safe enough to assume that no developer will ever change a submodule?
So documentation would only need to mention the reverting of changes in the docker documentation, if at all.
So reverting the changes inside docker would also fix the line ends.
True, no need to delete and Git submodule init inside the container.
Can we be safe enough to assume that no developer will ever change a submodule?
I believe so.
So, this would fix the line ending issue for submodules (careful to just revert those!) but not for our own sources. For that we'd still need .gitattributes
in our repo.
Hi, I'm trying to use docker esp32 on windows 10. I followed instructions to Configure modules and features for ESP32, then got following errors with configure-esp32.
I ran:
docker run --rm -it -v c:/Users/Daniel/nodemcu-firmware:/opt/nodemcu-firmware marcelstoer/nodemcu-build configure-esp32
got following errors:
Can someone tell me what's wrong?