Skip to content
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

Work around OTP-21 deprecation of get_stacktrace() and other incompatible changes #1773

Merged
merged 4 commits into from
May 3, 2018

Conversation

ferd
Copy link
Collaborator

@ferd ferd commented May 3, 2018

Depends on erlware/erlware_commons#130 to succeed

Fixes #1772

@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

To discuss: should we just remove the stacktraces where we can afford it rather than duplicating all of that code?

@tsloughter
Copy link
Collaborator

I published erlware common 1.1.0.

@ferd ferd force-pushed the otp-21-stacktrace-compat branch from dc09c78 to d66a0b2 Compare May 3, 2018 02:46
@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

So the change in rebar3.erl actually breaks the entire stacktrace/crashdump reporting for uncaught errors. So that needs more work.

@ferd ferd changed the title Work around OTP-21 deprecation of get_stacktrace() WIP: Work around OTP-21 deprecation of get_stacktrace() May 3, 2018
@tsloughter
Copy link
Collaborator

Well shit. I thought we must translate an exception to an error tuple somewhere that we could add a match on stacktrace and add it to the tuple, but not seeing where that was done.

Will look more tomorrow.

@tsloughter
Copy link
Collaborator

Oh, you got it, nevermind :)

@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

Yeah. Right now I'm checking stuff and I blew up Dialyzer by probably fat-fingering something. I need some better QA on this.

@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

Alright, I fixed Dialyzer, but rebar3 shell is now tricky because the error_logger:swap_handler(tty) function has been removed with the new logger API, and from what @sirihansen told me today, there is no direct equivalent of it anymore.

We would have a regression on #1158

@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

I manually confirmed that the new logger has no hangup with the group leaders of before, so I rewrote the thing to avoid some problems. Dialyzer will keep complaining about it but for now that seems good enough.

@ferd ferd mentioned this pull request May 3, 2018
@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

So, OTP 20 had a warning preventing the usage of get_stacktrace() outside of a try .. catch expression. Not sure why it ever passed before, but now the code no longer compiles only on that version in rebar3.erl. Will need to dig some more.

@ferd ferd changed the title WIP: Work around OTP-21 deprecation of get_stacktrace() Work around OTP-21 deprecation of get_stacktrace() May 3, 2018
@ferd ferd changed the title Work around OTP-21 deprecation of get_stacktrace() Work around OTP-21 deprecation of get_stacktrace() and other incompatible changes May 3, 2018
@ferd ferd force-pushed the otp-21-stacktrace-compat branch from 3f5076c to 9eb0c55 Compare May 3, 2018 11:15
@ferd
Copy link
Collaborator Author

ferd commented May 3, 2018

Reworked the pull request based off the macros by @okeuday at erlang/otp#1783 (comment) -- I also reordered and squashed commits so they work better in the right order.

@ferd ferd force-pushed the otp-21-stacktrace-compat branch from 9eb0c55 to e321ca6 Compare May 3, 2018 11:18
@ferd ferd merged commit 048dfad into erlang:master May 3, 2018
@ferd ferd deleted the otp-21-stacktrace-compat branch May 3, 2018 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants