You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The make setup-testdb script is broken on Linux. It fails with the error pasted below when I try to run it:
$ make setup-testdb
./core/scripts/setup_testdb.sh
./core/scripts/setup_testdb.sh: 3: function: not found
Error:
make: *** [GNUmakefile:137: setup-testdb] Error 1
Your Environment
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ mktemp --version
mktemp (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Jim Meyering and Eric Blake.
$ uname -a
Linux myhostname 6.9.3-76060903-generic #202405300957~1736980680~22.04~44ea8a9 SMP PREEMPT_DYNAMIC Thu J x86_64 x86_64 x86_64 GNU/Linux
$ npx systeminformation info
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ SYSTEMINFORMATION Version: 5.25.11 │
└─────────────────────────────────────────────────────────────────────────────────────────┘
Operating System:
──────────────────────────────────────────────────────────────────────────────────────────
Platform : linux
Distro : Pop
Release : 22.04 LTS
Codename : jammy
Kernel : 6.9.3-76060903-generic
Arch : x64
Hostname : zend
Codepage : UTF-8
Build :
System:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer : ASUSTeK COMPUTER INC.
Model : ROG Zephyrus G14 GA402XV_GA402XV
Version : 1.0
Virtual :
CPU:
──────────────────────────────────────────────────────────────────────────────────────────
Manufacturer : AMD
Brand : Ryzen 9 7940HS w/ Radeon 780M Graphics
Family : 25
Model : 116
Stepping : 1
Speed : 3.3
Cores : 16
PhysicalCores : 8
PerformanceCores : 8
EfficiencyCores :
Processors : 1
Socket :
Basic Information
There are two issues with the script in my environment at present:
The function declaration is not valid syntax for sh (which is explicitly specified to be the shell for the script on the first line)
Once the function declaration syntax is fixed, then the mktemp call crashes because of invalid parameters (assuming the version of it on Mac is having a looser validation and that's why this has gone unnoticed)
After fixing the mktemp template by adding some X characters to it, it than crashes with ./core/scripts/setup_testdb.sh: 58: pushd: not found which is allegedly happening because the script declares that it wants to run in sh instead of bash. So finally, updating the hashbang to use bash solves all the issues. Happy days!
…template
Address the 3 problems with the setup_testdb.sh script on Linux
1. Invalid function declaration syntax
2. Invalid template syntax for mktemp (missing X characters)
3. Usage of `bash`-only commands in a script that wants to run in `sh` (pushd)
Fixessmartcontractkit#16179
Signed-off-by: Peter Somogyvari <[email protected]>
petermetz
added a commit
to petermetz/chainlink
that referenced
this issue
Jan 31, 2025
…template
Address the 3 problems with the setup_testdb.sh script on Linux
1. Invalid function declaration syntax
2. Invalid template syntax for mktemp (missing X characters)
3. Usage of `bash`-only commands in a script that wants to run in `sh` (pushd)
Fixessmartcontractkit#16179
Signed-off-by: Peter Somogyvari <[email protected]>
Description
The
make setup-testdb
script is broken on Linux. It fails with the error pasted below when I try to run it:$ make setup-testdb ./core/scripts/setup_testdb.sh ./core/scripts/setup_testdb.sh: 3: function: not found Error: make: *** [GNUmakefile:137: setup-testdb] Error 1
Your Environment
$ uname -a Linux myhostname 6.9.3-76060903-generic #202405300957~1736980680~22.04~44ea8a9 SMP PREEMPT_DYNAMIC Thu J x86_64 x86_64 x86_64 GNU/Linux
Basic Information
There are two issues with the script in my environment at present:
sh
(which is explicitly specified to be the shell for the script on the first line)mktemp
call crashes because of invalid parameters (assuming the version of it on Mac is having a looser validation and that's why this has gone unnoticed)./core/scripts/setup_testdb.sh: 58: pushd: not found
which is allegedly happening because the script declares that it wants to run insh
instead ofbash
. So finally, updating the hashbang to use bash solves all the issues. Happy days!Sources:
Steps to Reproduce
Execute the steps exactly as specified in the README's
## Development --> ### Running tests
sectionAdditional Information
The fixes to all three issues are relatively easy, here's the diff that I needed to make it work on my machine:
The text was updated successfully, but these errors were encountered: