-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
inspector: restore --debug-brk alias #12580
Conversation
--inspect-brk didn't exist prior to 7.6.0, and --debug-brk doesn't exist after nodejs#12197, leaving no consistent way to start node with inspector activated and breaking on first line. Add --debug-brk back in as an undocumented option until 7.x is no longer supported. Fixes: nodejs#12364
7a61718
to
85bf8d0
Compare
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.
Needs tests that a) check the flags are accepted, and ideally b) work.
Sorry to stir up dust, but I'm confused. Why isn't this going to the |
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.
Sorry to stir up dust, but I'm confused. Why isn't this going to the v7.x-staging branch?
@refack All changes must be accepted to master first before being backported to release branches (unless the issue is one specific to a release branch of course). The issue this PR attempts to address would be present in v8.x as well if this PR does not go into master. |
@TimothyGu As far as I understand this is a bridge feature to enable a
for I don't see the benefit for |
Ref: #12197 |
Could someone from @JetBrains give us some feedback? |
@refack yes it is that. But what is a bridge for when it will only be there for a month before 8.0.0 is released? It's just like every other deprecation process we go through: we first provide an alternative, then after a few major releases we remove the deprecated variant. |
@TimothyGu didn't the I still don't see the benefit for |
No, they went through an accelerated deprecation process because the debug protocol was dropped by upstream v8 so we couldn't go through a full deprecation cycle. |
The benefit is that |
I see now that
You mean forever :( |
Once all active release lines support |
The same issue will rise again, some binaries will need to be called with |
@refack compatibility and not breaking the ecosystem is our number 1 priority. i'm having a hard time seeing why you are pushing back on this so hard. FWIW adding new deprecation warnings is a semver major change that we cannot backport |
I'm pushing back only because I feel this solution was not thought through, and is very ad-hoc, hence my 4 open points. I want to make the users satisfied, so I'm trying to engage then in conversation, and let them convince me that this will be the best solution for them. About a new deprecation notice in since this whole debug/inspect was a big mess and v7 just an example of a weird situation: C:\code\3party\chromium$ node7 --inspect=4000 --debug-brk=5000
Debugger listening on port 5000.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URL in Chrome:
chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:5000/6cdfe112-8ee7-4243-a989-7831b5766a53 In any case I think this should be decided in a wider forum like a CTC meeting. It's too hard to have a real dialog in an issue thread or a PR. |
@refack We've done a pretty good job of getting most of the work on the project done in the issue tracker, even if it may not seem like that. It should only be brought to a CTC meeting if consensus cannot be reached. the best thing to do here is to make a meta issue tracking the problem. Be sure to list all issues / PR's that are involved. Clearly state the intended goal and pros / cons of different approaches. If you feel that there is more to the problem than others are considering the way to get this solved properly is through clear communication that avoids bias. |
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.
Need further discusion
For me personally it's a bit harder since written text is a flat medium. I believe in meetings, and although I haven't seen a CTC meeting yet, I trust you will make the best decision in a meeting.
I think #12364 has all the info. I'll remove some of my bias from my comments. |
After getting feedback from the users, I'm more convinsed this is a good solution.
|
No, there is not CTC agreement on this yet, and @bnoordhuis still has an outstanding objection. |
@jasnell Ben's objection was it lacks tests, if its decided this is the way to go I'll add them. |
AFAIK this specific issue is in consensus (tests aside). The open issue is for how we go forward. I'm +1 for finishing this since at the moment there are no 3rd party tools that can debug node8 nightlies. |
if (option_name == "--inspect") { | ||
debugger_enabled_ = true; | ||
enable_inspector = true; | ||
} else if (option_name == "--inspect-brk") { | ||
} else if (option_name == "--inspect-brk" || option_name == "--debug-brk") { |
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 we make sure that --debug-brk
without --inspect
still fails?
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 would like @nodejs/ctc more folks to review and sign off on this before it landing.
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 if we add a test and if @jkrems's question/concern can be addressed.
src/node_debug_options.cc
Outdated
@@ -94,18 +94,18 @@ bool DebugOptions::ParseOption(const std::string& option) { | |||
argument = option.substr(pos + 1); | |||
} | |||
|
|||
// Note that --debug-port and --debug-brk are undocumented, but to be | |||
// supported until 7.x is no longer supported, not even in LTS (see #12364). |
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 an odd numbered major 7.x will no longer be supported as of June 2017 (in just over a month), so I'm not certain that this comment makes sense.
Also, the issue reference should be a full URL
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.
It sounds like some people think --debug-brk
should exist forever, or even replace --inspect-brk
, I'll fix up the comment once consensus is reached.
!has_argument) { | ||
// only other valid possibility is --inspect-port, | ||
// which requires an argument | ||
} else if (option_name == "--inspect-port" || option_name == "--debug-port") { |
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.
What should happen if both --inspect-port
and --debug-port
are used? Currently the way this is written, whichever one is used last in the command line takes precedence. However, it would be an obvious error if both are used, especially if they specify different values, so it should likely throw.
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'd agree its a bit weird that literally every debug option can be followed with an optional host:port
spec, but that's how it is/was, and its not specific to --debug-brk
.
For example, --inspect-port=9999 --inspect=9876 --inspect-brk=8888
is currenlty supported (does the obvious thing, last wins), would you propose that become an error? I can see the argument for that, and the argument against it, but it doesn't seem to me that if --debug-brk
is added as an alias of --inspect-brk
that it should get special cased.
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.
Personally, I would rather --inspect-port=9999 --inspect=9876 --inspect-brk-8888
result in an error because there's obviously no way to correctly interpret or implement the users intent. Essentially, if the host:port
is specified multiple times, there should be an error.
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.
Fair enough, but making currently allowed syntax invalid is not related to the problem this PR addresses (and would be semver-major).
Since I don't to sound like a broken record, I'll try to bring a new view. I just realized #12364 is a regression: users' tools do not work with node8 nightlies. This PR is a quick reversion of the "offending" code, essentially restoring the status quo. Further discussion about future syntex should continue in parallel. |
@sam-github re: #12364 (comment) I thought you'd be in the "refack opposition" since I pulled the brakes a bit hard on this PR. I'm so happy to see there's no bad feeling!!! |
not saying anything others aren't saying and they're watching this more closely, so I'm going to get out of the way
@sam-github here are some restored tests https://gist.github.com/refack/9eebc6ccc0fcf9d7264157bc6305f7e7#file-restore-test-diff |
New test that could be used https://github.com/nodejs/node/pull/12503/files |
@sam-github I added basic tests & added code to ensure that P.S.: The commit is also rebased against latest |
@jkrems thank you! |
-1, I don't really see the point in keeping it when I would be for having it print out a notice to use |
@Fishrock123 the vendors can't/won't backport |
If they can "back-port" |
I'm closing this, there are too many conversations across issues, please limit to conversation in #12630. Once consensus is achieved, this could be reopened, or adopted by someone else. |
@sam-github I'll spin-off a new PR. I don't mind doing it even for naught... |
@refack thanks |
--inspect-brk didn't exist prior to 7.6.0, and --debug-brk doesn't exist
after #12197, leaving no consistent
way to start node with inspector activated and breaking on first line.
Add debug-brk back in as an undocumented option until 7.x is no longer
supported.
Fixes: #12364
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
inspector, debugger