Homebrew flakiness improvements

Use prebuilt package stored in intranet when possible and use
intranet mirror when git is required.

Task-number: QTQAINFRA-6903
Pick-to: 6.8 6.5 5.15
Change-Id: I1630098756c2e9b4f551686679e98a40af5eef2d
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit f23cd54e7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Aku Pietikäinen
2025-02-24 10:25:29 +02:00
committed by Qt Cherry-pick Bot
parent 62d9b4200c
commit 3dff41a447
13 changed files with 140 additions and 206 deletions

View File

@@ -1,23 +1,71 @@
#!/bin/bash
#Copyright (C) 2023 The Qt Company Ltd
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -e
INSTALLTYPE="$1"
VERSION="$2"
CHECKSUM="$3"
DEFAULT_PKG_VERSION="4.4.21"
DEFAULT_PKG_VERSION_CHECKSUM="cd83c4123d5db7d07eb3042f1c785ed7f599183c5c542040bc6abfa722583861"
DEFAULT_GIT_VERSION="deb02e27d99fd2cb27ae16760e3a5272b612fded"
DEFAULT_GIT_VERSION_CHECKSUM="a30b9fbf0d5c2cff3eb1d0643cceee30d8ba6ea1bb7bcabf60d3188bd62e6ba6"
source "$(dirname "$0")"/../../common/unix/DownloadURL.sh
source "$(dirname "$0")"/../../common/unix/SetEnvVar.sh
installPkg() {
if [ "$VERSION" == "" ]; then
VERSION="$DEFAULT_PKG_VERSION"
CHECKSUM="$DEFAULT_PKG_VERSION_CHECKSUM"
fi
DownloadURL \
"http://ci-files01-hki.ci.qt.io/input/mac/homebrew/$VERSION/Homebrew-$VERSION.pkg" \
"https://github.com/Homebrew/brew/releases/download/$VERSION/Homebrew-$VERSION.pkg" \
"$CHECKSUM" \
"/tmp/Homebrew-$VERSION.pkg"
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew-install.c744a716f9845988d01e6e238eee7117b8c366c9.rb \
https://raw.githubusercontent.com/Homebrew/install/c744a716f9845988d01e6e238eee7117b8c366c9/install \
b9782cc0b550229de77b429b56ffce04157e60486ab9df00461ccf3dad565b0a \
/tmp/homebrew_install
/usr/bin/ruby /tmp/homebrew_install </dev/null
sudo installer -pkg "/tmp/Homebrew-$VERSION.pkg" -target /
# Add homebrew to PATH
SetEnvVar "PATH" "/opt/homebrew/bin:$PATH"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
echo "Homebrew = $VERSION" >> ~/versions.txt
}
installGit() {
if [ "$VERSION" == "" ]; then
VERSION="$DEFAULT_GIT_VERSION"
CHECKSUM="$DEFAULT_GIT_VERSION_CHECKSUM"
fi
export HOMEBREW_BREW_GIT_REMOTE="https://git.intra.qt.io/external-repository-mirrors/homebrew/brew.git" # put your Git mirror of Homebrew/brew here
export HOMEBREW_CORE_GIT_REMOTE="https://git.intra.qt.io/external-repository-mirrors/homebrew/homebrew-core.git" # put your Git mirror of Homebrew/homebrew-core here
DownloadURL \
"https://git.intra.qt.io/external-repository-mirrors/homebrew/install/-/raw/$VERSION/install.sh" \
"https://git.intra.qt.io/external-repository-mirrors/homebrew/install/-/raw/$VERSION/install.sh" \
$CHECKSUM \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
}
if [ "$INSTALLTYPE" == "GIT" ]; then
installGit
else
installPkg
fi
# Disable non-ascii output for homebrew to make logs more readable
SetEnvVar "HOMEBREW_NO_COLOR" "1"
SetEnvVar "HOMEBREW_NO_EMOJI" "1"
SetEnvVar "HOMEBREW_NO_ENV_HINTS" "1"

View File

@@ -1,30 +0,0 @@
#!/usr/bin/env bash
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -e
. "$(dirname "$0")"/../unix/DownloadURL.sh
. "$(dirname "$0")"/../unix/SetEnvVar.sh
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/be699a568315f57b65519df576d7fc5840b8a5cc/install.sh \
https://raw.githubusercontent.com/Homebrew/install/be699a568315f57b65519df576d7fc5840b8a5cc/install \
f20e4a577f0cafbab5a44b4d239886d725b3b985 \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
SetEnvVar "PATH" "\$PATH:/opt/homebrew/bin"

View File

@@ -1,8 +1,12 @@
#!/usr/bin/env bash
#Copyright (C) 2023 The Qt Company Ltd
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
set -e
set -ex
INSTALLTYPE="GIT"
BASEDIR=$(dirname "$0")
"$BASEDIR/../common/macos/homebrew.sh"
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
set -e
INSTALLTYPE="GIT"
BASEDIR=$(dirname "$0")
"$BASEDIR/../common/macos/homebrew_for_arm_mac.sh"
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,28 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
INSTALLTYPE="GIT"
set -e
. "$(dirname "$0")"/../common/unix/DownloadURL.sh
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/a822f0d0f1838c07e86b356fcd2bf93c7a11c2aa/install.sh \
https://raw.githubusercontent.com/Homebrew/install/c744a716f9845988d01e6e238eee7117b8c366c9/install \
3210da71e12a699ab3bba43910a6d5fc64b92000 \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
BASEDIR=$(dirname "$0")
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
set -e
INSTALLTYPE="GIT"
BASEDIR=$(dirname "$0")
"$BASEDIR/../common/macos/homebrew_for_arm_mac.sh"
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,28 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2021 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
INSTALLTYPE="GIT"
set -e
. "$(dirname "$0")"/../common/unix/DownloadURL.sh
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/a822f0d0f1838c07e86b356fcd2bf93c7a11c2aa/install.sh \
https://raw.githubusercontent.com/Homebrew/install/c744a716f9845988d01e6e238eee7117b8c366c9/install \
3210da71e12a699ab3bba43910a6d5fc64b92000 \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
BASEDIR=$(dirname "$0")
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,16 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
set -e
INSTALLTYPE="PKG"
BASEDIR=$(dirname "$0")
"$BASEDIR/../common/macos/homebrew_for_arm_mac.sh"
# Can we force reading bash env this late?
echo "if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi" >> .profile
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,28 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
INSTALLTYPE="PKG"
set -e
. "$(dirname "$0")"/../common/unix/DownloadURL.sh
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/a822f0d0f1838c07e86b356fcd2bf93c7a11c2aa/install.sh \
https://raw.githubusercontent.com/Homebrew/install/c744a716f9845988d01e6e238eee7117b8c366c9/install \
3210da71e12a699ab3bba43910a6d5fc64b92000 \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
BASEDIR=$(dirname "$0")
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,16 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
set -e
INSTALLTYPE="PKG"
BASEDIR=$(dirname "$0")
"$BASEDIR/../common/macos/homebrew_for_arm_mac.sh"
# Can we force reading bash env this late?
echo "if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi" >> .profile
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,26 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
INSTALLTYPE="PKG"
set -e
. "$(dirname "$0")"/../common/unix/DownloadURL.sh
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/d8f6c666d20a3d42e007ceec161a06651ad92ba331a24a3de62912edb129a522/install.sh \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/d8f6c666d20a3d42e007ceec161a06651ad92ba331a24a3de62912edb129a522/install.sh \
d8f6c666d20a3d42e007ceec161a06651ad92ba331a24a3de62912edb129a522 \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
BASEDIR=$(dirname "$0")
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,16 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
set -e
INSTALLTYPE="PKG"
BASEDIR=$(dirname "$0")
"$BASEDIR/../common/macos/homebrew_for_arm_mac.sh"
# Can we force reading bash env this late?
echo "if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi" >> .profile
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"

View File

@@ -1,26 +1,12 @@
#!/usr/bin/env bash
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#Copyright (C) 2025 The Qt Company Ltd
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
set -ex
INSTALLTYPE="PKG"
set -e
. "$(dirname "$0")"/../common/unix/DownloadURL.sh
DownloadURL \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/d8f6c666d20a3d42e007ceec161a06651ad92ba331a24a3de62912edb129a522/install.sh \
http://ci-files01-hki.ci.qt.io/input/mac/homebrew/d8f6c666d20a3d42e007ceec161a06651ad92ba331a24a3de62912edb129a522/install.sh \
d8f6c666d20a3d42e007ceec161a06651ad92ba331a24a3de62912edb129a522 \
/tmp/homebrew_install.sh
DownloadURL "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "http://ci-files01-hki.ci.qt.io/input/semisecure/sign/pw" "aae58d00d0a1b179a09f21cfc67f9d16fb95ff36" "/Users/qt/pw"
{ pw=$(cat "/Users/qt/pw"); } 2> /dev/null
sudo chmod 755 /tmp/homebrew_install.sh
{ (echo "$pw" | /tmp/homebrew_install.sh); } 2> /dev/null
rm -f "/Users/qt/pw"
# No need to manually do `brew update`, the homebrew installer script does it.
### brew update
BASEDIR=$(dirname "$0")
# Usage "$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE" "$HOMEBREW_VERSION" "$HOMEBREW_HASH"
# Specify HOMEBREW_VERSION and HOMEBREW_HASH only if defaults set in homebrew.sh are not suitable for this platform
"$BASEDIR/../common/macos/homebrew.sh" "$INSTALLTYPE"