From 87f857a8ab607cba0be4fabe4b03adce765b60fd Mon Sep 17 00:00:00 2001 From: Bitcoin Tools <156422466+bitcoin-tools@users.noreply.github.com> Date: Sat, 16 Mar 2024 17:14:46 -0400 Subject: [PATCH 1/3] refactor(compile): use variable for working directory --- nodebuilder | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nodebuilder b/nodebuilder index 1bec1fd5a..6657003a5 100755 --- a/nodebuilder +++ b/nodebuilder @@ -409,13 +409,14 @@ esac if [ "${current_bitcoin_version}" = "${target_bitcoin_version_padded}" ]; then printf '%s\n' "found." elif [ "$(uname -s)" = 'Linux' ] && [ "$(get_os_release_type)" = "alpine" ]; then + compile_directory="${temp_directory}/compile_bitcoin" stderr_compile_log_file="${temp_directory}/stderr_install.log" printf '%s\n %s' "not found." "Installing build dependencies... " apk --quiet add alpine-sdk libffi-dev autoconf automake db-dev boost boost-dev libtool libevent-dev 2> "${stderr_compile_log_file}" grep -v "ICU with non-English" -A2 -B1 "${stderr_compile_log_file}" >&2 || true printf '%s\n %s' "ok." "Downloading Bitcoin source code... " - git clone --branch "v${target_bitcoin_version}" --single-branch --depth 1 --quiet -c advice.detachedHead=false https://github.com/bitcoin/bitcoin.git "${temp_directory}"/compile_bitcoin - cd "${temp_directory}"/compile_bitcoin/ + git clone --branch "v${target_bitcoin_version}" --single-branch --depth 1 --quiet -c advice.detachedHead=false https://github.com/bitcoin/bitcoin.git "${compile_directory}" + cd "${compile_directory}"/ printf '%s\n %s' "ok." "Analyzing hardware confgiruation... " ./autogen.sh > /dev/null 2> "${stderr_compile_log_file}" grep -v "build-aux" "${stderr_compile_log_file}" >&2 || true @@ -433,8 +434,9 @@ elif [ "$(uname -s)" = 'Linux' ] && [ "$(get_os_release_type)" = "alpine" ]; the grep -v "Ran 3 tests in " -A1 -B2 "${stderr_compile_log_file}" >&2 || true printf '%s\n %s' "ok." "Installing Bitcoin... " make install > /dev/null + cd "${temp_directory}"/ rm "${stderr_compile_log_file}" - rm -rf "${temp_directory}"/compile_bitcoin/ + rm -rf "${compile_directory}"/ current_bitcoin_version="${target_bitcoin_version}" else printf '%s\n' "not found." From 13228a377153f62a316cf9aa93feb2b0e104f591 Mon Sep 17 00:00:00 2001 From: Bitcoin Tools <156422466+bitcoin-tools@users.noreply.github.com> Date: Sat, 16 Mar 2024 17:17:31 -0400 Subject: [PATCH 2/3] feat: protect against unset directory --- nodebuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodebuilder b/nodebuilder index 6657003a5..2b8dc8731 100755 --- a/nodebuilder +++ b/nodebuilder @@ -436,7 +436,7 @@ elif [ "$(uname -s)" = 'Linux' ] && [ "$(get_os_release_type)" = "alpine" ]; the make install > /dev/null cd "${temp_directory}"/ rm "${stderr_compile_log_file}" - rm -rf "${compile_directory}"/ + rm -rf "${compile_directory:?}"/ current_bitcoin_version="${target_bitcoin_version}" else printf '%s\n' "not found." From ebcddee1ce2786508023bd35f8ba5e1eccc0a550 Mon Sep 17 00:00:00 2001 From: Bitcoin Tools <156422466+bitcoin-tools@users.noreply.github.com> Date: Sat, 16 Mar 2024 17:45:09 -0400 Subject: [PATCH 3/3] fix(ui) suppress ICU message --- nodebuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodebuilder b/nodebuilder index 2b8dc8731..0d8258072 100755 --- a/nodebuilder +++ b/nodebuilder @@ -412,8 +412,8 @@ elif [ "$(uname -s)" = 'Linux' ] && [ "$(get_os_release_type)" = "alpine" ]; the compile_directory="${temp_directory}/compile_bitcoin" stderr_compile_log_file="${temp_directory}/stderr_install.log" printf '%s\n %s' "not found." "Installing build dependencies... " - apk --quiet add alpine-sdk libffi-dev autoconf automake db-dev boost boost-dev libtool libevent-dev 2> "${stderr_compile_log_file}" - grep -v "ICU with non-English" -A2 -B1 "${stderr_compile_log_file}" >&2 || true + apk --quiet add alpine-sdk libffi-dev autoconf automake db-dev boost boost-dev libtool libevent-dev | + grep -v "ICU with non-English locales" -A2 -B1 || true printf '%s\n %s' "ok." "Downloading Bitcoin source code... " git clone --branch "v${target_bitcoin_version}" --single-branch --depth 1 --quiet -c advice.detachedHead=false https://github.com/bitcoin/bitcoin.git "${compile_directory}" cd "${compile_directory}"/