File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ pipeline {
2929 disableRestartFromStage()
3030 timestamps()
3131 ansiColor(' xterm' )
32- /* This also includes wait time in the queue.*/
32+ /* This also includes wait time in the queue. */
3333 timeout(time : 24 , unit : ' HOURS' )
3434 /* Limit builds retained. */
3535 buildDiscarder(logRotator(
Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ in pkgs.mkShell {
3636 # will erase `-march=native` because this introduces impurity in the build.
3737 # For the purposes of compiling Nimbus, this behavior is not desired:
3838 export NIX_ENFORCE_NO_NATIVE=0
39- export USE_SYSTEM_GETOPT=1
4039 export MAKEFLAGS="-j$NIX_BUILD_CORES"
4140
4241 figlet "Welcome to Nimbus-eth2"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # scripts/getopt-wrapper.sh - exec GNU getopt on any platform.
3+ set -eu
4+
5+ if [ " $( uname) " != " Darwin" ]; then
6+ exec getopt " $@ "
7+ fi
8+
9+ # macOS: prefer getopt in PATH if it's GNU (exit 4 from --test), else Homebrew.
10+ getopt --test > /dev/null 2>&1 && rc=0 || rc=$?
11+ if [ " $rc " -eq 4 ]; then
12+ exec getopt " $@ "
13+ fi
14+
15+ for c in /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt; do
16+ [ -x " $c " ] && exec " $c " " $@ "
17+ done
18+
19+ echo " GNU getopt not installed. Install via 'brew install gnu-getopt'." >&2
20+ exit 1
Original file line number Diff line number Diff line change @@ -30,13 +30,7 @@ PIDS_TO_WAIT=""
3030# argument parsing #
3131# ###################
3232
33- USE_SYSTEM_GETOPT=" ${USE_SYSTEM_GETOPT:- 0} "
34- GETOPT_BINARY=" getopt"
35- if [[ " ${OS} " == " macos" && " $USE_SYSTEM_GETOPT " != " 1" ]]; then
36- # Without the head -n1 constraint, it gets confused by multiple matches
37- GETOPT_BINARY=$( find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true)
38- [[ -f " $GETOPT_BINARY " ]] || { echo " GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting." ; exit 1; }
39- fi
33+ GETOPT_BINARY=" ${SCRIPTS_DIR} /getopt-wrapper.sh"
4034
4135! ${GETOPT_BINARY} --test > /dev/null
4236if [[ ${PIPESTATUS[0]} != 4 ]]; then
Original file line number Diff line number Diff line change 99
1010set -e
1111
12+ SCRIPTS_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
13+
1214# ###################
1315# argument parsing #
1416# ###################
1517
16- GETOPT_BINARY=" getopt"
17- if uname | grep -qi darwin; then
18- # macOS
19- GETOPT_BINARY=$( find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null || true)
20- [[ -f " $GETOPT_BINARY " ]] || { echo " GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting." ; exit 1; }
21- fi
18+ GETOPT_BINARY=" ${SCRIPTS_DIR} /getopt-wrapper.sh"
2219
2320! ${GETOPT_BINARY} --test > /dev/null
2421if [ ${PIPESTATUS[0]} != 4 ]; then
Original file line number Diff line number Diff line change 99
1010set -e
1111
12+ SCRIPTS_DIR=" $( dirname " ${BASH_SOURCE[0]} " ) "
13+
1214# ###################
1315# argument parsing #
1416# ###################
1517
16- GETOPT_BINARY=" getopt"
17- if uname | grep -qi darwin; then
18- # macOS
19- # Without the head -n1 constraint, it gets confused by multiple matches
20- GETOPT_BINARY=$( find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true)
21- [[ -f " $GETOPT_BINARY " ]] || { echo " GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting." ; exit 1; }
22- fi
18+ GETOPT_BINARY=" ${SCRIPTS_DIR} /getopt-wrapper.sh"
2319
2420! ${GETOPT_BINARY} --test > /dev/null
2521if [ ${PIPESTATUS[0]} != 4 ]; then
26- echo ' `getopt --test` failed in this environment.'
27- exit 1
22+ echo ' `getopt --test` failed in this environment.'
23+ exit 1
2824fi
2925
3026OPTS=" h"
Original file line number Diff line number Diff line change @@ -25,15 +25,16 @@ wait_for_port() {
2525 done
2626}
2727
28- if [ -d /opt/homebrew/lib ]; then
29- # BEWARE
30- # The recent versions of homebrew/macOS can't add the libraries
31- # installed by Homebrew in the system's library search path, so
32- # Nimbus will fail to load RocksDB on start-up. THe new rules in
33- # macOS make it very difficult for the user to solve the problem
34- # in their profile, so we add an override here as the lessed evil:
35- export DYLD_LIBRARY_PATH=" ${DYLD_LIBRARY_PATH:- } :/opt/homebrew/lib"
36- # See https://github.com/Homebrew/brew/issues/13481 for more details
28+ if uname | grep -qi darwin; then
29+ # Ensure dynamically linked libraries (e.g. RocksDB) can be found at runtime.
30+ # Check Nix paths first, then fall back to Homebrew.
31+ # See https://github.com/Homebrew/brew/issues/13481 for more details.
32+ for libdir in /run/current-system/sw/lib /opt/homebrew/lib /usr/local/lib; do
33+ if [ -d " $libdir " ]; then
34+ DYLD_LIBRARY_PATH=" ${DYLD_LIBRARY_PATH: +$DYLD_LIBRARY_PATH : } $libdir "
35+ fi
36+ done
37+ export DYLD_LIBRARY_PATH
3738fi
3839
3940for NIMBUS_ETH1_NODE_IDX in $( seq 0 $NIMBUS_ETH1_LAST_NODE_IDX ) ; do
Original file line number Diff line number Diff line change @@ -17,17 +17,14 @@ RESTTEST_DELAY="30"
1717TEST_DIRNAME=" resttest0_data"
1818KILL_OLD_PROCESSES=" 0"
1919
20+ REPO_ROOT=" $( git rev-parse --show-toplevel) "
21+ SCRIPTS_DIR=" ${REPO_ROOT} /scripts"
22+
2023# ###################
2124# argument parsing #
2225# ###################
2326
24- GETOPT_BINARY=" getopt"
25- if uname | grep -qi darwin; then
26- # macOS
27- # Without the head -n1 constraint, it gets confused by multiple matches
28- GETOPT_BINARY=$( find /opt/homebrew/opt/gnu-getopt/bin/getopt /usr/local/opt/gnu-getopt/bin/getopt 2> /dev/null | head -n1 || true)
29- [[ -f " $GETOPT_BINARY " ]] || { echo " GNU getopt not installed. Please run 'brew install gnu-getopt'. Aborting." ; exit 1; }
30- fi
27+ GETOPT_BINARY=" ${SCRIPTS_DIR} /getopt-wrapper.sh"
3128
3229! ${GETOPT_BINARY} --test > /dev/null
3330if [ ${PIPESTATUS[0]} != 4 ]; then
You can’t perform that action at this time.
0 commit comments