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

Preserve more information about unreachable symbols #3537

Conversation

WojciechMazur
Copy link
Contributor

When working on #3532 I've found out that current unreachable symbols don't contain information about argument/result types of unreachable symbol. This made debuggin harder, when the issue were the differencing argument type lists.
This PR improves unreachable symbols stacktraces by adding more information, and adapts the backtrace loggin to use additional informaiton. It also improves formatting of backtraces to make them more readable.

image

val (name, typeInfo) =
if (argTypes.nonEmpty) descriptor.splitAt(descriptor.indexOf("("))
else (descriptor, "")
modifiers -> s"$BOLD$YELLOW$name$RESET$typeInfo at $BOLD$filename:$line"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think AnsiColor respects the various colour disabling env flags (see https://no-color.org/ and https://clig.dev/#output in general), but it'd be good to respect the env variable (+ whatever color information the build tool can give us) so that the output of the build tooling can be processed easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the other build tools, but running sbt with --color=false is able to filter out all ANSI modifiers on its own. I'm not sure if we're able to disable colors in scala-cli at all.
Anyway I'll the NO_COLOR env variable to allow for disabling coloring

@WojciechMazur WojciechMazur merged commit 5b617a4 into scala-native:main Oct 6, 2023
80 of 81 checks passed
@WojciechMazur WojciechMazur deleted the feature/more-details-for-unreachable-symbols branch October 6, 2023 09:22
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.

None yet

2 participants