It's helpful to be able to temporarily disable environment variables, as
opposed to having to remove (and then re-add) them entirely.
Fixes: QTCREATORBUG-20984
Change-Id: Ib0d287035b9357507c4c19faaf3a1517382506b5
Reviewed-by: hjk <hjk@qt.io>
In contrast to Environment::searchInPath This function
returns _all_ executables found in the path variable.
Change-Id: Ic62b8f70d0690ff9a3261db3ead2c919a2486c89
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... from the environment.
Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Refactor much of the code from Environment* classes to NameValue* classes
to share it with the preprocessor macro settings.
Change-Id: Ica4ee817aa338230c422b30d91240d266248d226
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
For the command and the working directory.
Change-Id: Ia69dc7100aeb57bb6e1b35f4dd4f3cf3763d8cda
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Believe it or not, they exist :)
Git for Windows installs all its exectables as hardlinks for instance.
Logic copied from qfilesystemengine_{win,unix}.cpp in Qt.
This amends commit 118f713eb4.
Change-Id: Iafc64be4b2150378c7f9676fda0e01a43cd8b7cf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Add mechanism for registering environment providers, since just
registering the environment as a prefix variable in the macro expander
doesn't really fit the use case of using more than an individual
variable.
Project explorer registers providers for the current build and run
environments.
External tools can refer to a provider by id and then use that as base
environment.
Task-number: QTCREATORBUG-18394
Task-number: QTCREATORBUG-19892
Change-Id: I19fc4dfa8286b2f1e4679c6406f285dcc9514ba3
Reviewed-by: hjk <hjk@qt.io>
Those keys will cause trouble later, so do not allow them.
Change-Id: Ib2f51a469253d9df21c6a77faa47e6e88feadc07
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
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>
A empty path segment in LD_LIBRARY_PATH is *not* ignored and treated
as '.' IIRC.
So make sure to not leave a ':' in first place of LD_LIBRARY_PATH or set
an empty LD_LIBRARY_PATH on Linux.
Change-Id: I99ec2e333c6c0205334daf14ac6a2373c6e465ad
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If qmake uses /usr/bin/gcc and the kit is configured to use /usr/bin/gcc-7,
and both reference the same executable, there is no reason to warn.
Change-Id: Ida79fccb97cffb682c1d85d7fa8888d85bf7d6a4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Generates a bit less code in debug mode and is easier to read IMNSHO.
Change-Id: Ib9c0b9a0c058327facff16600a7014207167b050
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Match case of user changed environment variables to the
already defined variables.
Change-Id: Ic012d35faa0822df3523ab642491c9f19051853c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Paths are prepended, so the first one to be added is actually the last
search path.
On a debian machine with system-installed Qt and Qbs, if you execute Qtc
from another instance of Qtc with "Add build library search path" checked,
LD_LIBRARY_PATH has /usr/lib/x86_64-linux-gnu before $BUILD/lib/qtcreator.
This means that the system's Qbs lib will be loaded instead of the one in
RPATH, which is bad (i.e. qbs build fails because it cannot find
$BUILD/lib/x86_64-linux-gnu/qbs/qbs_processlauncher).
Change-Id: Ibe6778ba8a06da1680e034e31a8fee6d9a81c484
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
As LANGUAGE takes precedence on LC_MESSAGES variable sometimes
If LANG is not set to C now en locale really should be used for messages
by gcc. This fixes parsing of gcc header paths and error messages on non-
english locales
Change-Id: I96db16b555b8ff22b041b6e965558b342ef1a378
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Also change path() to use value() so that "Path" as used on Windows
will be found as well.
Task-number: QTCREATORBUG-18958
Change-Id: Ie930f6a6e71c76459cf9d089c225f5b1adf52433
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Extend operations to handle prepend/append which can be optionally
determined by diff(). This allows cleanly implementing
the MSVC toolchain setup.
Amends c7a84634fd
Change-Id: Ida08d8f5e00cf5f78c20ea8d08c531b1ed22c015
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Move duplication check into class and do not duplicate that.
Change-Id: I6fa34fb2e39d47432e87e959d1e5f44d21287bad
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
With this change, tools like Bullseye Coverage that wrap cl.exe are
disregarded. Only true MSVC installation folders are considered now,
which allows using Creator+Qbs with such tools again.
Task-number: QBS-1000
Change-Id: Ifb49b3c032359aa4ba1bc702de0dc3d30d3b6075
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The iterator needs to be tested against the end() of
the same container.
Change-Id: Ia4d208650d922d529ea074d4cd0eac9f4ac76b87
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
By using some of the infrastructure in Utils::Environment. Due to
wanting to find all cmake executables in PATH and not just the
first one, we need some custom code.
Change-Id: If3161d712b9f6e659450a3d0647f83344e68ba5d
Task-number: QTCREATORBUG-14740
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Benjamin Zeller <benjamin.zeller@canonical.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
The resulting diff contained all the items that were equal as well.
Since the function was unused so far, no real harm was done,
but the function would be useful to have in the debugger.
Change-Id: Ia0b0cea79cfc3ee5442aaf7bb392121590c0f338
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>