Fix passing environment to remote

After removing Runnable parameter from DeviceProcess::start()
(see 95c9579c58) we are now
setting the runnable's environment to the remote process
directly. This is now used in 2 places:

1. For forming the proper fullCommandLine(), so that
the passed environment is expanded to command line
arguments

2. For running the remote process itself.

Before the mentioned change these two environments were
separated (1st was taken from run environment aspect,
2nd was left with its default value - see SshProcess c'tor).
After the mentioned change 1 and 2 are equal (i.e. both are
env aspect). This affects running app in terminal,
as the aspect env is applied to the stub process, so it
can't start properly.

This change brings the separation back.

Amends 95c9579c58

Change-Id: I5efe82e19d3fb5608f97e56c2f4b7651643e156a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Jarek Kobus
2022-02-17 16:27:11 +01:00
parent 192bbb7618
commit 6360cffc80
6 changed files with 17 additions and 3 deletions

View File

@@ -99,7 +99,7 @@ QString LinuxDeviceProcess::fullCommandLine() const
if (!usesTerminal())
cmd.addArgs(QString("echo ") + pidMarker + "$$" + pidMarker + " && ", CommandLine::Raw);
const Environment &env = environment();
const Environment &env = remoteEnvironment();
for (auto it = env.constBegin(); it != env.constEnd(); ++it)
cmd.addArgs(env.key(it) + "='" + env.expandedValueForKey(env.key(it)) + '\'', CommandLine::Raw);