-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
benchmark: try building the addons in napi benchmarks #24309
Conversation
So I'm not sure about this, since it's unconditional... Doing it in |
349a07d
to
afe014c
Compare
What do you mean by |
Would this change mean that Also, should this PR remove the |
For CI your are right. But if I think about regular dev flow, I'd rather we build this IFF it's dependencies change: Lines 1051 to 1054 in e854cf9
|
I'm totally 👍 on this approach or the Makefile approach in #24307. I'll form a stronger opinion if we don't have consensus, but otherwise I'll defer to the more-build-and-automation-informed folks on this stuff. |
Also this packs a surprise side effect, if I run |
This will only build if the module failed to load - which usually means the dependency changes. But benchmark isn't in regular dev flow anymore since it's ignored by test.py?
It doesn't run always though, only when the addon fail to load. If the addon fail to load, and node-gyp fail to run, the benchmark will exit as usual - only difference is that by giving it another try, node-gyp could do some damage to your system somehow? (But I don't see how?) (Also just curious, are these benchmarks runnable on Windows?) |
Yes you are right. So yes that's a very good condition :)
I'm thinking about this... ATM I'm not blocking, just not approving ¯_(ツ)_/¯ |
@refack Are the benchmark ever run on Windows? They are skipped in tests for Windows, and I couldn't find a shortcut in vcbuild.bat so I don't assume people run them manually? |
Yeah, when you want to run benchmarks. Personally I call them directly or as described in https://github.com/nodejs/node/blob/master/doc/guides/writing-and-running-benchmarks.md (AFAIK the calls from |
console.error(`${__filename}: V8 Binding failed to load`); | ||
console.error(e); | ||
process.exit(0); | ||
} |
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.
As a suggestion: I would rewrite this whole part to something like:
const v8 = common.buildAddon(
`./build/${common.buildType}/binding`,
'benchmark/napi/function_args'
);
In that case the common call just tries to require it first and returns it if possible and tries to build the addon otherwise.
If it fails, we also already have all the necessary information printed due to the console.error
part in the common part and in the actual error that is thrown if it fails.
This would reduce the number of code lines significantly.
8ae28ff
to
2935f72
Compare
Ping @joyeecheung ... is this still needed? |
Closing due to lack of continued activity. Can reopen if it is picked back up again |
cc @Trott @refack
Refs: nodejs/build#1568
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes