2828from torch .utils .cpp_extension import BuildExtension , CUDAExtension
2929
3030root = Path (__file__ ).parent .resolve ()
31- third_party = Path ("third_party" )
31+ third_party = Path (os . environ . get ( "SGLANG_MUSA_THIRD_PARTY_DIR" , "build/_deps" ) )
3232arch = platform .machine ().lower ()
3333
3434
@@ -160,7 +160,7 @@ class _CustomBuildExt(BuildExtension):
160160 @staticmethod
161161 def _clone_and_checkout (repo_path , repo_url , git_tag , git_shallow ):
162162 """Clone a git repository and checkout a specific tag/commit."""
163- repo_path .parent .mkdir (exist_ok = True )
163+ repo_path .parent .mkdir (parents = True , exist_ok = True )
164164 if not repo_path .exists ():
165165 clone_cmd = ["git" , "clone" ]
166166 if git_shallow :
@@ -173,8 +173,10 @@ def _clone_and_checkout(repo_path, repo_url, git_tag, git_shallow):
173173 subprocess .check_call (["git" , "checkout" , git_tag ], cwd = repo_path )
174174
175175 def run (self ):
176- if os .environ .get ("SKIP_THIRD_PARTY" , "0" ) == "1" :
177- print ("Skipping third-party repositories cloning (SKIP_THIRD_PARTY=1)" )
176+ if os .environ .get ("SGLANG_MUSA_SKIP_THIRD_PARTY" , "0" ) == "1" :
177+ print (
178+ "Skipping third-party repositories cloning (SGLANG_MUSA_SKIP_THIRD_PARTY=1)"
179+ )
178180 else :
179181 print ("Cloning third-party repositories..." )
180182 self ._clone_and_checkout (
0 commit comments