From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.7539.1620701872708018239 for ; Mon, 10 May 2021 19:57:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 11 May 2021 10:57:46 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , "'Feng, Bob C'" References: In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gRFNDIFBPU1RCVUlMRCBwcm9ibGVtL3F1ZXN0aW9u?= Date: Tue, 11 May 2021 10:57:45 +0800 Message-ID: <008401d74611$6b8537c0$428fa740$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHWvcMrlsh20c6Mn2YU1MUOuqnIkarepomA Content-Type: multipart/alternative; boundary="----=_NextPart_000_0085_01D74654.79A98930" Content-Language: zh-cn ------=_NextPart_000_0085_01D74654.79A98930 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Garrett: I agree build should return error code reported from post build fail. Seemly, current logic doesn=A1=AFt handle the failure case. =20 Thanks Liming =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Kirkendall, Garrett =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA5=D4=C211=C8=D5 4:05 =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io =D6=F7=CC=E2: [edk2-devel] DSC POSTBUILD problem/question =20 I'm checking out the PREBUILD and POSTBUILD option in a DSC. I can launch my scripts, etc. =20 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 th= e end of Main. "Conclusion" is updated though to indicate a failure. Any ideas? I assume build.py should return non-zero if POSTBUILD fails. =20 =20 =20 =20 >>From end of edk-stable202011build.py:Main() =20 if ReturnCode =3D=3D 0: try: MyBuild.LaunchPostbuild() Conclusion =3D "Done" except: Conclusion =3D "Failed" elif ReturnCode =3D=3D ABORT_ERROR: Conclusion =3D "Aborted" else: Conclusion =3D "Failed" FinishTime =3D time.time() BuildDuration =3D time.gmtime(int(round(FinishTime - StartTime))) BuildDurationStr =3D "" if BuildDuration.tm_yday > 1: BuildDurationStr =3D time.strftime("%H:%M:%S", BuildDuration) + ",= %d day(s)" % (BuildDuration.tm_yday - 1) else: BuildDurationStr =3D time.strftime("%H:%M:%S", BuildDuration) if MyBuild is not None: if not BuildError: MyBuild.BuildReport.GenerateReport(BuildDurationStr, LogBuildTime(MyBuild.AutoGenTime), LogBuildTime(MyBuild.MakeTime), LogBuildTime(MyBuild.GenFdsTime)) =20 EdkLogger.SetLevel(EdkLogger.QUIET) EdkLogger.quiet("\n- %s -" % Conclusion) EdkLogger.quiet(time.strftime("Build end time: %H:%M:%S, %b.%d %Y", time.localtime())) EdkLogger.quiet("Build total time: %s\n" % BuildDurationStr) Log_Agent.kill() Log_Agent.join() return ReturnCode =20 master is the same code: https://github.com/tianocore/edk2/blob/master/BaseTools/Source/Python/buil= d/ build.py#L2738 =20 =20 Garrett Kirkendall SMTS Firmware Engineer 7171 Southwest Parkway, Austin, TX 78735 USA=20 AMD facebook | amd.com =20 ------=_NextPart_000_0085_01D74654.79A98930 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

Garrett:

 I agree b= uild should return error code reported from post build fail. Seemly, curren= t logic doesn=A1=AFt handle the failure case.

 

Thanks

=

Liming

=B7=A2=BC=FE=C8=CB: de= vel@edk2.groups.io <devel@edk2.groups.io> =B4=FA=B1=ED Kirkendall, Garrett
=B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA5=D4=C211=C8=D5 4:05
=CA=D5=BC=FE= = =C8=CB: devel@edk2.groups= .io
=D6=F7=CC=E2: [edk2-devel] DSC POSTBUILD problem/question

 

I'm checking out the PREBUIL= D and POSTBUILD option in a DSC.  I can launch my scripts, etc.

 

When there is a POSTBUILD e= rror,  build.py properly says the build failed, but build.py is still = returning 0 (success).  MyBuild.LaunchPostBuild() execution does not l= ook like it affects ReturnCode which is returned at the end of Main.  = "Conclusion" is updated though to indicate a failure.  Any i= deas?  I assume build.py should return non-zero if POSTBUILD fails.

 

 

 

 

From end of edk-stable202011build.py:Main(= )

 <= /o:p>

    if ReturnCode =3D=3D 0:

        try:

     &nb= sp;      Conclusion =3D "Done"

        except:<= /span>

          &nbs= p; Conclusion =3D "Failed"

  &nbs= p; elif ReturnCode =3D=3D ABORT_ERROR:

  &n= bsp;     Conclusion =3D "Aborted"<= /span>

    else:

   = ;     Conclusion =3D "Failed"

    FinishTime =3D time.time()

<= p class=3DMsoNormal>=     BuildDuration =3D time.gmtime(int(round(FinishTime - Sta= rtTime)))

    BuildDurationStr =3D &qu= ot;"

    if BuildDuration.tm_yday= > 1:

        = BuildDurationStr =3D time.strftime("%H:%M:%S", BuildDuration) + &= quot;, %d day(s)" % (BuildDuration.tm_yday - 1)

<= p class=3DMsoNormal>=     else:

    &nbs= p;   BuildDurationStr =3D time.strftime("%H:%M:%S", Bui= ldDuration)

    if MyBuild is not None= :

        if not B= uildError:

       =      MyBuild.BuildReport.GenerateReport(BuildDurationSt= r, LogBuildTime(MyBuild.AutoGenTime), LogBuildTime(MyBuild.MakeTime), LogBu= ildTime(MyBuild.GenFdsTime))

 =

    EdkLogger.SetLevel(EdkLogger.QUIET)

    EdkLogger.quiet("\n- %s -" % Conclusion= )

    EdkLogger.quiet(time.strftime(&q= uot;Build end time: %H:%M:%S, %b.%d %Y", time.localtime()))=

    EdkLogger.quiet("Build total time: %s\n= " % BuildDurationStr)

    Log_Age= nt.kill()

    Log_Agent.join()

    return ReturnCode

 

master is the same code:=

htt= ps://github.com/tianocore/edk2/blob/master/BaseTools/Source/Python/build/bu= ild.py#L2738

 

 

Garrett Kirkendall
SMTS Firmware Engine= er
7171 Southwest Parkway, Austin, TX 78735 USA
AMD   facebook  |  amd.com

 

=

------=_NextPart_000_0085_01D74654.79A98930--