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

IRB Debug Init + byebug #5165

Merged
merged 3 commits into from
Apr 25, 2024
Merged

IRB Debug Init + byebug #5165

merged 3 commits into from
Apr 25, 2024

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Apr 23, 2024

Pull request overview

  • Opening as Draft because I'm not sure this is going to be wanted

This PR does two things:

  • When loglevel is Trace, it preloads the IRB code so you can put binding.irb anywhere and it'll work. That includes inside our gem initialization code, but will work in any external script too. This allows you to inspect variables, but you don't have frame execution, because "debug" gem is built shared actually... see Bundled gems by default: debug and rbs aren't built statically jmarrec/conan-recipes#6
  • After initialization is done, meaning in an external script for eg, you can require 'byebug' and put byebug and this will allow you to have frame execution, see this example

byebug

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@jmarrec jmarrec requested a review from kbenne April 23, 2024 15:35
@jmarrec jmarrec self-assigned this Apr 23, 2024
@jmarrec jmarrec added the Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. label Apr 23, 2024
@kbenne
Copy link
Contributor

kbenne commented Apr 23, 2024

@jmarrec. This would be very useful for the kind of issues we just worked through with bundler. I'm sure that was part of the inspiration. What would be the downside of merging this? It seems like a win/win.

@jmarrec
Copy link
Collaborator Author

jmarrec commented Apr 23, 2024

Downsides include:

  • people who do ask for trace loglevel get code they don't need (they will not notice and noone asks for trace level output unless they're in trouble so big they wouldn't care), so noop here
  • byebug is a new native ext gem

@jmarrec jmarrec marked this pull request as ready for review April 24, 2024 17:45
Copy link
Contributor

@kbenne kbenne left a comment

Choose a reason for hiding this comment

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

@jmarrec I just made a new release of openstudio-gems on the NREL repo. Would you mind updating the references to point at the NREL release?

@jmarrec
Copy link
Collaborator Author

jmarrec commented Apr 25, 2024

Will do

@@ -835,7 +835,7 @@ if(BUILD_CLI)
set(OPENSTUDIO_GEMS_BASEURL "http://openstudio-resources.s3.amazonaws.com/dependencies")

# TODO: temp
set(OPENSTUDIO_GEMS_BASEURL "https://github.com/NREL/openstudio-gems/releases/download/v3.8.0-RC1-5")
set(OPENSTUDIO_GEMS_BASEURL "https://github.com/NREL/openstudio-gems/releases/download/v3.8.0-RC1-6")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kbenne done

@kbenne kbenne merged commit 5a7c9c3 into develop Apr 25, 2024
2 of 5 checks passed
@kbenne kbenne deleted the irb_debug_init branch April 25, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - CLI component - Ruby bindings Enhancement Request Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants