Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
src: fix building --without-v8-platform#11088
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
v8_platform.platform_ is referenced by node::Start without regard to the value of NODE_USE_V8_PLATFORM, so it should be declared unconditionally, otherwise Node fails to compile when !NODE_USE_V8_PLATFORM.
The call signature of v8_platform.StartInspector needs to be the same whether or not NODE_USE_V8_PLATFORM, otherwise Node will fail to compile if HAVE_INSPECTOR and !NODE_USE_V8_PLATFORM.
bnoordhuis commented Feb 1, 2017
Second commit LGTM but @matthewloring should review the first one because I don't think passing a nullptr to |
matthewloring commented Feb 1, 2017
node::tracing::Agent::Start can't accept a nullptr argument to its platform parameter, so don't call it when Node is compiled with NODE_USE_V8_PLATFORM=0.
907f1f2 to 0e9c0cbComparemykmelez commented Feb 1, 2017
@bnoordhuis, @matthewloring: We can't throw an exception, because Note: I opted to warn rather than exiting if Note that I had to move the call to |
matthewloring commented Feb 1, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I don't have a preference between an error and a warning. The approach looks good on my end. |
mykmelez commented Feb 1, 2017
Erm, to be precise: I didn't have to move that call, since |
src/node.cc Outdated
| #endif// HAVE_INSPECTOR | ||
| voidStartTracingAgent(){ | ||
| tracing_agent = newtracing::Agent(); |
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.
Can you make this a property of v8_platform while you're here (and call it tracing_agent_)? Maybe also insert a CHECK(tracing_agent_ == nullptr) to detect double calls.
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.
Yes, I've done both of these things in b93584b. In the process, I also spotted another direct call to tracing_agent->Stop() and replaced it with a call to v8_platform.StopTracingAgent().
Move tracing_agent global into the v8_platform struct, renaming it to tracing_agent_; CHECK(tracing_agent_ == nullptr) in StartTracingAgent() to detect double calls; and relace another tracing_agent->Stop() call with a call to StopTracingAgent().
bnoordhuis left a comment
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, LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/6171/
mhdawson left a comment
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.
LGTM
* declare v8_platform.platform_ unconditionally v8_platform.platform_ is referenced by node::Start without regard to the value of NODE_USE_V8_PLATFORM, so it should be declared unconditionally, otherwise Node fails to compile when !NODE_USE_V8_PLATFORM. * update v8_platform.StartInspector signature The call signature of v8_platform.StartInspector needs to be the same whether or not NODE_USE_V8_PLATFORM, otherwise Node will fail to compile if HAVE_INSPECTOR and !NODE_USE_V8_PLATFORM. * don't call tracing_agent->Start w/nullptr node::tracing::Agent::Start can't accept a nullptr argument to its platform parameter, so don't call it when Node is compiled with NODE_USE_V8_PLATFORM=0. * refactor tracing_agent into v8_platform Move tracing_agent global into the v8_platform struct, renaming it to tracing_agent_; CHECK(tracing_agent_ == nullptr) in StartTracingAgent() to detect double calls; and relace another tracing_agent->Stop() call with a call to StopTracingAgent(). PR-URL: #11088 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
jasnell commented Feb 3, 2017
Landed in 046f66a |
italoacasas commented Feb 4, 2017
This commits depends on a |
mykmelez commented Feb 4, 2017
The issue doesn't exist in v7.x, so there's no need to backport anything. |
mykmelez commented Feb 4, 2017
Erm, correction: one of the issues addressed in this PR does exist in v7.x, so I've opened #11157 to backport its fix. |
* declare v8_platform.platform_ unconditionally v8_platform.platform_ is referenced by node::Start without regard to the value of NODE_USE_V8_PLATFORM, so it should be declared unconditionally, otherwise Node fails to compile when !NODE_USE_V8_PLATFORM. * update v8_platform.StartInspector signature The call signature of v8_platform.StartInspector needs to be the same whether or not NODE_USE_V8_PLATFORM, otherwise Node will fail to compile if HAVE_INSPECTOR and !NODE_USE_V8_PLATFORM. * don't call tracing_agent->Start w/nullptr node::tracing::Agent::Start can't accept a nullptr argument to its platform parameter, so don't call it when Node is compiled with NODE_USE_V8_PLATFORM=0. * refactor tracing_agent into v8_platform Move tracing_agent global into the v8_platform struct, renaming it to tracing_agent_; CHECK(tracing_agent_ == nullptr) in StartTracingAgent() to detect double calls; and relace another tracing_agent->Stop() call with a call to StopTracingAgent(). PR-URL: nodejs#11088 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
gibfahn commented Jun 17, 2017
Marking |
Node fails to compile when configured
--without-v8-platformbecause of two issues with the implementation in src/node.cc when !NODE_USE_V8_PLATFORM. This branch fixes those two issues.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes (Note:make -j4 testpasses with these changes when I build with the default configure options. It fails when I build--without-v8-platform, but since previously it didn't even compile with that option, these changes are still an improvement.)Affected core subsystem(s)
The affected core subsystem appears to be "src", or possibly "build." The only file that is changed is src/node.cc.