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

Support --backtrace-limit in RUBYOPT, allow -1 as value, and add it to man page #8010

Merged
merged 4 commits into from Jul 15, 2023

Conversation

tomstuart
Copy link
Contributor

The --backtrace-limit option is not currently allowed to appear in the RUBYOPT environment variable, but that appears to be a mistake. Unlike other long options which are not allowed in RUBYOPT (e.g. --copyright, --version, --dump and --help) it does not cause the interpreter to terminate, and cannot cause harm if read from the environment. During the initial discussion about the --backtrace-limit feature, Matz suggested that he expected RUBYOPT to allow this option.

The --backtrace-limit option should also allow a value of -1 since that is legitimate (and the default), and be documented on Ruby’s man page.

@tomstuart
Copy link
Contributor Author

I’ve rebased this onto #8068 and added @nobu’s test.

tomstuart and others added 4 commits July 15, 2023 23:49
There’s no reason to prevent RUBYOPT from controlling the backtrace
limit. In fact, Matz said [0] he was expecting this to be possible.

[0] https://bugs.ruby-lang.org/issues/8661#note-27
Co-authored-by: Tom Stuart <hi@tomstu.art>
-1 is a legitimate backtrace limit — in fact, it’s the default — so it
should be possible to provide it with the `--backtrace-limit` option.
@nobu nobu merged commit c32b608 into ruby:master Jul 15, 2023
89 checks passed
@tomstuart tomstuart deleted the backtrace-limit-fixes branch July 23, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants