frida / frida-core

Frida core library intended for static linking into bindings
https://frida.re
Other
592 stars 187 forks source link

Better errors on generate-script-runtime #516

Closed bannsec closed 2 months ago

bannsec commented 3 months ago

This drove me nuts. I kept getting an error telling me npm wasn't installed. Turns out it was and the error was completely lying to me and not even showing me the true error.

With real errors, i get something more useful:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@frida/crosspath@3.0.0',
npm WARN EBADENGINE   required: { node: '>=14.9.0' },
npm WARN EBADENGINE   current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
file:///home/user/frida/build/tmp-linux-x86_64/frida-core/src/barebone/node_modules/frida-compile/dist/system/node.js:68
        defaultWatchFileKind: () => nodeSystem.defaultWatchFileKind?.(),

Also should probably update install instructions if noode > 14.9 is required, since by default npm on ubuntu 22.04 is apparently too old.

oleavr commented 2 months ago

Thanks! Apologies for the delay here, I've been heads down restructuring the build system, and it ended up taking way longer than expected. We now check for Node.js and npm at the Meson level, and also ensure that Node.js is recent enough. I've removed this confusing error handling as well -- let's see if we'll have to bring it back later. (The default should be enough though, as I seem to recall that the subprocess.CalledProcessError is reasonably verbose.)