<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:DengXian;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>Garrett:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>  I agree build should return error code reported from post build fail. Seemly, current logic doesn’t handle the failure case.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>Liming<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-family:DengXian'>发件人<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-family:DengXian'> devel@edk2.groups.io <devel@edk2.groups.io> </span><b><span style='font-family:DengXian'>代表 </span></b><span lang=EN-US style='font-family:DengXian'>Kirkendall, Garrett<br></span><b><span style='font-family:DengXian'>发送时间<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-family:DengXian'> 2021</span><span style='font-family:DengXian'>年<span lang=EN-US>5</span>月<span lang=EN-US>11</span>日<span lang=EN-US> 4:05<br></span><b>收件人<span lang=EN-US>:</span></b><span lang=EN-US> devel@edk2.groups.io<br></span><b>主题<span lang=EN-US>:</span></b><span lang=EN-US> [edk2-devel] DSC POSTBUILD problem/question<o:p></o:p></span></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I'm checking out the PREBUILD and POSTBUILD option in a DSC.  I can launch my scripts, etc.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>When there is a POSTBUILD error,  build.py properly says the build failed, but build.py is still returning 0 (success).  MyBuild.LaunchPostBuild() execution does not look like it affects ReturnCode which is returned at the end of Main.  "Conclusion" is updated though to indicate a failure.  Any ideas?  I assume build.py should return non-zero if POSTBUILD fails.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>From end of edk-stable202011build.py:Main()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    if ReturnCode == 0:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        try:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>            MyBuild.LaunchPostbuild()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>            Conclusion = "Done"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        except:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>            Conclusion = "Failed"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    elif ReturnCode == ABORT_ERROR:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        Conclusion = "Aborted"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    else:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        Conclusion = "Failed"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    FinishTime = time.time()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    BuildDuration = time.gmtime(int(round(FinishTime - StartTime)))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    BuildDurationStr = ""<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    if BuildDuration.tm_yday > 1:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        BuildDurationStr = time.strftime("%H:%M:%S", BuildDuration) + ", %d day(s)" % (BuildDuration.tm_yday - 1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    else:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        BuildDurationStr = time.strftime("%H:%M:%S", BuildDuration)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    if MyBuild is not None:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>        if not BuildError:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>            MyBuild.BuildReport.GenerateReport(BuildDurationStr, LogBuildTime(MyBuild.AutoGenTime), LogBuildTime(MyBuild.MakeTime), LogBuildTime(MyBuild.GenFdsTime))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    EdkLogger.SetLevel(EdkLogger.QUIET)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    EdkLogger.quiet("\n- %s -" % Conclusion)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    EdkLogger.quiet(time.strftime("Build end time: %H:%M:%S, %b.%d %Y", time.localtime()))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    EdkLogger.quiet("Build total time: %s\n" % BuildDurationStr)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    Log_Agent.kill()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    Log_Agent.join()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:"Courier New"'>    return ReturnCode<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>master is the same code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="https://github.com/tianocore/edk2/blob/master/BaseTools/Source/Python/build/build.py#L2738">https://github.com/tianocore/edk2/blob/master/BaseTools/Source/Python/build/build.py#L2738</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='color:black;text-transform:uppercase'>Garrett Kirkendall</span></b><span lang=EN-US style='font-size:10.0pt;color:black'><br>SMTS Firmware Engineer<br>7171 Southwest Parkway, Austin, TX 78735 USA <br></span><b><span lang=EN-US style='font-size:14.0pt;color:black'>AMD</span></b><span lang=EN-US style='font-size:10.0pt;color:black'>   </span><span lang=EN-US><a href="https://www.facebook.com/AMD"><span style='font-size:10.0pt;color:#7030A0'>facebook</span></a></span><span lang=EN-US style='font-size:10.0pt;color:#7030A0'>  |  </span><span lang=EN-US><a href="http://www.amd.com/"><span style='font-size:10.0pt;color:#7030A0'>amd.com</span></a><span style='color:black'><o:p></o:p></span></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal></o:p></span></p></div></div></body></html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/74935">View/Reply Online (#74935)</a> |    |  <a target="_blank" href="https://groups.io/mt/82738004/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>