gemini-code-assist[bot] commented on code in PR #124:
URL: https://github.com/apache/tvm-ffi/pull/124#discussion_r2431380996


##########
python/tvm_ffi/libinfo.py:
##########
@@ -134,8 +134,8 @@ def find_source_path() -> str:
 def find_cmake_path() -> str:
     """Find the preferred cmake path."""
     candidates = [
-        str(Path(__file__).resolve().parent / "cmake"),
-        str(Path(__file__).resolve().parent / ".." / ".." / "cmake"),
+        str(Path(__file__).resolve().parent / "share" / "cmake" / "tvm_ffi"),  
# Standard install

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   The path for the standard installation seems to be constructed incorrectly. 
The `share` directory is typically located under `sys.prefix`, not within the 
python package's directory in `site-packages`. Using 
`Path(__file__).resolve().parent` will result in an incorrect path like 
`<sys.prefix>/lib/pythonX.Y/site-packages/tvm_ffi/share/cmake/tvm_ffi`.
   
   The correct path should be constructed using `sys.prefix`. Since `sys` is 
already imported in this file, you can change this to use `Path(sys.prefix)`.
   
   ```suggestion
           str(Path(sys.prefix) / "share" / "cmake" / "tvm_ffi"),  # Standard 
install
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to