espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.65k stars 7.29k forks source link

Setup Toolchain for Mac OS from Scratch - multiple problems #2607

Closed ghost closed 6 years ago

ghost commented 6 years ago

OK so I am trying to get the esp IDF installed on OSX.

First problem is described here: https://github.com/espressif/esp-idf/issues/2600

So I then think OK well maybe if I build the toolchain from scratch it might get around the above problem.

So I follow these instructions: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/macos-setup-scratch.html

$ git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git
**fatal: destination path 'crosstool-NG' already exists and is not an empty directory.**

So I get around this by first doing: cd ~/esp/crosstool-NG/

Then: git clone -b xtensa-1.22.x https://github.com/espressif/crosstool-NG.git

Then: cd ~/esp/crosstool-NG/crosstool-NG/

I then do:

$ ./bootstrap && ./configure --enable-local && make install
**-bash: ./bootstrap: /bin/sh^M: bad interpreter: No such file or directory**

Can anyone please suggest what I can do to get the idf installed on OSX?

thanks

igrr commented 6 years ago

Since the original issue is related to building mconf, building the toolchain from scratch is not going to resolve that.

Thanks for pointing out the mismatch between crosstool-NG directories, will fix this.

However this error messages likely explains the issue:

-bash: ./bootstrap: /bin/sh^M: bad interpreter: No such file or directory

There is an extra CR symbol at the end of the line, indicated by ^M. This can happen if your git is configured to check out files with CRLF line endings... which isn't a common thing to do on macOS. This can also happen when you clone the repository on Windows and later use it under macOS (when dual booting). Given the description of the issue, the former is more likely to be the case.

Could you please run the following (in crosstool-NG repository) and see if there's anything related to core.autocrlf?

git config --list
ghost commented 6 years ago

Here it is:

$ git config --list
core.excludesfile=~/.gitignore
core.legacyheaders=false
core.quotepath=false
mergetool.keepbackup=true
push.default=simple
color.ui=auto
color.interactive=auto
repack.usedeltabaseoffset=true
alias.s=status
alias.a=!git add . && git status
alias.au=!git add -u . && git status
alias.aa=!git add . && git add -u . && git status
alias.c=commit
alias.cm=commit -m
alias.ca=commit --amend
alias.ac=!git add . && git commit
alias.acm=!git add . && git commit -m
alias.l=log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
alias.ll=log --stat --abbrev-commit
alias.lg=log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.llg=log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit
alias.d=diff
alias.master=checkout master
alias.spull=svn rebase
alias.spush=svn dcommit
alias.alias=!git config --list | grep 'alias\.' | sed 's/alias\.\([^=]*\)=\(.*\)/\1\     => \2/' | sort
include.path=~/.gitcinclude
include.path=.githubconfig
include.path=.gitcredential
diff.exif.textconv=exif
credential.helper=osxkeychain
http.sslverify=false
core.autocrlf=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.precomposeunicode=true
remote.origin.url=https://github.com/espressif/crosstool-NG.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.xtensa-1.22.x.remote=origin
branch.xtensa-1.22.x.merge=refs/heads/xtensa-1.22.x
$
ghost commented 6 years ago

Seems to have fixed it thanks!

git config --global core.autocrlf false