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:
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
Describe the bug, including details regarding any error messages, version, and platform.
I encountered a potential unhandled
TypeErrorinci/conan/all/conanfile.pywithin thesource()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 retrievesARROW_HOMEfrom the environment:If the
ARROW_HOMEenvironment variable is not set,os.environ.getreturnsNone. Consequently, passingNonetoos.path.joinraises aTypeError(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_HOMEis required for this build path but is missing, the script should explicitly check forNoneand raise a clearConanException(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 Noneand raise a proper exception. Please let me know if this is a desired improvement.Component(s)
Continuous Integration, Packaging