From c2692ad0a9e22b8ef15476d3ddf4ab8a80d136d5 Mon Sep 17 00:00:00 2001 From: Ranjith Ramakrishnan Date: Fri, 23 Aug 2024 13:35:33 -0700 Subject: [PATCH] SWDEV-480347 - Don't terminate build for cpack bytecompile errors In centos-7, python2 is used for cpack bytecompile. Using f strings in code will result in syntax error. Setting _python_bytecompile_errors_terminate_build to 0 will ignore the errors Change-Id: I43ecc99ae16627f4f5f91d0cca0398f6a003fa3c [ROCm/rocm_smi_lib commit: 4ceffdca68f91c10443c67562afb7d9ffce6ff05] --- projects/rocm-smi-lib/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/rocm-smi-lib/CMakeLists.txt b/projects/rocm-smi-lib/CMakeLists.txt index 3ad742534e..a1cf01a0fc 100755 --- a/projects/rocm-smi-lib/CMakeLists.txt +++ b/projects/rocm-smi-lib/CMakeLists.txt @@ -343,9 +343,11 @@ if(CPACK_RPM_PACKAGE_RELEASE) set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) endif() +# don't terminate if bytecompile of python files fails +set(CPACK_RPM_SPEC_MORE_DEFINE "%define _python_bytecompile_errors_terminate_build 0") # Cpack converts !/usr/bin/env python3 to /usr/libexec/platform-python in RHEL8. # prevent the BRP(buildroot policy) script from checking and modifying interpreter directives -set(CPACK_RPM_SPEC_MORE_DEFINE "%undefine __brp_mangle_shebangs") +string( APPEND CPACK_RPM_SPEC_MORE_DEFINE "\n%undefine __brp_mangle_shebangs") # The line below doesn't currently work; it may be this issue: # https://bugzilla.redhat.com/show_bug.cgi?id=1811358