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

Display the actual error when testing for Ruby's openssl extension #2223

Merged
merged 4 commits into from
Aug 3, 2023

Conversation

YellowApple
Copy link
Contributor

I was encountering some build issues on MicroOS and needed the actual exception message in order to pinpoint a workaround.

I was encountering some build issues on MicroOS and needed the actual exception message in order to pinpoint a workaround.
@YellowApple
Copy link
Contributor Author

(The specific error and workaround, in case anyone's curious: rvm/rvm#3150 (comment))

Copy link
Member

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Hi, thank you for the contribution, but I do not believe that including the LoadError error message will meaningfully improve output for scenarios in which extensions failed to compile. In order to debug a failed extension, it's best to view the extension compilation log instead of just observing the error message. In the future, we might surface the locations of those logs better in ruby-build output, but for now, I'm opting to leave the LoadError output as-is.

@mislav mislav closed this Aug 1, 2023
@YellowApple
Copy link
Contributor Author

YellowApple commented Aug 1, 2023

The problem is that the extension compiles "successfully", so there is no indication in the compilation log that something went wrong; the change in the PR was the only way to identify the issue, because it only appeared when trying to load the already-compiled extension.

That is: the error I was troubleshooting was a runtime error, not a build-time error, so this change to retrieve and display the actual output from the LoadError was necessary to diagnose it.

Given this, is there a better place the actual failure reason should be surfaced? Or could/should we reword "The Ruby #{lib} extension was not compiled." to be more accurate (e.g. "There was a problem loading the Ruby #{lib} extension; make sure it compiled successfully.")?

@mislav
Copy link
Member

mislav commented Aug 1, 2023

The problem is that the extension compiles "successfully", so there is no indication in the compilation log that something went wrong

That's a good point; thanks.

Or could/should we reword "The Ruby #{lib} extension was not compiled." to be more accurate (e.g. "There was a problem loading the Ruby #{lib} extension; make sure it compiled successfully.")?

I like this idea! You are welcome to further amend your PR.

@mislav mislav reopened this Aug 1, 2023
@YellowApple
Copy link
Contributor Author

I like this idea! You are welcome to further amend your PR.

Done 👍

Copy link
Member

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Thanks! After some deliberation, I've shortened the error message further. I plan to soon make an overhaul of this whole check process to make the output even clearer, but for now, I hope that the addition of the actual error message helps.

@mislav mislav merged commit f170c16 into rbenv:master Aug 3, 2023
4 checks passed
@YellowApple
Copy link
Contributor Author

Looks good, thanks!

@YellowApple YellowApple deleted the patch-1 branch August 3, 2023 16:57
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