Skip to content

Merge -Xno-decode-stacktraces with -Xno-enrich-error-messages #22208

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

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ private sealed trait XSettings:
val XreadComments: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xread-docs", "Read documentation from tasty.")

/** Area-specific debug output */
val XnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.")
val XnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.")
val XnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.", aliases = List("Xno-decode-stacktraces"))
val XdebugMacros: Setting[Boolean] = BooleanSetting(AdvancedSetting, "Xdebug-macros", "Show debug info when quote pattern match fails")

/** Pipeline compilation options */
Expand Down Expand Up @@ -487,7 +486,7 @@ private sealed trait YSettings:
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
val YreadComments: Setting[Boolean] = BooleanSetting(ForkSetting, "Yread-docs", "Read documentation from tasty.", deprecation = Deprecation.renamed("-Xread-docs"))
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
val YnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.", deprecation = Deprecation.renamed("-Xno-decode-stacktraces"))
val YnoDecodeStacktraces: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-decode-stacktraces", "Show raw StackOverflow stacktraces, instead of decoding them into triggering operations.", deprecation = Deprecation.renamed("-Xno-enrich-error-messages"))
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
val YnoEnrichErrorMessages: Setting[Boolean] = BooleanSetting(ForkSetting, "Yno-enrich-error-messages", "Show raw error messages, instead of enriching them with contextual information.", deprecation = Deprecation.renamed("-Xno-enrich-error-messages"))
@deprecated(message = "Lifted to -X, Scheduled for removal.", since = "3.5.0")
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/TypeErrors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extends TypeError:
em"""Recursion limit exceeded.
|Maybe there is an illegal cyclic reference?
|If that's not the case, you could also try to increase the stacksize using the -Xss JVM option.
|For the unprocessed stack trace, compile with -Xno-decode-stacktraces.
|For the unprocessed stack trace, compile with Xno-enrich-error-messages.
|A recurring operation is (inner to outer):
|${opsString(mostCommon).stripMargin}"""

Expand All @@ -137,7 +137,7 @@ object handleRecursive:
e

def apply(op: String, details: => String, exc: Throwable, weight: Int = 1)(using Context): Nothing =
if ctx.settings.XnoDecodeStacktraces.value then
if ctx.settings.XnoEnrichErrorMessages.value then
throw exc
else exc match
case _: RecursionOverflow =>
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
}
catch
case ex: Throwable =>
if !ctx.settings.XnoDecodeStacktraces.value
if !ctx.settings.XnoEnrichErrorMessages.value
&& handleRecursive.underlyingStackOverflowOrNull(ex) != null then
throw StackSizeExceeded(mdef)
else
Expand Down Expand Up @@ -941,7 +941,7 @@ class TreePickler(pickler: TastyPickler, attributes: Attributes) {
em"""Recursion limit exceeded while pickling ${ex.mdef}
|in ${ex.mdef.symbol.showLocated}.
|You could try to increase the stacksize using the -Xss JVM option.
|For the unprocessed stack trace, compile with -Xno-decode-stacktraces.""",
|For the unprocessed stack trace, compile with -Xno-enrich-error-messages.""",
ex.mdef.srcPos)

def missing = forwardSymRefs.keysIterator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ScalaSettingsTests:
createTestCase(settings.YdropComments , settings.XdropComments),
createTestCase(settings.YcookComments , settings.XcookComments),
createTestCase(settings.YreadComments , settings.XreadComments),
createTestCase(settings.YnoDecodeStacktraces , settings.XnoDecodeStacktraces),
createTestCase(settings.YnoDecodeStacktraces , settings.XnoEnrichErrorMessages),
createTestCase(settings.YnoEnrichErrorMessages, settings.XnoEnrichErrorMessages),
createTestCase(settings.YdebugMacros , settings.XdebugMacros),
// createTestCase(settings.YjavaTasty , settings.XjavaTasty),
Expand Down Expand Up @@ -134,7 +134,7 @@ class ScalaSettingsTests:
createTestCase(settings.YdropComments , settings.XdropComments),
createTestCase(settings.YcookComments , settings.XcookComments),
createTestCase(settings.YreadComments , settings.XreadComments),
createTestCase(settings.YnoDecodeStacktraces , settings.XnoDecodeStacktraces),
createTestCase(settings.YnoDecodeStacktraces , settings.XnoEnrichErrorMessages),
createTestCase(settings.YnoEnrichErrorMessages, settings.XnoEnrichErrorMessages),
createTestCase(settings.YdebugMacros , settings.XdebugMacros),
// createTestCase(settings.YjavaTasty , settings.XjavaTasty),
Expand Down Expand Up @@ -175,7 +175,7 @@ class ScalaSettingsTests:
createTestCase(settings.YdropComments , settings.XdropComments),
createTestCase(settings.YcookComments , settings.XcookComments),
createTestCase(settings.YreadComments , settings.XreadComments),
createTestCase(settings.YnoDecodeStacktraces , settings.XnoDecodeStacktraces),
createTestCase(settings.YnoDecodeStacktraces , settings.XnoEnrichErrorMessages),
createTestCase(settings.YnoEnrichErrorMessages, settings.XnoEnrichErrorMessages),
createTestCase(settings.YdebugMacros , settings.XdebugMacros),
// createTestCase(settings.YjavaTasty , settings.XjavaTasty),
Expand Down
2 changes: 1 addition & 1 deletion tests/neg/i2887b.check
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| Recursion limit exceeded.
| Maybe there is an illegal cyclic reference?
| If that's not the case, you could also try to increase the stacksize using the -Xss JVM option.
| For the unprocessed stack trace, compile with -Xno-decode-stacktraces.
| For the unprocessed stack trace, compile with Xno-enrich-error-messages.
| A recurring operation is (inner to outer):
|
| try to instantiate Z[Z]
Expand Down
Loading