buildtools: fix avx512 check for Python 3.5

Message ID 20220103170940.199956-1-lance.richardson@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series buildtools: fix avx512 check for Python 3.5 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Lance Richardson Jan. 3, 2022, 5:09 p.m. UTC
  Python 3.5 subprocess.run() does not have a capture_output
parameter (it is present only in 3.7 and up). Capture output
by using subprocess.PIPE for stdout instead.

Fixes: bb9cd91095b3 ("buildtools: make AVX512 check portable")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
---
 buildtools/binutils-avx512-check.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Dmitry Kozlyuk Jan. 3, 2022, 6 p.m. UTC | #1
2022-01-03 12:09 (UTC-0500), Lance Richardson:
> Python 3.5 subprocess.run() does not have a capture_output
> parameter (it is present only in 3.7 and up). Capture output
> by using subprocess.PIPE for stdout instead.
> 
> Fixes: bb9cd91095b3 ("buildtools: make AVX512 check portable")
> Cc: stable@dpdk.org
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>

Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
  
Thomas Monjalon Jan. 12, 2022, 5:07 p.m. UTC | #2
03/01/2022 19:00, Dmitry Kozlyuk:
> 2022-01-03 12:09 (UTC-0500), Lance Richardson:
> > Python 3.5 subprocess.run() does not have a capture_output
> > parameter (it is present only in 3.7 and up). Capture output
> > by using subprocess.PIPE for stdout instead.
> > 
> > Fixes: bb9cd91095b3 ("buildtools: make AVX512 check portable")
> > Cc: stable@dpdk.org
> > Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> 
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>

Applied, thanks.
  

Patch

diff --git a/buildtools/binutils-avx512-check.py b/buildtools/binutils-avx512-check.py
index a4e14f3593..9d7d360d95 100644
--- a/buildtools/binutils-avx512-check.py
+++ b/buildtools/binutils-avx512-check.py
@@ -15,7 +15,7 @@ 
     src = '__asm__("vpgatherqq {}");'.format(gather_params).encode('utf-8')
     subprocess.run(cc + ['-c', '-xc', '-o', obj.name, '-'], input=src, check=True)
     asm = subprocess.run([objdump, '-d', '--no-show-raw-insn', obj.name],
-                         capture_output=True, check=True).stdout.decode('utf-8')
+                         stdout=subprocess.PIPE, check=True).stdout.decode('utf-8')
     if gather_params not in asm:
 	    print('vpgatherqq displacement error with as')
 	    sys.exit(1)