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

OpenStudioCLI.Classic.Run_RubyOnly Test fails on Ruby 3.2.2 #5157

Open
kbenne opened this issue Apr 19, 2024 · 5 comments
Open

OpenStudioCLI.Classic.Run_RubyOnly Test fails on Ruby 3.2.2 #5157

kbenne opened this issue Apr 19, 2024 · 5 comments
Assignees
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed

Comments

@kbenne
Copy link
Contributor

kbenne commented Apr 19, 2024

This is the important part of the test (failure) output.

3748: Error executing argv: ["run", "-w", "/home/kbenne/Development/OpenStudio/build/resources/Examples/compact_osw/compact_ruby_only.osw"]
3748: Error: :/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/util/energyplus.rb:353: can't find string "HEREDOC" anywhere before EOF
3748: :/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/util/energyplus.rb:353: syntax error, unexpected end-of-input
3748:           <<~HEREDOC

I think the issue is that the workflow gem uses a HEREDOC where the closing tag is at the end of a line, instead of on a new line. My guess is that ruby 3.2.2 does not tolerate this.

Here is the relevant part of the WFG.

This issue could also be filed on the WFG repo, but since the test is failing from OpenStudio I'm just putting the issue up here.

@kbenne kbenne added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Apr 19, 2024
@kbenne kbenne self-assigned this Apr 19, 2024
@kbenne kbenne added this to the OpenStudio SDK 3.8.0 milestone Apr 19, 2024
kbenne added a commit to NREL/OpenStudio-workflow-gem that referenced this issue Apr 19, 2024
@kbenne
Copy link
Contributor Author

kbenne commented Apr 19, 2024

I think there is a second issue after addressing the HEREDOC. This one might stem from a mixup between fileutiles included with ruby and the bundled gem version of fileutiles. (I think both are present in the context of OpenStudio, but I'm not sure)

Here is the callstack of the error...

3748: [22:18:31.824609 ERROR] Found error in state 'translator' with message ["wrong number of arguments (given 3, expected 2)::/ruby/3.2.0/fileutils.rb:883:in cp'\neval:763:in cp'\neval:767:in copy'\n:/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/jobs/run_translation.rb:34:in perform'\n:/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/run.rb:261:in step'\n:/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/run.rb:203:in run'\n:/openstudio_cli.rb:1197:in execute'\n:/openstudio_cli.rb:827:in execute'\n:/openstudio_cli.rb:1994:in <main>'\neval:233:in eval'\neval:233:in require_embedded_absolute'\neval:218:in block in require_embedded'\neval:212:in each'\neval:212:in require_embedded'\neval:171:in require'\neval:3:in

'"]}

@kbenne
Copy link
Contributor Author

kbenne commented Apr 19, 2024

@DavidGoldwasser @wenyikuang @jmarrec I'm working on getting all of the ruby tests passing and this is on the critical path.

@jmarrec
Copy link
Collaborator

jmarrec commented Apr 19, 2024

What the heck?

wrong number of arguments (given 3, expected 2)::/ruby/3.2.0/fileutils.rb:883:in `cp'
eval:763:in `cp'                                                                                                                                     
eval:767:in `copy'                                                                                                                                   
:/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/jobs/run_translation.rb:33:in `perform'                                          
:/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/run.rb:261:in `step'                                                             
:/ruby/3.2.0/gems/openstudio-workflow-2.4.0/lib/openstudio/workflow/run.rb:203:in `run'
:/openstudio_cli.rb:1197:in `execute'        
:/openstudio_cli.rb:827:in `execute'         
:/openstudio_cli.rb:1994:in `<main>'         
eval:233:in `eval'                           
eval:233:in `require_embedded_absolute'      
eval:218:in `block in require_embedded'
eval:212:in `each'
eval:212:in `require_embedded'
eval:171:in `require'
eval:3:in `<main>'

https://github.com/NREL/OpenStudio-workflow-gem/blob/d9f87b803c622aa6c45029a133f52f3a5c6bb0bc/lib/openstudio/workflow/jobs/run_translation.rb#L33

      FileUtils.copy(@registry[:wf], "#{@registry[:run_dir]}/in.epw")

@jmarrec
Copy link
Collaborator

jmarrec commented Apr 19, 2024

Found it... Another awful thing we had to patch and that's broken with ruby 3

6525992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed
Projects
None yet
Development

No branches or pull requests

2 participants