esp-open-sdk icon indicating copy to clipboard operation
esp-open-sdk copied to clipboard

configure: error: could not find bash >= 3.1

Open Sashkoiv opened this issue 4 years ago • 23 comments

Ubuntu 18 appears after make command for the solution follow the link https://bbs.archlinux.org/viewtopic.php?id=244333

Sashkoiv avatar Jul 19 '19 17:07 Sashkoiv

Change line 193 at: esp-open-sdk/crosstool-NG/configure.ac
like this:
 |$EGREP '^GNU bash, version ([0-9\.]+)')
then run make again

image p/s: this image is wrong ([0-9\.]+), not ([0-9.]+)

vinhjaxt avatar Aug 10 '19 17:08 vinhjaxt

I can confirm this error on systems with bash version 5+

QB4-dev avatar Aug 27 '19 15:08 QB4-dev

thanks vin for the heads up. I hope that pfalcon can fix it in the code, as it is unable to build without editing the config file. Also, libtool-bin is needed and libexpat-dev is now libexpat1-dev in debian 10+

florosgpl avatar Oct 02 '19 18:10 florosgpl

fixed upstream https://github.com/jcmvbkbc/crosstool-NG/pull/56

zenlor avatar Oct 22 '19 00:10 zenlor

Can confirm error on Debian 10, can confirm that the fix work

Change line 193 at: esp-open-sdk/crosstool-NG/configure.ac
like this:
 |$EGREP '^GNU bash, version ([0-9\.]+)')
then run make again

image p/s: this image is wrong ([0-9\.]+), not ([0-9.]+)

PL4typus avatar Nov 05 '19 11:11 PL4typus

@vinhjaxt Thank you! works on raspbian too

InSL avatar Nov 14 '19 19:11 InSL

Same error on Arch Linux

tvorogme avatar Jan 30 '20 15:01 tvorogme

I just changed: |$EGREP '^GNU bash, version (3.[1-9]|4)') to |$EGREP '^GNU bash, version (3.[1-9]|4|5)')

jcable avatar Feb 02 '20 18:02 jcable

Trying to install this on WSL + ubuntu. jcable's fix worked for me.

Ruzihm avatar May 13 '20 19:05 Ruzihm

Change line 193 at: esp-open-sdk/crosstool-NG/configure.ac
like this:
 |$EGREP '^GNU bash, version ([0-9\.]+)')
then run make again

image p/s: this image is wrong ([0-9\.]+), not ([0-9.]+)

(3.[1-9]|4|5|6|7) may be

sigma-prj avatar Nov 19 '20 01:11 sigma-prj

now that i figured it's required to use this sdk to build pycopy for esp8266 it's not in usable state 😢

gretel avatar Nov 26 '20 23:11 gretel

now that i figured it's required to use this sdk to build pycopy for esp8266 it's not in usable state cry

esp-open-sdk build and then pycopy esp8266 build using it is fine, as exemplified by pycopy CI builds: https://github.com/pfalcon/pycopy/runs/1457821945 .

Maybe it's not fine on some overmodern distros, which is sad, but there's a choice of not falling for overmodern distros, or use docker, etc. When I fall myself for overmodern distros (it happens to everyone eventually, but the keyword is exactly "eventually"), I'll fix it here (can't fix not seeing an issue, right?). Until then, good people above gave hints how to fix it on your side.

pfalcon avatar Nov 30 '20 18:11 pfalcon

not sure what you are trying to say by "overmodern distros" - i am using osx which is said to be pretty common. micropython is well supporting this platform so i dont mind closing this instead of fixing an issue reported multiple times here 🤡

gretel avatar Nov 30 '20 18:11 gretel

i am using osx

And I'm not using osx, sorry.

pfalcon avatar Nov 30 '20 18:11 pfalcon

nevermind i get the spirit around here.

gretel avatar Nov 30 '20 18:11 gretel

Same error on Ubuntu 20.04. Fix from vinhjaxt works.

hcet14 avatar Dec 17 '20 22:12 hcet14

I guess a better solution now is described in ticket https://github.com/pfalcon/esp-open-sdk/issues/380

Update crosstools-ng as this solves additional problems.

ladidadida avatar Jan 23 '21 13:01 ladidadida

I guess a better solution now is described in ticket #380

Update crosstools-ng as this solves additional problems.

This almost worked for me on Ubuntu 20.04. I also had to copy over the local-patches directory from the old Crosstool-NG. But now I get this after the script runs for a while:

make[2]: Entering directory '/home/ray/esp-open-sdk/crosstool-NG'
make[2]: *** No rule to make target 'xtensa-lx106-elf'.  Stop.
make[2]: Leaving directory '/home/ray/esp-open-sdk/crosstool-NG'
make[1]: *** [../Makefile:135: _toolchain] Error 2
make[1]: Leaving directory '/home/ray/esp-open-sdk/crosstool-NG'
make: *** [Makefile:131: crosstool-NG/.built] Error 2

With @vinhjaxt I get further (I think?) Now it fails here:

./ct-ng build
make[2]: Entering directory '/home/ray/esp-open-sdk/crosstool-NG'
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20210513.173214
[INFO ]  Building environment variables
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Retrieving needed toolchain components' tarballs'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: do_expat_get[scripts/build/companion_libs/210-expat.sh@12]
[ERROR]  >>        called from: do_companion_libs_get[scripts/build/companion_libs.sh@15]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@591]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      'share/doc/crosstool-ng/crosstool-ng-1.22.0-60-g37b07f6f-dirty/B - Known issues.txt'
[ERROR]
[ERROR]  (elapsed: 0:12.61)
[00:13] / make[2]: *** [ct-ng:152: build] Error 1
make[2]: Leaving directory '/home/ray/esp-open-sdk/crosstool-NG'
make[1]: *** [../Makefile:139: _toolchain] Error 2
make[1]: Leaving directory '/home/ray/esp-open-sdk/crosstool-NG'
make: *** [Makefile:131: crosstool-NG/.built] Error 2

In build.log it looks like the problem is downloading a file.

[EXTRA]    Retrieving 'expat-2.1.0'
[DEBUG]    Trying 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz'
[DEBUG]    ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/ray/esp-open-sdk/crosstool-NG/.build/tarballs/expat-2.1.0.tar.gz.tmp-dl' 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz'
[ALL  ]    --2021-05-13 17:32:25--  http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz
[ALL  ]    Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.105.38.13
[ALL  ]    Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:80... connected.
[ALL  ]    HTTP request sent, awaiting response... 404 Not Found
[ALL  ]    2021-05-13 17:32:25 ERROR 404: Not Found.

Tries a bunch more URLs, then eventually...

[DEBUG]    Not at this location: "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.zip"
[DEBUG]    Trying 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0'
[DEBUG]    ==> Executing: 'wget' '--passive-ftp' '--tries=3' '-nc' '--progress=dot:binary' '-T' '10' '-O' '/home/ray/esp-open-sdk/crosstool-NG/.build/tarballs/expat-2.1.0.tmp-dl' 'http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0'
[ALL  ]    --2021-05-13 17:32:27--  http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0
[ALL  ]    Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.105.38.13
[ALL  ]    Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:80... connected.
[ALL  ]    HTTP request sent, awaiting response... 404 Not Found
[ALL  ]    2021-05-13 17:32:27 ERROR 404: Not Found.
[ALL  ]
[DEBUG]    Not at this location: "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0"
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Retrieving needed toolchain components' tarballs'
[ERROR]  >>        called in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: do_expat_get[scripts/build/companion_libs/210-expat.sh@12]
[ERROR]  >>        called from: do_companion_libs_get[scripts/build/companion_libs.sh@15]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@591]
[ERROR]  >>
[ERROR]  >>  For more info on this error, look at the file: 'build.log'
[ERROR]  >>  There is a list of known issues, some with workarounds, in:
[ERROR]  >>      'share/doc/crosstool-ng/crosstool-ng-1.22.0-60-g37b07f6f-dirty/B - Known issues.txt'
[ERROR]
[ERROR]  (elapsed: 0:12.61)

Wait lol I found the problem. https://sourceforge.net/projects/expat/files/expat/2.1.0

They renamed it to expat-2.1.0-RENAMED-VULNERABLE-PLEASE-USE-2.3.0-INSTEAD

And this is why applications that auto-download files should always cheek for the latest version of things. eyerolls

Trouble is I have no clue how to tell the script where to find the new one. I don't know anything about makefiles other than how to edit specific lines in a template that are commented "Put your libraries and app name here", etc.

Pecacheu avatar May 13 '21 21:05 Pecacheu

Alright, think I've finally got it working!

In total here's what I did that finally worked (using Ubuntu 20.04 WSL)

sudo apt install <dependencies found in Readme>
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
rm -rf crosstool-NG
git clone https://github.com/jcmvbkbc/crosstool-NG
cd crosstool-NG
git checkout xtensa-1.22.x
code scripts/build/companion_libs/210-expat.sh

Using code, nano, or your editor of choice, add EXPVERS="2.3.0" to the start of the file. Everywhere where it says ${CT_EXPAT_VERSION}, replace with ${EXPVERS} Probably a better way to do this, but this worked.

cd ..
build

And finished!

Note: I did also have to tweak some of the dependencies specified in the Readme since some packages weren't found or are installed under a different command (ex python2 rather than python), but nothing too difficult to fix.

Pecacheu avatar May 14 '21 03:05 Pecacheu

@Pecacheu - Version 2.3.0 of Expat is now removed from sourceforge due to exploits on that version, so best to switch to 2.4.1.... more eyes rolling ?

dmascord avatar Jun 22 '21 04:06 dmascord

In addition to the issues described above, I had to fix some other things to get this to build on Ubuntu 21.10. The end result (which gets me a clean build on Ubuntu 21.10 of an apparently working toolchain) can be found here:

https://github.com/pfalcon/esp-open-sdk/pull/391 https://github.com/ChrisMacGregor/esp-open-sdk/tree/builds-on-Ubuntu-21.10 Tarball of built toolchain: https://github.com/ChrisMacGregor/esp-open-sdk/releases/tag/builds-on-Ubuntu-21.10

Note that I'm using expat 2.1.0; the comments above suggest that expat 2.4.1 is a drop-in replacement, and (so far) it has not been pulled for security issues. So you might want to do that differently than I did.

ChrisMacGregor avatar Jan 12 '22 02:01 ChrisMacGregor

Change line 193 at: esp-open-sdk/crosstool-NG/configure.ac
like this:
 |$EGREP '^GNU bash, version ([0-9\.]+)')
then run make again

image p/s: this image is wrong ([0-9\.]+), not ([0-9.]+)

This worked for me. Only I switched the

|$EGREP '^GNU bash, version ([0-9\.]+)')

line 193 with

  |$EGREP '^GNU bash, version (5\.[1-9]|4)')

Since I am running bash 5+ (to be more specific 5.1.16)

luxkatana avatar Jan 01 '24 14:01 luxkatana

telling it where to find it in the Makefile worked for me: ~/esp-open-sdk$ nl Makefile | grep "with-bash"
124 ./configure --prefix=pwd --with-bash=/usr/bin/bash

5ch4um1 avatar Apr 18 '24 19:04 5ch4um1