aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-05-07 14:56:35 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-05-07 21:52:16 +0200
commit3652f77aa34d5d5fde8981713ca3f427e241bb71 (patch)
tree3f1afc6d7f1b826c87e3300c19c117f1262c2dd6
parent9f4a39356a95d1c4606938c1c50b56a6204366d4 (diff)
Provisioning: Set macOS locale to "en_US.UTF-8"
The 419f42903154489e2dace8d1eba183036275448b commit in qtbase introduced a regression where the tst_fusion test in qtqtuickcontrols2 hits a deadlock while trying to print a warning about a non-UTF-8 locale. The warning is due to the fact that the agent executed in Coin's VM does not have an explicit locale set, and thus it defaults to "C". There is no explicit locale set in any .bashrc (or similar files), and neither in any launchd configuration (because the agent is executed at macOS startup via launchd). The deadlock is due to trying to acquire the same lock twice while trying to write output to stdout. The test only deadlocks on CMake configurations, and not qmake configurations, because Coin has a hardcoded instruction to set the locale to UTF-8 when running qmake tests. Until the deadlock situation is addressed in another change, the issue can be fixed by setting the macOS configuration locale to UTF-8 explicitly, by assigning the LANG environment variable into ~/.bashrc at provisioning time, like we do with other environment variables like PATH. Fixes: COIN-578 Change-Id: Ib6a5849a6868c1776dd425aeb8b5e7d6faa8cde0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rwxr-xr-xcoin/provisioning/common/macos/set-locale.sh41
-rwxr-xr-xcoin/provisioning/qtci-macos-10.13-x86_64/97-set-locale.sh6
-rwxr-xr-xcoin/provisioning/qtci-macos-10.14-x86_64/97-set-locale.sh6
3 files changed, 53 insertions, 0 deletions
diff --git a/coin/provisioning/common/macos/set-locale.sh b/coin/provisioning/common/macos/set-locale.sh
new file mode 100755
index 00000000..b4a84522
--- /dev/null
+++ b/coin/provisioning/common/macos/set-locale.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Copyright (C) 2017 Pelagicore AG
+## Contact: http://www.qt.io/licensing/
+##
+## This file is part of the provisioning scripts of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:LGPL21$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see http://www.qt.io/terms-conditions. For further
+## information use the contact form at http://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 2.1 or version 3 as published by the Free
+## Software Foundation and appearing in the file LICENSE.LGPLv21 and
+## LICENSE.LGPLv3 included in the packaging of this file. Please review the
+## following information to ensure the GNU Lesser General Public License
+## requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+##
+## As a special exception, The Qt Company gives you certain additional
+## rights. These rights are described in The Qt Company LGPL Exception
+## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+# This script sets the macOS locale to UTF-8
+set -ex
+
+source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
+SetEnvVar "LANG" "en_US.UTF-8"
diff --git a/coin/provisioning/qtci-macos-10.13-x86_64/97-set-locale.sh b/coin/provisioning/qtci-macos-10.13-x86_64/97-set-locale.sh
new file mode 100755
index 00000000..e34b7381
--- /dev/null
+++ b/coin/provisioning/qtci-macos-10.13-x86_64/97-set-locale.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -ex
+
+BASEDIR=$(dirname "$0")
+$BASEDIR/../common/macos/set-locale.sh
diff --git a/coin/provisioning/qtci-macos-10.14-x86_64/97-set-locale.sh b/coin/provisioning/qtci-macos-10.14-x86_64/97-set-locale.sh
new file mode 100755
index 00000000..e34b7381
--- /dev/null
+++ b/coin/provisioning/qtci-macos-10.14-x86_64/97-set-locale.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -ex
+
+BASEDIR=$(dirname "$0")
+$BASEDIR/../common/macos/set-locale.sh