@@ -51,12 +51,13 @@ def find_all_prebuilt():
5151 mapping = {}
5252
5353 cmake_build_dir = os .environ .get ("CMAKE_BUILD_DIR" ) or os .environ .get ("PYALP_BUILD_DIR" )
54+ # If no explicit build dir is provided, fall back to the conventional
55+ # out-of-source `../build` directory. This keeps discovery inside a
56+ # single well-defined location and preserves prior CI behavior.
5457 if not cmake_build_dir :
55- # No explicit build dir provided — do not search outside well-defined
56- # locations. Return empty mapping to signal 'no prebuilt modules'.
57- return mapping
58-
59- cmake_build_dir = os .path .abspath (cmake_build_dir )
58+ cmake_build_dir = os .path .abspath (os .path .join (here , '..' , 'build' ))
59+ else :
60+ cmake_build_dir = os .path .abspath (cmake_build_dir )
6061
6162 for mod in supported :
6263 found = []
@@ -113,12 +114,9 @@ def build_extension(self, ext):
113114 if not src :
114115 src = prebuilt_modules .get (modname )
115116 if not src :
116- # No explicit PREBUILT path or discovered prebuilt module in the
117- # provided build directory. We do not search arbitrary locations;
118- # instead, signal an error so the caller can provide the path via
119- # PREBUILT_PYALP_SO or set CMAKE_BUILD_DIR so prebuilt discovery
120- # will locate the artifacts.
121- src = None
117+ # No explicit PREBUILT path or discovered prebuilt module in the
118+ # provided build directory. Do not search arbitrary locations.
119+ src = None
122120
123121 if not src or not os .path .exists (src ):
124122 raise RuntimeError (f"Prebuilt pyalp shared object not found for module '{ modname } ' during build_ext" )
0 commit comments