Fix module resolution when not built from source

Turns out the package.json generated inside our build directory confused
the module root detection in the `bindings` package. This means that our
search path was actually wrong, and relied on this being misdetected.
This commit is contained in:
Ole André Vadla Ravnås committed 2025-05-08 22:39:57 +02:00
1 parent 699c4dc545
commit f4583cbbcf
5 files changed
+18 -15

No files matched your search

+1 -13
View File
@@ -84,19 +84,7 @@ frida_core_dep = dependency('frida-core-1.0', default_options: [
pkg_install_dir = get_option('libdir') / 'node_modules' / 'frida'
package_json = custom_target('package.json',
input: 'package.json',
output: 'package.json',
command: [
python,
files('scripts' / 'adjust-version.py'),
version,
'@INPUT@',
'@OUTPUT@',
],
install: true,
install_dir: pkg_install_dir,
)
package_json = files('package.json')
tsconfig_json = files('tsconfig.json')
subdir('src')
File renamed without changes.
+13
View File
@@ -0,0 +1,13 @@
adjusted_package_json = custom_target('package.json',
input: package_json,
output: 'package.json',
command: [
python,
files('adjust-version.py'),
version,
'@INPUT@',
'@OUTPUT@',
],
install: true,
install_dir: pkg_install_dir,
)
+1 -1
View File
@@ -57,7 +57,7 @@ def generate_ts(model: Model) -> str:
const binding: FridaBinding = bindings({
bindings: "frida_binding",
try: [
["module_root", "bindings"],
["module_root", "build", "bindings"],
[process.cwd(), "bindings"],
]
});"""
+3 -1
View File
@@ -1,3 +1,5 @@
subdir('assets')
if frida_core_dep.type_name() == 'internal'
frida_core_subprj = subproject('frida-core')
frida_gir = frida_core_subprj.get_variable('core_public_gir')
@@ -78,7 +80,7 @@ custom_target('js',
'@OUTDIR@',
'@PRIVATE_DIR@',
npm,
package_json,
adjusted_package_json,
tsconfig_json,
'@INPUT@',
],