LazBuild: Prevent exception when dependent packages fail and prog is halted. Issue #32340.

git-svn-id: trunk@55748 -
This commit is contained in:
juha 2017-08-26 21:57:14 +00:00
parent b5cc5adcef
commit 8e28624ed6

View File

@ -785,25 +785,22 @@ var
// apply options // apply options
MainBuildBoss.SetBuildTargetProject1(true,smsfsSkip); MainBuildBoss.SetBuildTargetProject1(true,smsfsSkip);
if not SkipDependencies then begin try
if not SkipDependencies then
begin
// compile required packages // compile required packages
CheckPackageGraphForCompilation(nil,Project1.FirstRequiredDependency); CheckPackageGraphForCompilation(nil,Project1.FirstRequiredDependency);
PackageGraph.BeginUpdate(false); PackageGraph.BeginUpdate(false);
try // automatically compile required packages
// automatically compile required packages CompilePolicy:=pupAsNeeded;
CompilePolicy:=pupAsNeeded; if BuildRecursive and BuildAll then
if BuildRecursive and BuildAll then CompilePolicy:=pupOnRebuildingAll;
CompilePolicy:=pupOnRebuildingAll; if PackageGraph.CompileRequiredPackages(nil,
if PackageGraph.CompileRequiredPackages(nil, Project1.FirstRequiredDependency,
Project1.FirstRequiredDependency, not (pfUseDesignTimePackages in Project1.Flags),
not (pfUseDesignTimePackages in Project1.Flags), CompilePolicy)<>mrOk
CompilePolicy)<>mrOk then
then Error(ErrorBuildFailed,'Project dependencies of '+AFilename);
Error(ErrorBuildFailed,'Project dependencies of '+AFilename);
finally
PackageGraph.EndUpdate;
end;
end; end;
WorkingDir:=Project1.Directory; WorkingDir:=Project1.Directory;
@ -895,6 +892,10 @@ var
// no need to check for mrOk, we are exit if it wasn't // no need to check for mrOk, we are exit if it wasn't
Result:=true; Result:=true;
finally
if not SkipDependencies then
PackageGraph.EndUpdate;
end;
end; end;
begin begin