-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support datadog-pprof #411
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Do you know why prebuilds is not detected?
We fixed this to work with node-gyp-build
as well as the fork @aminya/node-gyp-build
I would prefer a fix for the generic case if we can determine what datadog is doing differently here.
Looks like we're hitting this Line 755 in c16e794
|
Yes, I described why this was the case in the issue here Datadog is using a CJS import and assigning it to a variable. So in the AST, we will not be able to infer the package name from the arguments (the arguments are I also find that having to manually resolve the arguments via checking the array of args a little hard-codey, so i decided to just have a special case catch all instead for the package to just include |
Could I also check if it would be possible to include a flag to ignore tree shaking modules in a package? I think it would make sense as a catch-all to handle special case like these! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can revisit the general solution in a new PR and merge this PR once the windows test pass
I have removed the sourcemaps outputs from |
I took a stab at fixing this properly in PR #419 |
- Fixes #410 - Closes #411 Note, this is easiest to review without whitespace https://github.com/vercel/nft/pull/419/files?w=1
Closes #410
Alternative solution considered
NODE_GYP_BUILD
to account for problem identified in Add support for@datadog/pprof
#410. This proved to be tricky as we need to retrieve the value fromfindBindings
which involves a walk of the whole treeSolution
Instead of the alternative above, chose to just add a special case for this package
Automated tests
Just added a conditional
testName === '@datadog-pprof'
to thefoundMatchingBinary
statement so we test the presence of theprebuilds
folder.Manual tests (since the automated tests do not test for presence of
prebuilds
folderRunning
node out/cli.js print node_modules/@datadog/pprof/out/src/index.js
gives me the following FILELISTWe see that the entire
prebuilds
folder is correctly included.