PythonicVarun opened a new issue, #48855:
URL: https://github.com/apache/arrow/issues/48855

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   I encountered a potential unhandled `TypeError` in 
`ci/conan/all/conanfile.py` within the `source()` method.
   
   **Location:**
   https://github.com/apache/arrow/blob/main/ci/conan/all/conanfile.py#L290-L302
   
   **The Issue:**
   The logic block handling local source copying (when the version is not found 
in `conan_data`), the script retrieves `ARROW_HOME` from the environment:
   
   ```python
   top_level = os.environ.get("ARROW_HOME")
   shutil.copytree(os.path.join(top_level, "cpp"),
                   os.path.join(self.source_folder, "cpp"))
   shutil.copytree(os.path.join(top_level, "format"),
                   os.path.join(self.source_folder, "format"))
   ```
   
   If the `ARROW_HOME` environment variable is not set, `os.environ.get` 
returns `None`. Consequently, passing `None` to `os.path.join` raises a 
`TypeError` (i.e., `TypeError: expected str, bytes or os.PathLike object, not 
NoneType`) rather than a descriptive error message indicating the missing 
configuration.
   
   **Expected Behavior:** If `ARROW_HOME` is required for this build path but 
is missing, the script should explicitly check for `None` and raise a clear 
`ConanException` (like, "ARROW_HOME environment variable is required but not 
set") to improve the developer experience.
   
   **Proposal:** I am happy to submit a PR to add a check for `top_level is 
None` and raise a proper exception. Please let me know if this is a desired 
improvement.
   
   ### Component(s)
   
   Continuous Integration, Packaging


-- 
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]

Reply via email to