public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
@ 2020-05-09  2:22 Michael Kubacki
  2020-05-13  2:15 ` Bob Feng
  2020-05-14  7:18 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Kubacki @ 2020-05-09  2:22 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707

Ecc fails with Python 3.8 because it uses the deprecated time.clock()
function - https://docs.python.org/3.7/library/time.html#time.clock

This change updates EccMain.py to use time.perf_counter().

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py
index 560bb9fd7a31..72edbea3b883 100644
--- a/BaseTools/Source/Python/Ecc/EccMain.py
+++ b/BaseTools/Source/Python/Ecc/EccMain.py
@@ -2,6 +2,7 @@
 # This file is used to be the main entrance of ECC tool
 #
 # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) Microsoft Corporation.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
@@ -406,9 +407,9 @@ if __name__ == '__main__':
     EdkLogger.Initialize()
     EdkLogger.IsRaiseError = False
 
-    StartTime = time.clock()
+    StartTime = time.perf_counter()
     Ecc = Ecc()
-    FinishTime = time.clock()
+    FinishTime = time.perf_counter()
 
     BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
     EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
-- 
2.16.3.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
  2020-05-09  2:22 [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock() Michael Kubacki
@ 2020-05-13  2:15 ` Bob Feng
  2020-05-14  7:37   ` [edk2-devel] " Philippe Mathieu-Daudé
  2020-05-14  7:18 ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 7+ messages in thread
From: Bob Feng @ 2020-05-13  2:15 UTC (permalink / raw)
  To: michael.kubacki@outlook.com, devel@edk2.groups.io; +Cc: Gao, Liming

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: michael.kubacki@outlook.com <michael.kubacki@outlook.com> 
Sent: Saturday, May 9, 2020 10:23 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()

From: Michael Kubacki <michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707

Ecc fails with Python 3.8 because it uses the deprecated time.clock() function - https://docs.python.org/3.7/library/time.html#time.clock

This change updates EccMain.py to use time.perf_counter().

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py
index 560bb9fd7a31..72edbea3b883 100644
--- a/BaseTools/Source/Python/Ecc/EccMain.py
+++ b/BaseTools/Source/Python/Ecc/EccMain.py
@@ -2,6 +2,7 @@
 # This file is used to be the main entrance of ECC tool  #  # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) Microsoft Corporation.<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #
 
@@ -406,9 +407,9 @@ if __name__ == '__main__':
     EdkLogger.Initialize()
     EdkLogger.IsRaiseError = False
 
-    StartTime = time.clock()
+    StartTime = time.perf_counter()
     Ecc = Ecc()
-    FinishTime = time.clock()
+    FinishTime = time.perf_counter()
 
     BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
     EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
--
2.16.3.windows.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
  2020-05-09  2:22 [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock() Michael Kubacki
  2020-05-13  2:15 ` Bob Feng
@ 2020-05-14  7:18 ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-14  7:18 UTC (permalink / raw)
  To: devel, michael.kubacki; +Cc: Bob Feng, Liming Gao

Hi Michael,

On 5/9/20 4:22 AM, Michael Kubacki wrote:
> From: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707
> 
> Ecc fails with Python 3.8 because it uses the deprecated time.clock()
> function - https://docs.python.org/3.7/library/time.html#time.clock
> 
> This change updates EccMain.py to use time.perf_counter().
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
>   BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py
> index 560bb9fd7a31..72edbea3b883 100644
> --- a/BaseTools/Source/Python/Ecc/EccMain.py
> +++ b/BaseTools/Source/Python/Ecc/EccMain.py
> @@ -2,6 +2,7 @@
>   # This file is used to be the main entrance of ECC tool
>   #
>   # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) Microsoft Corporation.<BR>

You forgot the year: 2020.

With it updated:
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>

>   # SPDX-License-Identifier: BSD-2-Clause-Patent
>   #
>   
> @@ -406,9 +407,9 @@ if __name__ == '__main__':
>       EdkLogger.Initialize()
>       EdkLogger.IsRaiseError = False
>   
> -    StartTime = time.clock()
> +    StartTime = time.perf_counter()
>       Ecc = Ecc()
> -    FinishTime = time.clock()
> +    FinishTime = time.perf_counter()
>   
>       BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
>       EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
  2020-05-13  2:15 ` Bob Feng
@ 2020-05-14  7:37   ` Philippe Mathieu-Daudé
  2020-05-14  8:18     ` Michael Kubacki
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-14  7:37 UTC (permalink / raw)
  To: devel, bob.c.feng, michael.kubacki@outlook.com
  Cc: Gao, Liming, Michael D Kinney, Laszlo Ersek

+Michael & Laszlo.

On 5/13/20 4:15 AM, Bob Feng wrote:
> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
> 
> -----Original Message-----
> From: michael.kubacki@outlook.com <michael.kubacki@outlook.com>
> Sent: Saturday, May 9, 2020 10:23 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
> 
> From: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707
> 
> Ecc fails with Python 3.8 because it uses the deprecated time.clock() function - https://docs.python.org/3.7/library/time.html#time.clock
> 
> This change updates EccMain.py to use time.perf_counter().
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> ---
>   BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py
> index 560bb9fd7a31..72edbea3b883 100644
> --- a/BaseTools/Source/Python/Ecc/EccMain.py
> +++ b/BaseTools/Source/Python/Ecc/EccMain.py
> @@ -2,6 +2,7 @@
>   # This file is used to be the main entrance of ECC tool  #  # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) Microsoft Corporation.<BR>

When trying to apply this patch I got:

error: patch failed: BaseTools/Source/Python/Ecc/EccMain.py:2

Because it has already been merged as commit 
242ab73d7f255d5d859eaf74a23b9d68c686d177.

1/ The copyright comment misses a year range

2/ It is annoying to not know a patch has been merged.
What is the expected workflow? Pull repository, look at patches merged, 
then go on the list to review the un-merged ones? I suppose this won't 
matter once workflow is switched to GitHub. Still, not very practical.

Regards,

Phil.

>   # SPDX-License-Identifier: BSD-2-Clause-Patent  #
>   
> @@ -406,9 +407,9 @@ if __name__ == '__main__':
>       EdkLogger.Initialize()
>       EdkLogger.IsRaiseError = False
>   
> -    StartTime = time.clock()
> +    StartTime = time.perf_counter()
>       Ecc = Ecc()
> -    FinishTime = time.clock()
> +    FinishTime = time.perf_counter()
>   
>       BuildDuration = time.strftime("%M:%S", time.gmtime(int(round(FinishTime - StartTime))))
>       EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))
> --
> 2.16.3.windows.1
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
  2020-05-14  7:37   ` [edk2-devel] " Philippe Mathieu-Daudé
@ 2020-05-14  8:18     ` Michael Kubacki
  2020-05-14  8:45       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Kubacki @ 2020-05-14  8:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, devel, bob.c.feng
  Cc: Gao, Liming, Michael D Kinney, Laszlo Ersek

Hi Phil,

It has been a policy from Microsoft contributors to not include a year 
in the copyright header you will find this in many other existing files 
in edk2, I am simply aligning to that practice.

Bob is the maintainer and as maintainer he chose to submit the patch (it 
has been on the list since May 8th). It has been relatively common to 
reply to the patch thread to indicate it was submitted with commit 
details. I noticed the details were not updated in the BZ either in this 
case so I have done that and closed the BZ.

Thanks,
Michael


On 5/14/2020 12:37 AM, Philippe Mathieu-Daudé wrote:
> +Michael & Laszlo.
> 
> On 5/13/20 4:15 AM, Bob Feng wrote:
>> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
>>
>> -----Original Message-----
>> From: michael.kubacki@outlook.com <michael.kubacki@outlook.com>
>> Sent: Saturday, May 9, 2020 10:23 AM
>> To: devel@edk2.groups.io
>> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
>> <liming.gao@intel.com>
>> Subject: [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function 
>> time.clock()
>>
>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>
>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707
>>
>> Ecc fails with Python 3.8 because it uses the deprecated time.clock() 
>> function - https://docs.python.org/3.7/library/time.html#time.clock
>>
>> This change updates EccMain.py to use time.perf_counter().
>>
>> Cc: Bob Feng <bob.c.feng@intel.com>
>> Cc: Liming Gao <liming.gao@intel.com>
>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
>> ---
>>   BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/BaseTools/Source/Python/Ecc/EccMain.py 
>> b/BaseTools/Source/Python/Ecc/EccMain.py
>> index 560bb9fd7a31..72edbea3b883 100644
>> --- a/BaseTools/Source/Python/Ecc/EccMain.py
>> +++ b/BaseTools/Source/Python/Ecc/EccMain.py
>> @@ -2,6 +2,7 @@
>>   # This file is used to be the main entrance of ECC tool  #  # 
>> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
>> +# Copyright (c) Microsoft Corporation.<BR>
> 
> When trying to apply this patch I got:
> 
> error: patch failed: BaseTools/Source/Python/Ecc/EccMain.py:2
> 
> Because it has already been merged as commit 
> 242ab73d7f255d5d859eaf74a23b9d68c686d177.
> 
> 1/ The copyright comment misses a year range
> 
> 2/ It is annoying to not know a patch has been merged.
> What is the expected workflow? Pull repository, look at patches merged, 
> then go on the list to review the un-merged ones? I suppose this won't 
> matter once workflow is switched to GitHub. Still, not very practical.
> 
> Regards,
> 
> Phil.
> 
>>   # SPDX-License-Identifier: BSD-2-Clause-Patent  #
>> @@ -406,9 +407,9 @@ if __name__ == '__main__':
>>       EdkLogger.Initialize()
>>       EdkLogger.IsRaiseError = False
>> -    StartTime = time.clock()
>> +    StartTime = time.perf_counter()
>>       Ecc = Ecc()
>> -    FinishTime = time.clock()
>> +    FinishTime = time.perf_counter()
>>       BuildDuration = time.strftime("%M:%S", 
>> time.gmtime(int(round(FinishTime - StartTime))))
>>       EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d 
>> %Y", time.localtime()), BuildDuration))
>> -- 
>> 2.16.3.windows.1
>>
>>
>> 
>>
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
  2020-05-14  8:18     ` Michael Kubacki
@ 2020-05-14  8:45       ` Philippe Mathieu-Daudé
  2020-05-14  9:12         ` Bob Feng
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-14  8:45 UTC (permalink / raw)
  To: Michael Kubacki, devel, bob.c.feng
  Cc: Gao, Liming, Michael D Kinney, Laszlo Ersek

On 5/14/20 10:18 AM, Michael Kubacki wrote:
> Hi Phil,
> 
> It has been a policy from Microsoft contributors to not include a year 
> in the copyright header you will find this in many other existing files 
> in edk2, I am simply aligning to that practice.

If you want an aligned codebase, we should first remove all they years 
in all the other Copyright lines.

> 
> Bob is the maintainer and as maintainer he chose to submit the patch (it 
> has been on the list since May 8th). It has been relatively common to 
> reply to the patch thread to indicate it was submitted with commit 
> details.

This is extra work for the maintainer, but save time to reviewers.
The mergify bot could do that, but (see previous comment below) it is 
probably not worthwhile if the plan is to switch to GitHub pull requests.

> I noticed the details were not updated in the BZ either in this 
> case so I have done that and closed the BZ.

Thanks for this.

> 
> Thanks,
> Michael
> 
> 
> On 5/14/2020 12:37 AM, Philippe Mathieu-Daudé wrote:
>> +Michael & Laszlo.
>>
>> On 5/13/20 4:15 AM, Bob Feng wrote:
>>> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
>>>
>>> -----Original Message-----
>>> From: michael.kubacki@outlook.com <michael.kubacki@outlook.com>
>>> Sent: Saturday, May 9, 2020 10:23 AM
>>> To: devel@edk2.groups.io
>>> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
>>> <liming.gao@intel.com>
>>> Subject: [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function 
>>> time.clock()
>>>
>>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>>
>>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707
>>>
>>> Ecc fails with Python 3.8 because it uses the deprecated time.clock() 
>>> function - https://docs.python.org/3.7/library/time.html#time.clock
>>>
>>> This change updates EccMain.py to use time.perf_counter().
>>>
>>> Cc: Bob Feng <bob.c.feng@intel.com>
>>> Cc: Liming Gao <liming.gao@intel.com>
>>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
>>> ---
>>>   BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/BaseTools/Source/Python/Ecc/EccMain.py 
>>> b/BaseTools/Source/Python/Ecc/EccMain.py
>>> index 560bb9fd7a31..72edbea3b883 100644
>>> --- a/BaseTools/Source/Python/Ecc/EccMain.py
>>> +++ b/BaseTools/Source/Python/Ecc/EccMain.py
>>> @@ -2,6 +2,7 @@
>>>   # This file is used to be the main entrance of ECC tool  #  # 
>>> Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
>>> +# Copyright (c) Microsoft Corporation.<BR>
>>
>> When trying to apply this patch I got:
>>
>> error: patch failed: BaseTools/Source/Python/Ecc/EccMain.py:2
>>
>> Because it has already been merged as commit 
>> 242ab73d7f255d5d859eaf74a23b9d68c686d177.
>>
>> 1/ The copyright comment misses a year range
>>
>> 2/ It is annoying to not know a patch has been merged.
>> What is the expected workflow? Pull repository, look at patches 
>> merged, then go on the list to review the un-merged ones? I suppose 
>> this won't matter once workflow is switched to GitHub. Still, not very 
>> practical.
>>
>> Regards,
>>
>> Phil.
>>
>>>   # SPDX-License-Identifier: BSD-2-Clause-Patent  #
>>> @@ -406,9 +407,9 @@ if __name__ == '__main__':
>>>       EdkLogger.Initialize()
>>>       EdkLogger.IsRaiseError = False
>>> -    StartTime = time.clock()
>>> +    StartTime = time.perf_counter()
>>>       Ecc = Ecc()
>>> -    FinishTime = time.clock()
>>> +    FinishTime = time.perf_counter()
>>>       BuildDuration = time.strftime("%M:%S", 
>>> time.gmtime(int(round(FinishTime - StartTime))))
>>>       EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d 
>>> %Y", time.localtime()), BuildDuration))
>>> -- 
>>> 2.16.3.windows.1
>>>
>>>
>>> 
>>>
>>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()
  2020-05-14  8:45       ` Philippe Mathieu-Daudé
@ 2020-05-14  9:12         ` Bob Feng
  0 siblings, 0 replies; 7+ messages in thread
From: Bob Feng @ 2020-05-14  9:12 UTC (permalink / raw)
  To: devel@edk2.groups.io, philmd@redhat.com, Michael Kubacki
  Cc: Gao, Liming, Kinney, Michael D, Laszlo Ersek



-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Philippe Mathieu-Daudé
Sent: Thursday, May 14, 2020 4:45 PM
To: Michael Kubacki <michael.kubacki@outlook.com>; devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Cc: Gao, Liming <liming.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Laszlo Ersek <lersek@redhat.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock()

On 5/14/20 10:18 AM, Michael Kubacki wrote:
> Hi Phil,
> 
> It has been a policy from Microsoft contributors to not include a year 
> in the copyright header you will find this in many other existing 
> files in edk2, I am simply aligning to that practice.

If you want an aligned codebase, we should first remove all they years in all the other Copyright lines.

> 
> Bob is the maintainer and as maintainer he chose to submit the patch 
> (it has been on the list since May 8th). It has been relatively common 
> to reply to the patch thread to indicate it was submitted with commit 
> details.

This is extra work for the maintainer, but save time to reviewers.
The mergify bot could do that, but (see previous comment below) it is probably not worthwhile if the plan is to switch to GitHub pull requests.

[Bob]. Mergify sent the notification mail when the patch was merged. But I'll send the patch merge notification mail since it's good for reviewers.
RE: [tianocore/edk2] BaseTools/Ecc: Replace deprecated function time.clock() (#607)
Merged #607 into master.

> I noticed the details were not updated in the BZ either in this case 
> so I have done that and closed the BZ.

Thanks for this.

> 
> Thanks,
> Michael
> 
> 
> On 5/14/2020 12:37 AM, Philippe Mathieu-Daudé wrote:
>> +Michael & Laszlo.
>>
>> On 5/13/20 4:15 AM, Bob Feng wrote:
>>> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
>>>
>>> -----Original Message-----
>>> From: michael.kubacki@outlook.com <michael.kubacki@outlook.com>
>>> Sent: Saturday, May 9, 2020 10:23 AM
>>> To: devel@edk2.groups.io
>>> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming 
>>> <liming.gao@intel.com>
>>> Subject: [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function
>>> time.clock()
>>>
>>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>>
>>> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2707
>>>
>>> Ecc fails with Python 3.8 because it uses the deprecated 
>>> time.clock() function - 
>>> https://docs.python.org/3.7/library/time.html#time.clock
>>>
>>> This change updates EccMain.py to use time.perf_counter().
>>>
>>> Cc: Bob Feng <bob.c.feng@intel.com>
>>> Cc: Liming Gao <liming.gao@intel.com>
>>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
>>> ---
>>>   BaseTools/Source/Python/Ecc/EccMain.py | 5 +++--
>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/BaseTools/Source/Python/Ecc/EccMain.py
>>> b/BaseTools/Source/Python/Ecc/EccMain.py
>>> index 560bb9fd7a31..72edbea3b883 100644
>>> --- a/BaseTools/Source/Python/Ecc/EccMain.py
>>> +++ b/BaseTools/Source/Python/Ecc/EccMain.py
>>> @@ -2,6 +2,7 @@
>>>   # This file is used to be the main entrance of ECC tool  #  # 
>>> Copyright (c) 2009 - 2018, Intel Corporation. All rights 
>>> reserved.<BR>
>>> +# Copyright (c) Microsoft Corporation.<BR>
>>
>> When trying to apply this patch I got:
>>
>> error: patch failed: BaseTools/Source/Python/Ecc/EccMain.py:2
>>
>> Because it has already been merged as commit 
>> 242ab73d7f255d5d859eaf74a23b9d68c686d177.
>>
>> 1/ The copyright comment misses a year range
>>
>> 2/ It is annoying to not know a patch has been merged.
>> What is the expected workflow? Pull repository, look at patches 
>> merged, then go on the list to review the un-merged ones? I suppose 
>> this won't matter once workflow is switched to GitHub. Still, not 
>> very practical.
>>
>> Regards,
>>
>> Phil.
>>
>>>   # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -406,9 +407,9 
>>> @@ if __name__ == '__main__':
>>>       EdkLogger.Initialize()
>>>       EdkLogger.IsRaiseError = False
>>> -    StartTime = time.clock()
>>> +    StartTime = time.perf_counter()
>>>       Ecc = Ecc()
>>> -    FinishTime = time.clock()
>>> +    FinishTime = time.perf_counter()
>>>       BuildDuration = time.strftime("%M:%S", 
>>> time.gmtime(int(round(FinishTime - StartTime))))
>>>       EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d 
>>> %Y", time.localtime()), BuildDuration))
>>> --
>>> 2.16.3.windows.1
>>>
>>>
>>> 
>>>
>>
> 





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-14  9:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-09  2:22 [PATCH v1 1/1] BaseTools/Ecc: Replace deprecated function time.clock() Michael Kubacki
2020-05-13  2:15 ` Bob Feng
2020-05-14  7:37   ` [edk2-devel] " Philippe Mathieu-Daudé
2020-05-14  8:18     ` Michael Kubacki
2020-05-14  8:45       ` Philippe Mathieu-Daudé
2020-05-14  9:12         ` Bob Feng
2020-05-14  7:18 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox