|
@@ -1682,8 +1682,6 @@ ResourceString
|
|
SWarnStartCompilingPackage = 'Start compiling package %s for target %s.';
|
|
SWarnStartCompilingPackage = 'Start compiling package %s for target %s.';
|
|
SWarnCompilingPackagecompleteProgress = '[%3.0f%%] Compiled package %s';
|
|
SWarnCompilingPackagecompleteProgress = '[%3.0f%%] Compiled package %s';
|
|
SWarnCompilingPackagecomplete = 'Compiled package %s';
|
|
SWarnCompilingPackagecomplete = 'Compiled package %s';
|
|
- SWarnSkipPackageTargetProgress = '[%3.0f%%] Skipped package %s which has been disabled for target %s';
|
|
|
|
- SWarnSkipPackageTarget = 'Skipped package %s which has been disabled for target %s';
|
|
|
|
SWarnInstallationPackagecomplete = 'Installation package %s for target %s succeeded';
|
|
SWarnInstallationPackagecomplete = 'Installation package %s for target %s succeeded';
|
|
SWarnCanNotGetAccessRights = 'Warning: Failed to copy access-rights from file %s';
|
|
SWarnCanNotGetAccessRights = 'Warning: Failed to copy access-rights from file %s';
|
|
SWarnCanNotSetAccessRights = 'Warning: Failed to copy access-rights to file %s';
|
|
SWarnCanNotSetAccessRights = 'Warning: Failed to copy access-rights to file %s';
|
|
@@ -1699,6 +1697,8 @@ ResourceString
|
|
SWarnRemovedNonEmptyDirectory = 'Warning: Removed non empty directory "%s"';
|
|
SWarnRemovedNonEmptyDirectory = 'Warning: Removed non empty directory "%s"';
|
|
|
|
|
|
SInfoPackageAlreadyProcessed = 'Package %s is already processed';
|
|
SInfoPackageAlreadyProcessed = 'Package %s is already processed';
|
|
|
|
+ SInfoSkipPackageTargetProgress = '[%3.0f%%] Skipped package %s which has been disabled for target %s';
|
|
|
|
+ SInfoSkipPackageTarget = 'Skipped package %s which has been disabled for target %s';
|
|
SInfoCompilingTarget = 'Compiling target %s';
|
|
SInfoCompilingTarget = 'Compiling target %s';
|
|
SInfoExecutingCommand = 'Executing command "%s %s"';
|
|
SInfoExecutingCommand = 'Executing command "%s %s"';
|
|
SInfoCreatingOutputDir = 'Creating output dir "%s"';
|
|
SInfoCreatingOutputDir = 'Creating output dir "%s"';
|
|
@@ -8158,7 +8158,7 @@ procedure TBuildEngine.Compile(Packages: TPackages);
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
inc(FProgressCount);
|
|
inc(FProgressCount);
|
|
- log(vlWarning,SWarnSkipPackageTargetProgress,[(FProgressCount)/FProgressMax * 100, APackage.Name, Defaults.Target]);
|
|
|
|
|
|
+ log(vlInfo,SInfoSkipPackageTargetProgress,[(FProgressCount)/FProgressMax * 100, APackage.Name, Defaults.Target]);
|
|
APackage.FTargetState:=tsNoCompile;
|
|
APackage.FTargetState:=tsNoCompile;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -8167,7 +8167,7 @@ procedure TBuildEngine.Compile(Packages: TPackages);
|
|
Var
|
|
Var
|
|
I : integer;
|
|
I : integer;
|
|
{$ifndef NO_THREADING}
|
|
{$ifndef NO_THREADING}
|
|
- Thr : Integer;
|
|
|
|
|
|
+ Thr, ThreadCount : Integer;
|
|
Finished : boolean;
|
|
Finished : boolean;
|
|
ErrorState: boolean;
|
|
ErrorState: boolean;
|
|
ErrorMessage: string;
|
|
ErrorMessage: string;
|
|
@@ -8197,7 +8197,7 @@ Var
|
|
else // A problem occurred, stop the compilation
|
|
else // A problem occurred, stop the compilation
|
|
begin
|
|
begin
|
|
ErrorState:=true;
|
|
ErrorState:=true;
|
|
- ErrorMessage:=AThread.ErrorMessage;
|
|
|
|
|
|
+ ErrorMessage:='Error inside worker thread for package '+Athread.APackage.Name+': '+AThread.ErrorMessage;
|
|
Finished:=true;
|
|
Finished:=true;
|
|
end;
|
|
end;
|
|
AThread.APackage := nil;
|
|
AThread.APackage := nil;
|
|
@@ -8251,7 +8251,7 @@ begin
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
inc(FProgressCount);
|
|
inc(FProgressCount);
|
|
- log(vlWarning,SWarnSkipPackageTargetProgress,[(FProgressCount)/FProgressMax * 100, P.Name, Defaults.Target]);
|
|
|
|
|
|
+ log(vlInfo,SInfoSkipPackageTargetProgress,[(FProgressCount)/FProgressMax * 100, P.Name, Defaults.Target]);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end
|
|
end
|
|
@@ -8262,34 +8262,71 @@ begin
|
|
ErrorState := False;
|
|
ErrorState := False;
|
|
Finished := False;
|
|
Finished := False;
|
|
I := 0;
|
|
I := 0;
|
|
|
|
+ ThreadCount:=0;
|
|
// This event is set by the worker-threads to notify the main/this thread
|
|
// This event is set by the worker-threads to notify the main/this thread
|
|
// that a package finished it's task.
|
|
// that a package finished it's task.
|
|
NotifyThreadWaiting := RTLEventCreate;
|
|
NotifyThreadWaiting := RTLEventCreate;
|
|
SetLength(Threads,Defaults.ThreadsAmount);
|
|
SetLength(Threads,Defaults.ThreadsAmount);
|
|
- // Create all worker-threads
|
|
|
|
- for Thr:=0 to Defaults.ThreadsAmount-1 do
|
|
|
|
- Threads[Thr] := TCompileWorkerThread.Create(self,NotifyThreadWaiting);
|
|
|
|
- try
|
|
|
|
- // When a thread notifies this thread that it is ready, loop on all
|
|
|
|
- // threads to check their state and if possible assign a new package
|
|
|
|
- // to them to compile.
|
|
|
|
- while not Finished do
|
|
|
|
- begin
|
|
|
|
- RTLeventWaitFor(NotifyThreadWaiting);
|
|
|
|
- for Thr:=0 to Defaults.ThreadsAmount-1 do if not Finished then
|
|
|
|
- ProcessThreadResult(Threads[Thr]);
|
|
|
|
- end;
|
|
|
|
- // Compilation finished or aborted. Wait for all threads to end.
|
|
|
|
- for thr:=0 to Defaults.ThreadsAmount-1 do
|
|
|
|
- begin
|
|
|
|
- Threads[Thr].Terminate;
|
|
|
|
- RTLeventSetEvent(Threads[Thr].NotifyStartTask);
|
|
|
|
- Threads[Thr].WaitFor;
|
|
|
|
- end;
|
|
|
|
|
|
+ try
|
|
|
|
+ // Create all worker-threads
|
|
|
|
+ try
|
|
|
|
+ for Thr:=0 to Defaults.ThreadsAmount-1 do
|
|
|
|
+ begin
|
|
|
|
+ Threads[Thr] := TCompileWorkerThread.Create(self,NotifyThreadWaiting);
|
|
|
|
+ if assigned(Threads[Thr]) then
|
|
|
|
+ inc(ThreadCount);
|
|
|
|
+ end;
|
|
|
|
+ except
|
|
|
|
+ on E: Exception do
|
|
|
|
+ begin
|
|
|
|
+ ErrorMessage := E.Message;
|
|
|
|
+ ErrorState:=true;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+ try
|
|
|
|
+ // When a thread notifies this thread that it is ready, loop on all
|
|
|
|
+ // threads to check their state and if possible assign a new package
|
|
|
|
+ // to them to compile.
|
|
|
|
+ while not Finished do
|
|
|
|
+ begin
|
|
|
|
+ RTLeventWaitFor(NotifyThreadWaiting);
|
|
|
|
+ for Thr:=0 to Defaults.ThreadsAmount-1 do
|
|
|
|
+ if assigned(Threads[Thr]) and not Finished then
|
|
|
|
+ ProcessThreadResult(Threads[Thr]);
|
|
|
|
+ end;
|
|
|
|
+ except
|
|
|
|
+ on E: Exception do
|
|
|
|
+ begin
|
|
|
|
+ if not ErrorState then
|
|
|
|
+ ErrorMessage := E.Message;
|
|
|
|
+ ErrorState:=true;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+ try
|
|
|
|
+ // Compilation finished or aborted. Wait for all threads to end.
|
|
|
|
+ for thr:=0 to Defaults.ThreadsAmount-1 do
|
|
|
|
+ if assigned(Threads[Thr]) then
|
|
|
|
+ begin
|
|
|
|
+ Threads[Thr].Terminate;
|
|
|
|
+ RTLeventSetEvent(Threads[Thr].NotifyStartTask);
|
|
|
|
+ Threads[Thr].WaitFor;
|
|
|
|
+ end;
|
|
|
|
+ except
|
|
|
|
+ on E: Exception do
|
|
|
|
+ begin
|
|
|
|
+ if not ErrorState then
|
|
|
|
+ ErrorMessage := E.Message;
|
|
|
|
+ ErrorState:=true;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
finally
|
|
finally
|
|
RTLeventdestroy(NotifyThreadWaiting);
|
|
RTLeventdestroy(NotifyThreadWaiting);
|
|
for thr:=0 to Defaults.ThreadsAmount-1 do
|
|
for thr:=0 to Defaults.ThreadsAmount-1 do
|
|
- Threads[Thr].Free;
|
|
|
|
|
|
+ if assigned(Threads[Thr]) then
|
|
|
|
+ begin
|
|
|
|
+ Threads[Thr].Free;
|
|
|
|
+ dec(ThreadCount);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
if ErrorState then
|
|
if ErrorState then
|
|
raise Exception.Create(ErrorMessage);
|
|
raise Exception.Create(ErrorMessage);
|
|
@@ -8314,7 +8351,7 @@ begin
|
|
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
|
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- log(vlWarning,SWarnSkipPackageTarget,[P.Name, Defaults.Target]);
|
|
|
|
|
|
+ log(vlInfo,SInfoSkipPackageTarget,[P.Name, Defaults.Target]);
|
|
end;
|
|
end;
|
|
NotifyEventCollection.CallEvents(neaAfterInstall, Self);
|
|
NotifyEventCollection.CallEvents(neaAfterInstall, Self);
|
|
end;
|
|
end;
|
|
@@ -8343,7 +8380,7 @@ begin
|
|
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
|
log(vlWarning, SWarnInstallationPackagecomplete, [P.Name, Defaults.Target]);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- log(vlWarning,SWarnSkipPackageTarget,[P.Name, Defaults.Target]);
|
|
|
|
|
|
+ log(vlInfo,SInfoSkipPackageTarget,[P.Name, Defaults.Target]);
|
|
end;
|
|
end;
|
|
finally
|
|
finally
|
|
FinishArchive(P);
|
|
FinishArchive(P);
|