summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2012-11-17 16:38:23 +0100
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-05-11 10:21:22 +0000
commit98a33f71e75047a529b32f3c95b9fd479873371d (patch)
tree1c41fbfec31c83310affebad311275500295d894
parent214225030ef45d3a3e04f92ab41fed62b73f6c8f (diff)
remove sub-make blocking code
It never really worked as intended and will be replaced by something new, something good in the next commit. Change-Id: I6046116a973b9090e1e94ed4fe873e97e352d4ae Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
-rw-r--r--src/jomlib/commandexecutor.cpp29
-rw-r--r--src/jomlib/commandexecutor.h5
-rw-r--r--src/jomlib/targetexecutor.cpp33
-rw-r--r--src/jomlib/targetexecutor.h2
4 files changed, 2 insertions, 67 deletions
diff --git a/src/jomlib/commandexecutor.cpp b/src/jomlib/commandexecutor.cpp
index 7ec6d0a..f007e18 100644
--- a/src/jomlib/commandexecutor.cpp
+++ b/src/jomlib/commandexecutor.cpp
@@ -38,8 +38,6 @@ QString CommandExecutor::m_tempPath;
CommandExecutor::CommandExecutor(QObject* parent, const ProcessEnvironment &environment)
: QObject(parent),
m_pTarget(0),
- m_blocked(false),
- m_processFinishedWhileBlocked(false),
m_ignoreProcessErrors(false),
m_active(false)
{
@@ -86,22 +84,6 @@ void CommandExecutor::start(DescriptionBlock* target)
executeCurrentCommandLine();
}
-void CommandExecutor::block()
-{
- m_blocked = true;
-}
-
-void CommandExecutor::unblock()
-{
- if (m_blocked) {
- m_blocked = false;
- if (m_processFinishedWhileBlocked) {
- m_processFinishedWhileBlocked = false;
- onProcessFinished(m_process.exitCode(), m_process.exitStatus());
- }
- }
-}
-
void CommandExecutor::onProcessError(Process::ProcessError error)
{
//qDebug() << "onProcessError" << error;
@@ -112,11 +94,6 @@ void CommandExecutor::onProcessError(Process::ProcessError error)
void CommandExecutor::onProcessFinished(int exitCode, Process::ExitStatus exitStatus)
{
//qDebug() << "onProcessFinished" << m_pTarget->m_targetName;
- if (m_blocked) {
- m_processFinishedWhileBlocked = true;
- return;
- }
-
if (exitStatus != Process::NormalExit)
exitCode = 2;
@@ -170,11 +147,8 @@ static bool startsWithShellBuiltin(const QString &commandLine)
void CommandExecutor::executeCurrentCommandLine()
{
- m_processFinishedWhileBlocked = false;
const Command& cmd = m_pTarget->m_commands.at(m_currentCommandIdx);
QString commandLine = cmd.m_commandLine;
- int jomCallIdx = commandLine.indexOf(m_pTarget->makefile()->options()->fullAppPath);
- bool spawnJOM = (jomCallIdx >= 0);
if (m_pTarget->makefile()->options()->dryRun
|| (!cmd.m_silent && !m_pTarget->makefile()->options()->suppressExecutedCommandsDisplay))
@@ -230,9 +204,6 @@ void CommandExecutor::executeCurrentCommandLine()
}
}
- if (spawnJOM)
- emit subJomStarted();
-
bool executionSucceeded = false;
if (simpleCmdLine && !startsWithShellBuiltin(commandLine)) {
// ### It would be cool if we would not try to start every command directly.
diff --git a/src/jomlib/commandexecutor.h b/src/jomlib/commandexecutor.h
index 99f5791..22bce72 100644
--- a/src/jomlib/commandexecutor.h
+++ b/src/jomlib/commandexecutor.h
@@ -41,8 +41,6 @@ public:
void start(DescriptionBlock* target);
DescriptionBlock* target() { return m_pTarget; }
- void block();
- void unblock();
bool isActive() const { return m_active; }
void waitForFinished();
void cleanupTempFiles();
@@ -55,7 +53,6 @@ public slots:
signals:
void environmentChanged(const ProcessEnvironment &environment);
void finished(CommandExecutor* process, bool abortMakeProcess);
- void subJomStarted();
private slots:
void onProcessError(Process::ProcessError error);
@@ -76,8 +73,6 @@ private:
static QString m_tempPath;
Process m_process;
DescriptionBlock* m_pTarget;
- bool m_blocked;
- bool m_processFinishedWhileBlocked;
struct TempFile
{
diff --git a/src/jomlib/targetexecutor.cpp b/src/jomlib/targetexecutor.cpp
index 3dffe95..3ea3f04 100644
--- a/src/jomlib/targetexecutor.cpp
+++ b/src/jomlib/targetexecutor.cpp
@@ -32,7 +32,6 @@ namespace NMakeFile {
TargetExecutor::TargetExecutor(const ProcessEnvironment &environment)
: m_bAborted(false),
- m_blockingCommand(0),
m_allCommandsSuccessfullyExecuted(true)
{
m_makefile = 0;
@@ -42,7 +41,6 @@ TargetExecutor::TargetExecutor(const ProcessEnvironment &environment)
CommandExecutor* process = new CommandExecutor(this, environment);
if (i == 0) process->setBufferedOutput(false);
connect(process, SIGNAL(finished(CommandExecutor*, bool)), this, SLOT(onChildFinished(CommandExecutor*, bool)));
- connect(process, SIGNAL(subJomStarted()), this, SLOT(onSubJomStarted()));
m_availableProcesses.append(process);
m_processes.append(process);
}
@@ -67,7 +65,6 @@ bool TargetExecutor::hasPendingTargets() const
void TargetExecutor::apply(Makefile* mkfile, const QStringList& targets)
{
m_bAborted = false;
- m_blockingCommand = 0;
m_allCommandsSuccessfullyExecuted = true;
m_makefile = mkfile;
@@ -101,7 +98,7 @@ void TargetExecutor::apply(Makefile* mkfile, const QStringList& targets)
void TargetExecutor::startProcesses()
{
- if (m_bAborted || m_blockingCommand)
+ if (m_bAborted)
return;
try {
@@ -116,7 +113,7 @@ void TargetExecutor::startProcesses()
CommandExecutor* process = m_availableProcesses.takeFirst();
process->start(nextTarget);
- if (m_bAborted || m_blockingCommand)
+ if (m_bAborted)
return;
}
@@ -156,25 +153,6 @@ void TargetExecutor::finishBuild(int exitCode)
emit finished(exitCode);
}
-void TargetExecutor::onSubJomStarted()
-{
- //qDebug() << "BLOCK" << QCoreApplication::applicationPid();
-
- // Set the blocking sub jom command to direct output mode.
- CommandExecutor *subJomCmd = qobject_cast<CommandExecutor*>(sender());
- if (subJomCmd->isBufferedOutputSet()) {
- foreach (CommandExecutor *cmdex, m_processes)
- if (!cmdex->isBufferedOutputSet())
- cmdex->setBufferedOutput(true);
- subJomCmd->setBufferedOutput(false);
- }
-
- m_blockingCommand = subJomCmd;
- foreach (CommandExecutor *cmdex, m_processes)
- if (cmdex != subJomCmd)
- cmdex->block();
-}
-
void TargetExecutor::onChildFinished(CommandExecutor* executor, bool commandFailed)
{
Q_CHECK_PTR(executor->target());
@@ -198,13 +176,6 @@ void TargetExecutor::onChildFinished(CommandExecutor* executor, bool commandFail
m_allCommandsSuccessfullyExecuted = false;
bool abortMakeProcess = commandFailed && !m_makefile->options()->buildUnrelatedTargetsOnError;
- if (!abortMakeProcess && m_blockingCommand && m_blockingCommand == executor) {
- //qDebug() << "UNBLOCK" << QCoreApplication::applicationPid();
- m_blockingCommand = 0;
- foreach (CommandExecutor *cmdex, m_processes)
- cmdex->unblock();
- }
-
if (abortMakeProcess) {
m_bAborted = true;
m_depgraph->clear();
diff --git a/src/jomlib/targetexecutor.h b/src/jomlib/targetexecutor.h
index e1b75fc..7f61f2b 100644
--- a/src/jomlib/targetexecutor.h
+++ b/src/jomlib/targetexecutor.h
@@ -51,7 +51,6 @@ public slots:
void startProcesses();
private slots:
- void onSubJomStarted();
void onChildFinished(CommandExecutor*, bool commandFailed);
private:
@@ -63,7 +62,6 @@ private:
DependencyGraph* m_depgraph;
QList<DescriptionBlock*> m_pendingTargets;
bool m_bAborted;
- QObject *m_blockingCommand;
QList<CommandExecutor*> m_availableProcesses;
QList<CommandExecutor*> m_processes;
bool m_allCommandsSuccessfullyExecuted;