Skip to content

Commit dc5f78e

Browse files
committed
setup: Find generated files next to the extension
The prebuilt wheel path installs the generated __init__.py, aio.py and _frida.pyi alongside the extension, not under build/frida/, so copy them from there.
1 parent e17e55a commit dc5f78e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎setup.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def build_extension(self, ext):
114114
target = self.get_ext_fullpath(ext.name)
115115
Path(target).parent.mkdir(parents=True, exist_ok=True)
116116
shutil.copy(FRIDA_EXTENSION, target)
117-
copy_generated_package(self.build_lib)
117+
copy_generated_package(self.build_lib, Path(FRIDA_EXTENSION).parent)
118118

119119

120120
class FridaDemandBuiltExt(build_ext):
@@ -131,11 +131,10 @@ def build_extension(self, ext):
131131
target = self.get_ext_fullpath(ext.name)
132132
Path(target).parent.mkdir(parents=True, exist_ok=True)
133133
shutil.copy(outputs[0], target)
134-
copy_generated_package(self.build_lib)
134+
copy_generated_package(self.build_lib, SOURCE_ROOT / "build" / "frida")
135135

136136

137-
def copy_generated_package(build_lib):
138-
generated = SOURCE_ROOT / "build" / "frida"
137+
def copy_generated_package(build_lib, generated):
139138
destination = Path(build_lib) / "frida"
140139
destination.mkdir(parents=True, exist_ok=True)
141140
for name in GENERATED_PACKAGE_FILES:

0 commit comments

Comments
 (0)