SWDEV-521636 - Add dependent script path to system path in rocprof-compute (#651)

In wheel environment, rocprof-compute in bin folder is not a soft link. For executing rocprof-compute from bin folder, the system path should also have the dependency script paths. Added the same
이 커밋은 다음에 포함됨:
raramakr
2025-04-02 09:41:02 -07:00
커밋한 사람 GitHub
부모 a7ebbbd41e
커밋 df2296529b
+14 -2
파일 보기
@@ -28,6 +28,7 @@
import re
import sys
import os
# import logging
from pathlib import Path
@@ -38,9 +39,20 @@ try:
from rocprof_compute_base import RocProfCompute
from utils.logger import console_error
except ImportError as e:
# print("Failed to import required modules: " + str(e))
pass
# In wheel package, softlink is not supported.
# rocprof-compute will get installed in bin and libexec/rocprofiler-compute.
# When invoked from bin folder, the extra paths are required to import the dependent scripts
try:
current_path = os.path.dirname(os.path.abspath(__file__))
additional_path = f"{current_path}/../libexec/rocprofiler-compute"
sys.path.append(os.path.abspath(additional_path))
from importlib import metadata
from rocprof_compute_base import RocProfCompute
from utils.utils import console_error
except ImportError as e:
# print("Failed to import required modules: " + str(e))
pass
def verify_deps_version(localVer, desiredVer, operator):
"""Check package version strings with simple operators used in companion