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

configure: error: could not find bash >= 3.1 #365

Open
Sashkoiv opened this issue Jul 19, 2019 · 23 comments
Open

configure: error: could not find bash >= 3.1 #365

Sashkoiv opened this issue Jul 19, 2019 · 23 comments

Comments

@Sashkoiv
Copy link

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

@vinhjaxt
Copy link

vinhjaxt commented Aug 10, 2019

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.]+)

@QB4-dev
Copy link

QB4-dev commented Aug 27, 2019

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

@florosgpl
Copy link

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+

@zenlor
Copy link

zenlor commented Oct 22, 2019

fixed upstream jcmvbkbc/crosstool-NG#56

@PL4typus
Copy link

PL4typus commented Nov 5, 2019

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.]+)

@InSL
Copy link

InSL commented Nov 14, 2019

@vinhjaxt Thank you! works on raspbian too

jklmnn added a commit to jklmnn/crosstool-NG that referenced this issue Dec 13, 2019
@tvorogme
Copy link

Same error on Arch Linux

@jcable
Copy link

jcable commented Feb 2, 2020

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

@Ruzihm
Copy link

Ruzihm commented May 13, 2020

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

@sigma-prj
Copy link

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

@gretel
Copy link

gretel commented Nov 26, 2020

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

@pfalcon
Copy link
Owner

pfalcon commented Nov 30, 2020

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.

@gretel
Copy link

gretel commented Nov 30, 2020

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 🤡

@pfalcon
Copy link
Owner

pfalcon commented Nov 30, 2020

i am using osx

And I'm not using osx, sorry.

@gretel
Copy link

gretel commented Nov 30, 2020

nevermind i get the spirit around here.

@hcet14
Copy link

hcet14 commented Dec 17, 2020

Same error on Ubuntu 20.04. Fix from vinhjaxt works.

@ladidadida
Copy link

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

Update crosstools-ng as this solves additional problems.

@Pecacheu
Copy link

Pecacheu commented May 13, 2021

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
Copy link

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.

@dmascord
Copy link

@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 ?

@ChrisMacGregor
Copy link

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:

#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.

@luxkatana
Copy link

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)

@5ch4um1
Copy link

5ch4um1 commented Apr 18, 2024

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

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

No branches or pull requests