summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-08-09 11:31:41 +0200
committerEike Ziller <eike.ziller@qt.io>2018-08-21 08:48:21 +0000
commitd35638df56b741bc7bc3cac228075040cdd8a931 (patch)
tree01941b6bae22b931f180cb224c397ae540d9cfee /bin
parent2c0554c187adb4ef886affd193b8149afa199d13 (diff)
downloadqt-creator-d35638df56b741bc7bc3cac228075040cdd8a931.tar.gz
Do not modify environment for user applications
We used to set QT_OPENGL, currently set LD_LIBRARY_PATH when qtcreator.sh is used, and might set other variables in the future, but these environment modifications should not be passed on to user applications or when we run tools that are not shipped with Qt Creator. For LD_LIBRARY_PATH there already was a hack for Environment::systemEnvironment. For environment variables that we might set in main() in the future, this patch caches the system environment for Environment::systemEnvironment early before any modifications are made. The previous hack for LD_LIBRARY_PATH no longer works, since it used QCoreApplication::applicationDirPath() which cannot be used at that point in time (before the QApplication has been created). Instead pass the correct user LD_LIBRARY_PATH directly from qtcreator.sh to Qt Creator through a command line option, which is cleaner anyhow. Task-number: QTCREATORBUG-20808 Change-Id: I6674a5e0537e1b37fd7dcbff371b542fa24bce69 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/qtcreator.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/qtcreator.sh b/bin/qtcreator.sh
index 80fc4499c9..86826f1e3b 100755
--- a/bin/qtcreator.sh
+++ b/bin/qtcreator.sh
@@ -39,6 +39,7 @@ if test -d "$qtlibdir"; then
qtlibpath=:$qtlibdir
fi
# Add Qt Creator library path
+_ORIGINAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$libdir:$libdir/qtcreator$qtlibpath${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
-exec "$bindir/qtcreator" ${1+"$@"}
+exec "$bindir/qtcreator" -user-library-path "$_ORIGINAL_LD_LIBRARY_PATH" ${1+"$@"}