diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cc6d6ac..19336b25 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,9 +86,9 @@ update-fdroid-repo: script: - set -euo pipefail - echo 'CI - Downloading dependencies...' - - /bin/bash -x scripts/get_sources.sh uv - - /bin/bash -x scripts/get_sources.sh python - - /bin/bash -x scripts/get_sources.sh androguard + - /bin/bash scripts/get_sources.sh uv + - /bin/bash scripts/get_sources.sh python + - /bin/bash scripts/get_sources.sh androguard - echo 'CI - Downloaded dependencies.' - echo 'Updating F-Droid repo...' - /bin/bash scripts/ci-update-fdroid.sh @@ -122,9 +122,9 @@ update-site-repo: script: - set -euo pipefail - echo 'CI - Downloading dependencies...' - - /bin/bash -x scripts/get_sources.sh uv - - /bin/bash -x scripts/get_sources.sh python - - /bin/bash -x scripts/get_sources.sh pyyaml + - /bin/bash scripts/get_sources.sh uv + - /bin/bash scripts/get_sources.sh python + - /bin/bash scripts/get_sources.sh pyyaml - echo 'CI - Downloaded dependencies.' - echo 'CI - Updating website repo...' - /bin/bash scripts/ci-update-site.sh @@ -183,7 +183,7 @@ build-geckoview: - /bin/bash scripts/ci-prep.sh sb - echo 'CI - Prepared secrets.' - echo "CI - Building GeckoView (${BUILD_VARIANT})..." - - /bin/bash -x scripts/ci-build.sh "${BUILD_VARIANT}" 'geckoview' + - /bin/bash scripts/ci-build.sh "${BUILD_VARIANT}" 'geckoview' - echo "CI - Built GeckoView (${BUILD_VARIANT})." - echo 'CI - Uploading artifact...' - /bin/bash scripts/ci-upload-artifacts.sh geckoview "${BUILD_VARIANT}" @@ -231,7 +231,7 @@ build-fenix: - /bin/bash scripts/ci-prep.sh sb - echo 'CI - Prepared secrets.' - echo "CI - Building Fenix (${BUILD_VARIANT_PRETTY})..." - - /bin/bash -x scripts/ci-build.sh "${BUILD_VARIANT}" 'fenix' + - /bin/bash scripts/ci-build.sh "${BUILD_VARIANT}" 'fenix' - echo "CI - Built Fenix (${BUILD_VARIANT_PRETTY})." - echo 'CI - Uploading artifact...' - /bin/bash scripts/ci-upload-artifacts.sh fenix "${BUILD_VARIANT}" @@ -286,15 +286,15 @@ prepare-release: - /bin/bash scripts/ci-prep.sh s3-releases - echo 'CI - Prepared secrets.' - echo 'CI - Downloading dependencies...' - - /bin/bash -x scripts/get_sources.sh uv - - /bin/bash -x scripts/get_sources.sh python - - /bin/bash -x scripts/get_sources.sh s3cmd + - /bin/bash scripts/get_sources.sh uv + - /bin/bash scripts/get_sources.sh python + - /bin/bash scripts/get_sources.sh s3cmd - echo 'CI - Downloaded dependencies.' - echo 'CI - Downloading artifacts...' - - /bin/bash -x scripts/ci-download-artifacts.sh fenix arm64 - - /bin/bash -x scripts/ci-download-artifacts.sh fenix arm - - /bin/bash -x scripts/ci-download-artifacts.sh fenix x86_64 - - /bin/bash -x scripts/ci-download-artifacts.sh fenix bundle + - /bin/bash scripts/ci-download-artifacts.sh fenix arm64 + - /bin/bash scripts/ci-download-artifacts.sh fenix arm + - /bin/bash scripts/ci-download-artifacts.sh fenix x86_64 + - /bin/bash scripts/ci-download-artifacts.sh fenix bundle - echo 'CI - Downloaded artifacts.' - echo 'CI - Publishing packages...' - /bin/bash scripts/ci-publish-packages.sh diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 70a5c8e2..d4b92a41 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -6,7 +6,7 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -16,6 +16,13 @@ source "${IRONFOX_UTILS}" # Get our platform, OS, and architecture source "${IRONFOX_ENV_HELPERS}" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + function error_fn() { echo echo -e "\033[31mSomething went wrong! The script failed.\033[0m" diff --git a/scripts/build-if.sh b/scripts/build-if.sh index 0f2da9fd..7654aca2 100755 --- a/scripts/build-if.sh +++ b/scripts/build-if.sh @@ -38,6 +38,13 @@ if [[ ! -f "${IRONFOX_BUILD}/finished-prebuild" ]]; then exit 1 fi +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + # Set-up target parameters readonly build_arch="$1" readonly build_project="$2" @@ -1627,7 +1634,7 @@ function build_phoenix() { echo_red_text 'Building Phoenix...' pushd "${IRONFOX_PHOENIX}" - /bin/bash -x "${IRONFOX_PHOENIX}/scripts/build.sh" + /bin/bash "${IRONFOX_PHOENIX}/scripts/build.sh" popd # Ensure our cfg and policy files don't already exist in mozilla-central @@ -1645,7 +1652,7 @@ function build_uniffi() { echo_red_text 'Building uniffi-bindgen...' pushd "${IRONFOX_PREBUILDS}" - /bin/bash -x "${IRONFOX_PREBUILDS}/scripts/build.sh" 'uniffi' + /bin/bash "${IRONFOX_PREBUILDS}/scripts/build.sh" 'uniffi' popd echo_green_text 'SUCCESS: Built uniffi-bindgen' @@ -1656,7 +1663,7 @@ function build_wasi() { echo_red_text 'Building WASI SDK...' pushd "${IRONFOX_PREBUILDS}" - /bin/bash -x "${IRONFOX_PREBUILDS}/scripts/build.sh" 'wasi' + /bin/bash "${IRONFOX_PREBUILDS}/scripts/build.sh" 'wasi' popd echo_green_text 'SUCCESS: Built WASI SDK' @@ -1700,7 +1707,7 @@ function build_as() { pushd "${IRONFOX_AS}" export JAVA_HOME="${IRONFOX_JDK_17_HOME}" - /bin/bash -x "${IRONFOX_AS}/libs/verify-android-environment.sh" + /bin/bash "${IRONFOX_AS}/libs/verify-android-environment.sh" unset JAVA_HOME export JAVA_HOME="${IRONFOX_JAVA_HOME}" diff --git a/scripts/build.sh b/scripts/build.sh index 1e9ba668..b5fd88ef 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,7 +4,7 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -39,9 +39,9 @@ if [[ "${IRONFOX_LOG_BUILD}" == 1 ]]; then # Ensure our log directory exists "${IRONFOX_MKDIR}" -vp "${IRONFOX_LOG_DIR}" - /bin/bash -x "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}" > >("${IRONFOX_TEE}" -a "${BUILD_LOG_FILE}") 2>&1 + /bin/bash "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}" > >("${IRONFOX_TEE}" -a "${BUILD_LOG_FILE}") 2>&1 else - /bin/bash -x "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}" + /bin/bash "${IRONFOX_SCRIPTS}/build-if.sh" "${target}" "${project}" fi # We should only try to sign IronFox if we actually built Fenix, so check that first diff --git a/scripts/ci-build-if.sh b/scripts/ci-build-if.sh index e53d9c24..92811248 100755 --- a/scripts/ci-build-if.sh +++ b/scripts/ci-build-if.sh @@ -19,6 +19,13 @@ if [[ -z "${IRONFOX_FROM_CI_BUILD+x}" ]]; then exit 1 fi +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + readonly ci_build_arch="$1" case "${ci_build_arch}" in @@ -58,51 +65,51 @@ fi # Get sources if [[ "${ci_build_project}" == 'geckoview' ]]; then # If we're only building GeckoView, we don't need to download all sources - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'uv' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'python' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-ndk' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'jdk-25' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-build-tools' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-platform' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-platform-36' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-platform-tools' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'rust' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'cbindgen' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'bundletool' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'firefox' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'jdk-17' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'jdk-21' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'gradle' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'gyp' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'microg' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'node' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'npm' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'phoenix' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 's3cmd' - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 'wasi' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'uv' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'python' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-ndk' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'jdk-25' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-build-tools' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-platform' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-platform-36' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'android-sdk-platform-tools' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'rust' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'cbindgen' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'bundletool' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'firefox' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'jdk-17' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'jdk-21' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'gradle' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'gyp' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'microg' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'node' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'npm' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'phoenix' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 's3cmd' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 'wasi' else - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources.sh" 's3cmd' + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" + /bin/bash "${IRONFOX_SCRIPTS}/get_sources.sh" 's3cmd' # If we're building a Fenix bundle, we also need to download our GeckoView artifacts if [[ "${ci_build_arch}" == 'bundle' ]]; then - /bin/bash -x "${IRONFOX_SCRIPTS}/ci-download-artifacts.sh" 'geckoview' 'arm64' - /bin/bash -x "${IRONFOX_SCRIPTS}/ci-download-artifacts.sh" 'geckoview' 'arm' - /bin/bash -x "${IRONFOX_SCRIPTS}/ci-download-artifacts.sh" 'geckoview' 'x86_64' + /bin/bash "${IRONFOX_SCRIPTS}/ci-download-artifacts.sh" 'geckoview' 'arm64' + /bin/bash "${IRONFOX_SCRIPTS}/ci-download-artifacts.sh" 'geckoview' 'arm' + /bin/bash "${IRONFOX_SCRIPTS}/ci-download-artifacts.sh" 'geckoview' 'x86_64' fi fi # Prepare sources if [[ "${ci_build_project}" == 'geckoview' ]]; then # If we're only building GeckoView, we don't need to prepare all sources - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild.sh" 'firefox' - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild.sh" 'android-sdk' - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild.sh" 'microg' - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild.sh" 'rust' + /bin/bash "${IRONFOX_SCRIPTS}/prebuild.sh" 'firefox' + /bin/bash "${IRONFOX_SCRIPTS}/prebuild.sh" 'android-sdk' + /bin/bash "${IRONFOX_SCRIPTS}/prebuild.sh" 'microg' + /bin/bash "${IRONFOX_SCRIPTS}/prebuild.sh" 'rust' else - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild.sh" + /bin/bash "${IRONFOX_SCRIPTS}/prebuild.sh" fi # Build -/bin/bash -x "${IRONFOX_SCRIPTS}/build.sh" "${ci_build_arch}" "${ci_build_project}" +/bin/bash "${IRONFOX_SCRIPTS}/build.sh" "${ci_build_arch}" "${ci_build_project}" diff --git a/scripts/ci-build.sh b/scripts/ci-build.sh index fef9ebcb..790cb028 100755 --- a/scripts/ci-build.sh +++ b/scripts/ci-build.sh @@ -12,7 +12,7 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -35,7 +35,7 @@ function compress_archives() { elif [[ "${ci_project}" == 'fenix' ]]; then local readonly ci_job_artifact="build-fenix-${ci_target}" fi - /bin/bash -x "${IRONFOX_SCRIPTS}/ci-compress.sh" "${ci_job_artifact}" + /bin/bash "${IRONFOX_SCRIPTS}/ci-compress.sh" "${ci_job_artifact}" } # By default, we know the build hasn't failed... @@ -44,7 +44,7 @@ IRONFOX_CI_BUILD_FAILED=0 # Build IronFox readonly IRONFOX_FROM_CI_BUILD=1 export IRONFOX_FROM_CI_BUILD -/bin/bash -x "${IRONFOX_SCRIPTS}/ci-build-if.sh" "${ci_target}" "${ci_project}" || IRONFOX_CI_BUILD_FAILED=1 +/bin/bash "${IRONFOX_SCRIPTS}/ci-build-if.sh" "${ci_target}" "${ci_project}" || IRONFOX_CI_BUILD_FAILED=1 readonly IRONFOX_CI_BUILD_FAILED export IRONFOX_CI_BUILD_FAILED diff --git a/scripts/ci-compress.sh b/scripts/ci-compress.sh index c12efed5..254785d9 100644 --- a/scripts/ci-compress.sh +++ b/scripts/ci-compress.sh @@ -14,6 +14,13 @@ source $(dirname $0)/env.sh # Include utilities source "${IRONFOX_UTILS}" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + readonly artifact_name="$1" readonly artifact_archive="${artifact_name}.tar.xz" readonly artifact_path="${IRONFOX_ARTIFACTS}/${artifact_archive}" diff --git a/scripts/ci-download-artifacts-if.sh b/scripts/ci-download-artifacts-if.sh index 5ad4c6d1..ff7b6cbd 100755 --- a/scripts/ci-download-artifacts-if.sh +++ b/scripts/ci-download-artifacts-if.sh @@ -19,6 +19,13 @@ if [[ -z "${IRONFOX_FROM_AR_DOWN+x}" ]]; then exit 1 fi +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + readonly down_artifact="$1" # Set-up target parameters diff --git a/scripts/ci-download-artifacts.sh b/scripts/ci-download-artifacts.sh index f7a5e2d4..c8d217d9 100755 --- a/scripts/ci-download-artifacts.sh +++ b/scripts/ci-download-artifacts.sh @@ -12,7 +12,7 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -37,7 +37,7 @@ if [[ "${IRONFOX_LOG_AR_DOWN}" == 1 ]]; then # Ensure our log directory exists "${IRONFOX_MKDIR}" -vp "${IRONFOX_LOG_DIR}" - /bin/bash -x "${IRONFOX_SCRIPTS}/ci-download-artifacts-if.sh" "${target_artifact}" "${target_arch}" > >("${IRONFOX_TEE}" -a "${AR_DOWN_LOG_FILE}") 2>&1 + /bin/bash "${IRONFOX_SCRIPTS}/ci-download-artifacts-if.sh" "${target_artifact}" "${target_arch}" > >("${IRONFOX_TEE}" -a "${AR_DOWN_LOG_FILE}") 2>&1 else - /bin/bash -x "${IRONFOX_SCRIPTS}/ci-download-artifacts-if.sh" "${target_artifact}" "${target_arch}" + /bin/bash "${IRONFOX_SCRIPTS}/ci-download-artifacts-if.sh" "${target_artifact}" "${target_arch}" fi diff --git a/scripts/ci-prep.sh b/scripts/ci-prep.sh index 0e1638d3..7e89fc75 100755 --- a/scripts/ci-prep.sh +++ b/scripts/ci-prep.sh @@ -13,7 +13,7 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x "$(realpath $(dirname "$0"))/env.sh" + /bin/bash "$(realpath $(dirname "$0"))/env.sh" fi source "$(realpath $(dirname "$0"))/env.sh" diff --git a/scripts/ci-publish-packages.sh b/scripts/ci-publish-packages.sh index 7e88fd18..2c3ac54f 100755 --- a/scripts/ci-publish-packages.sh +++ b/scripts/ci-publish-packages.sh @@ -13,7 +13,7 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x "$(realpath $(dirname "$0"))/env.sh" + /bin/bash "$(realpath $(dirname "$0"))/env.sh" fi source "$(realpath $(dirname "$0"))/env.sh" diff --git a/scripts/ci-update-fdroid.sh b/scripts/ci-update-fdroid.sh index f89cd4cb..9f9b17be 100644 --- a/scripts/ci-update-fdroid.sh +++ b/scripts/ci-update-fdroid.sh @@ -11,13 +11,20 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x "$(realpath $(dirname "$0"))/env.sh" + /bin/bash "$(realpath $(dirname "$0"))/env.sh" fi source "$(realpath $(dirname "$0"))/env.sh" # Include utilities source "${IRONFOX_UTILS}" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + # Function to download an APK for a desired release function download_release() { local readonly version="$1" diff --git a/scripts/ci-update-site.sh b/scripts/ci-update-site.sh index ecd705e1..9364f136 100644 --- a/scripts/ci-update-site.sh +++ b/scripts/ci-update-site.sh @@ -10,10 +10,17 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x "$(realpath $(dirname "$0"))/env.sh" + /bin/bash "$(realpath $(dirname "$0"))/env.sh" fi source "$(realpath $(dirname "$0"))/env.sh" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + "${IRONFOX_GIT}" clone "https://${IF_CI_USERNAME}:${GITLAB_CI_PUSH_TOKEN}@gitlab.com/${TARGET_REPO_PATH}.git" target-repo cd target-repo || { echo "Unable to cd into target-repo"; exit 1; }; diff --git a/scripts/ci-upload-artifacts.sh b/scripts/ci-upload-artifacts.sh index 960e95c5..4c8701d1 100755 --- a/scripts/ci-upload-artifacts.sh +++ b/scripts/ci-upload-artifacts.sh @@ -12,7 +12,7 @@ if [[ -z "${IRONFOX_CI+x}" ]]; then export IRONFOX_CI=1 fi if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh diff --git a/scripts/deglean.sh b/scripts/deglean.sh index 79ae619c..a254ae88 100755 --- a/scripts/deglean.sh +++ b/scripts/deglean.sh @@ -4,13 +4,20 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh # Include utilities source "${IRONFOX_UTILS}" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + # Set-up target parameters if [[ -z "${1+x}" ]]; then readonly deglean_target='all' diff --git a/scripts/env_common.sh b/scripts/env_common.sh index f68e497f..d58cf74d 100644 --- a/scripts/env_common.sh +++ b/scripts/env_common.sh @@ -230,6 +230,14 @@ fi readonly IRONFOX_LOG_DIR export IRONFOX_LOG_DIR +# Whether we should display verbose build output +readonly IRONFOX_VERBOSE_DEFAULT=0 +if [[ -z "${IRONFOX_VERBOSE+x}" ]]; then + IRONFOX_VERBOSE="${IRONFOX_VERBOSE_DEFAULT}" +fi +readonly IRONFOX_VERBOSE +export IRONFOX_VERBOSE + # CI-specific build variables # These variables are set for CI primarily to allow parallel builds (for specific stages) readonly IRONFOX_CI_BUILD_GECKO_ARM64_DEFAULT=0 diff --git a/scripts/env_external.sh b/scripts/env_external.sh index b6abf7bd..34f4d0cc 100644 --- a/scripts/env_external.sh +++ b/scripts/env_external.sh @@ -258,6 +258,7 @@ readonly PHOENIX_UV_DIR="${IRONFOX_UV_DIR}" readonly PHOENIX_UV_LOCAL="${IRONFOX_UV_LOCAL}" readonly PHOENIX_UV_PYTHON="${IRONFOX_UV_PYTHON}" readonly PHOENIX_UV_TOOLS="${IRONFOX_UV_TOOLS}" +readonly PHOENIX_VERBOSE="${IRONFOX_VERBOSE}" readonly PHOENIX_XARGS="${IRONFOX_XARGS}" readonly PHOENIX_XZ="${IRONFOX_XZ}" export PHOENIX_ANDROID_ONLY @@ -309,6 +310,7 @@ export PHOENIX_UV_DIR export PHOENIX_UV_LOCAL export PHOENIX_UV_PYTHON export PHOENIX_UV_TOOLS +export PHOENIX_VERBOSE export PHOENIX_XARGS export PHOENIX_XZ diff --git a/scripts/get_sources-if.sh b/scripts/get_sources-if.sh index e6c20bea..35705c21 100755 --- a/scripts/get_sources-if.sh +++ b/scripts/get_sources-if.sh @@ -13,6 +13,13 @@ if [[ -z "${IRONFOX_FROM_SOURCES+x}" ]]; then exit 1 fi +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + readonly target="$1" readonly mode="$2" diff --git a/scripts/get_sources.sh b/scripts/get_sources.sh index 5fb922f2..a3d37ae4 100755 --- a/scripts/get_sources.sh +++ b/scripts/get_sources.sh @@ -4,7 +4,7 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -35,7 +35,7 @@ if [[ "${IRONFOX_LOG_SOURCES}" == 1 ]]; then # Ensure our log directory exists "${IRONFOX_MKDIR}" -vp "${IRONFOX_LOG_DIR}" - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources-if.sh" "${target}" "${mode}" > >("${IRONFOX_TEE}" -a "${SOURCES_LOG_FILE}") 2>&1 + /bin/bash "${IRONFOX_SCRIPTS}/get_sources-if.sh" "${target}" "${mode}" > >("${IRONFOX_TEE}" -a "${SOURCES_LOG_FILE}") 2>&1 else - /bin/bash -x "${IRONFOX_SCRIPTS}/get_sources-if.sh" "${target}" "${mode}" + /bin/bash "${IRONFOX_SCRIPTS}/get_sources-if.sh" "${target}" "${mode}" fi diff --git a/scripts/noop_mozilla_endpoints.sh b/scripts/noop_mozilla_endpoints.sh index 148418cb..6e874281 100755 --- a/scripts/noop_mozilla_endpoints.sh +++ b/scripts/noop_mozilla_endpoints.sh @@ -4,13 +4,20 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh # Include utilities source "${IRONFOX_UTILS}" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + # Set-up target parameters if [[ -z "${1+x}" ]]; then readonly noop_target='all' diff --git a/scripts/patch_create.sh b/scripts/patch_create.sh index a0900600..fc288767 100755 --- a/scripts/patch_create.sh +++ b/scripts/patch_create.sh @@ -4,7 +4,7 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -14,6 +14,13 @@ source "${IRONFOX_UTILS}" # Include version info source "${IRONFOX_VERSIONS}" +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + # Set timezone to UTC for consistency unset TZ export TZ="UTC" diff --git a/scripts/patches.sh b/scripts/patches.sh index 414fad65..23faa5f7 100644 --- a/scripts/patches.sh +++ b/scripts/patches.sh @@ -4,10 +4,17 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + readonly RED="\033[0;31m" readonly GREEN="\033[0;32m" readonly NC="\033[0m" diff --git a/scripts/prebuild-if.sh b/scripts/prebuild-if.sh index 917b6815..d9604346 100755 --- a/scripts/prebuild-if.sh +++ b/scripts/prebuild-if.sh @@ -40,6 +40,13 @@ if [[ -z "${IRONFOX_FROM_PREBUILD+x}" ]]; then exit 1 fi +# Set verbosity +if [[ "${IRONFOX_VERBOSE}" == 1 ]]; then + set -x +else + set +x +fi + if [[ -f "${IRONFOX_BUILD}/finished-prebuild" ]]; then "${IRONFOX_RM}" -f "${IRONFOX_BUILD}/finished-prebuild" fi @@ -214,7 +221,7 @@ function prepare_ac() { "${IRONFOX_RM}" -v "${IRONFOX_AC}/components/feature/search/src/main/assets/search/search_telemetry_v2.json" # Nuke undesired Mozilla endpoints - /bin/bash -x "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'ac' + /bin/bash "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'ac' # Remove unused/unwanted sample libraries ## Since we remove the Glean Service and Web Compat Reporter dependencies, the existence of these files causes build issues @@ -326,10 +333,10 @@ function prepare_as() { "${IRONFOX_RM}" -vr "${IRONFOX_AS}"/components/remote_settings/dumps/main/attachments/search-config-icons/* # Remove Glean - /bin/bash -x "${IRONFOX_SCRIPTS}/deglean.sh" 'as' + /bin/bash "${IRONFOX_SCRIPTS}/deglean.sh" 'as' # Nuke undesired Mozilla endpoints - /bin/bash -x "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'as' + /bin/bash "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'as' # Remove the AI summarizer models configuration collection "${IRONFOX_RM}" -v "${IRONFOX_AS}/components/remote_settings/dumps/main/summarizer-models-config.json" @@ -526,10 +533,10 @@ function prepare_fenix() { "${IRONFOX_RM}" -v "${IRONFOX_FENIX}/app/src/main/java/org/mozilla/fenix/home/TopSitesRefresher.kt" # Remove Glean - /bin/bash -x "${IRONFOX_SCRIPTS}/deglean.sh" 'fenix' + /bin/bash "${IRONFOX_SCRIPTS}/deglean.sh" 'fenix' # Nuke undesired Mozilla endpoints - /bin/bash -x "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'fenix' + /bin/bash "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'fenix' # Let it be IronFox "${IRONFOX_SED}" -i \ @@ -826,13 +833,13 @@ function prepare_firefox() { "${IRONFOX_SED}" -i 's|sentry|# sentry|g' "${IRONFOX_GECKO}/gradle/libs.versions.toml" # Remove Glean - /bin/bash -x "${IRONFOX_SCRIPTS}/deglean.sh" 'firefox' + /bin/bash "${IRONFOX_SCRIPTS}/deglean.sh" 'firefox' ## We also need to de-glean Android Components here, as not doing so appears to cause build failures for ex. GeckoView - /bin/bash -x "${IRONFOX_SCRIPTS}/deglean.sh" 'ac' + /bin/bash "${IRONFOX_SCRIPTS}/deglean.sh" 'ac' # Nuke undesired Mozilla endpoints - /bin/bash -x "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'firefox' + /bin/bash "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'firefox' # Fail on use of prebuilt binary "${IRONFOX_SED}" -i 's|https://github.com|hxxps://github.com|' "${IRONFOX_GECKO}/python/mozboot/mozboot/android.py" @@ -947,7 +954,7 @@ function prepare_glean() { "${IRONFOX_RM}" -v "${IRONFOX_GLEAN}/glean-core/android/metrics.yaml" # Nuke undesired Mozilla endpoints - /bin/bash -x "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'glean' + /bin/bash "${IRONFOX_SCRIPTS}/noop_mozilla_endpoints.sh" 'glean' # Ensure we're building for release "${IRONFOX_SED}" -i -e 's|ext.cargoProfile = .*|ext.cargoProfile = "release"|g' "${IRONFOX_GLEAN}/build.gradle" @@ -1022,7 +1029,7 @@ function prepare_prebuilds() { echo_red_text 'Preparing IronFox prebuilds...' pushd "${IRONFOX_PREBUILDS}" - /bin/bash -x "${IRONFOX_PREBUILDS}/scripts/prebuild.sh" + /bin/bash "${IRONFOX_PREBUILDS}/scripts/prebuild.sh" popd echo_green_text 'SUCCESS: Prepared IronFox prebuilds' diff --git a/scripts/prebuild.sh b/scripts/prebuild.sh index 8ae8b693..069e1626 100755 --- a/scripts/prebuild.sh +++ b/scripts/prebuild.sh @@ -4,7 +4,7 @@ set -euo pipefail # Set-up our environment if [[ -z "${IRONFOX_SET_ENVS+x}" ]]; then - /bin/bash -x $(dirname $0)/env.sh + /bin/bash $(dirname $0)/env.sh fi source $(dirname $0)/env.sh @@ -29,7 +29,7 @@ if [[ "${IRONFOX_LOG_PREBUILD}" == 1 ]]; then # Ensure our log directory exists "${IRONFOX_MKDIR}" -vp "${IRONFOX_LOG_DIR}" - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild-if.sh" "${target}" > >("${IRONFOX_TEE}" -a "${PREBUILD_LOG_FILE}") 2>&1 + /bin/bash "${IRONFOX_SCRIPTS}/prebuild-if.sh" "${target}" > >("${IRONFOX_TEE}" -a "${PREBUILD_LOG_FILE}") 2>&1 else - /bin/bash -x "${IRONFOX_SCRIPTS}/prebuild-if.sh" "${target}" + /bin/bash "${IRONFOX_SCRIPTS}/prebuild-if.sh" "${target}" fi