[BUILD] Fix the build bug when user use system package of llvm by setting LLVM_SYSPATH (#1336)

When the user set the `LLVM_SYSPATH` to use custom build llvm, it will
throw the error because there is no version.txt under the custom build
one.

This PR skips the version check If the `LLVM_SYSPATH` is set.

---------

Co-authored-by: Philippe Tillet <phil@openai.com>
This commit is contained in:
Stonepia
2023-03-16 04:28:19 +08:00
committed by GitHub
parent 56b23f433d
commit 109b5e2729

View File

@@ -83,8 +83,8 @@ def get_thirdparty_packages(triton_cache_path):
if p.syspath_var_name in os.environ:
package_dir = os.environ[p.syspath_var_name]
version_file_path = os.path.join(package_dir, "version.txt")
if not os.path.exists(version_file_path) or\
Path(version_file_path).read_text() != p.url:
if p.syspath_var_name not in os.environ and\
(not os.path.exists(version_file_path) or Path(version_file_path).read_text() != p.url):
try:
shutil.rmtree(package_root_dir)
except Exception: