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

openstudio classic measure -s is broken (measure manager using classic CLI) in 3.8.0 #5212

Closed
jmarrec opened this issue May 27, 2024 · 11 comments · Fixed by #5283
Closed

openstudio classic measure -s is broken (measure manager using classic CLI) in 3.8.0 #5212

jmarrec opened this issue May 27, 2024 · 11 comments · Fixed by #5283

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented May 27, 2024

Issue overview

The measure manager in the classic CLI is broken in 3.8.0

Current Behavior

$ openstudio --version
3.8.0+f953b6fcaf
$ openstudio classic measure -s 8091
┌────────────────────────────────────────────────────────────────────────────────┐
│  The `classic` command is deprecated and will be removed in a future release   │
└────────────────────────────────────────────────────────────────────────────────┘
Error executing argv: ["measure", "-s", "8091"]
Error: cannot load such file -- webrick in eval:182:in `require'

Expected Behavior

It should work.

Possible Solution

webrick gem was removed from the standard library in Ruby 3. So it should be part of the openstudio-gems Gemfile. Or the classic subcommand should be removed.

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/

The following libraries are no longer bundled gems or standard libraries. Install the corresponding gems to use these features.
sdbm, webrick, net-telnet, xmlrpc

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): all
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.8.0

Context

Found in OpenStudioApplication at openstudiocoalition/OpenStudioApplication#714 (comment)

@jmarrec jmarrec added Triage Issue needs to be assessed and labeled, further information on reported might be needed component - CLI component - Measure Manager and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed labels May 27, 2024
@macumber
Copy link
Contributor

I think even the non-classic CLI has some issues in 3.8.0, it fails to infer measure name for the OpenStudio Results measure.

@jmarrec
Copy link
Collaborator Author

jmarrec commented May 27, 2024

@macumber No, that's a combination of:

  1. The openstudio-extension gem was gutted down after we moved stuff to the C++ side
  2. The OpenStudioApp is using an outdated measure (but I haven't checked if @DavidGoldwasser released an updated one)

The actual error:

$ cd OpenStudioApplication/src/openstudio_app/Resources/openstudio_results
$ openstudio measure -u .

Failed to infer measure name from /Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/./measure.rb: LoadError: cannot load such file -- openstudio/extension/core/os_lib_schedules
location=["eval:182:in `require'", "eval:182:in `require'", "<internal::/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'", "/Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/measure.rb:11:in `<top (required)>'", "eval:8:in `load'", "eval:8:in `<main>'"]

Traceback:
eval:182:in `require'
eval:182:in `require'
<internal::/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/measure.rb:11:in `<top (required)>'
eval:8:in `load'
eval:8:in `<main>'
className=
Failed to infer measure name from '/Users/julien/Software/Others/OpenStudioApplication/src/openstudio_app/Resources/openstudio_results/./measure.rb'

@DavidGoldwasser
Copy link
Collaborator

I'll try to get all the measures up to ruby.gems and BCL by the end of the week. My attempt to be productive while at SimBuild last week didn't work.

@jmarrec
Copy link
Collaborator Author

jmarrec commented Jun 11, 2024

@DavidGoldwasser Are you still working on NREL/openstudio-common-measures-gem#169 ?

We'd like for openstudio-results at least to be updated, since the OSApp ships it by default and it breaks users that chose to enable the "classic" CLI.

@macumber
Copy link
Contributor

macumber commented Jul 4, 2024

These gbxml measures seem to be affected too: https://github.com/NREL/gbxml-to-openstudio

@MatthewSteen
Copy link
Member

MatthewSteen commented Jul 5, 2024

Apparently not yet;: https://github.com/NREL/openstudio-common-measures-gem/blob/473f9e7df50014262f21231e524f1510bcfae985/lib/measures/openstudio_results/measure.rb#L11

But should soon, this PR seem to have it: https://github.com/NREL/openstudio-common-measures-gem/pull/169/files#diff-f17e661c254a9015bada9e2f41b56572513c4d93ba52eebbe12c9c4a46247f93L9

These gbxml measures seem to be affected too: https://github.com/NREL/gbxml-to-openstudio


These changes were included in https://github.com/NREL/gbxml-to-openstudio/releases/tag/v1.2.0, which was tested and works. We (and Autodesk) don't use the classic or measure -s args, just openstudio run -w.

@DavidGoldwasser
Copy link
Collaborator

@jmarrec plan to have updated measures including OpenStudio Results released and on BCL soon.

@macumber
Copy link
Contributor

@MatthewSteen I get this on the gbxml_import_advanced measure

c:\openstudio-3.8.0\bin\openstudio.exe measure -a C:\test\untitled.osm gbxml_import_advanced
> Failed to infer measure name from C:/repos/gbxml-to-openstudio/measures/gbxml_import_advanced/measure.rb: NoMethodError: undefined method `ancestors' for 0.05:Float

I see a similar error when dragging the gbxml_import_hvac measure into the 1.8.0 version of the OpenStudio Application. That one occurs because gbxml_import_hvac.rb is not in the resources directory so doesn't get copied over.

@MatthewSteen
Copy link
Member

@macumber ok, thanks. We haven't experienced this error with the Autodesk workflow, but I will take a look and try to resolve what we can in the gbxml-to-openstudio repo. FYI these measures are not (currently) intended to be used with the OpenStudio Application, hence they're not on the BCL.

@kbenne
Copy link
Contributor

kbenne commented Oct 24, 2024

@wenyikuang can you look at my PR to bring in webrick? I think this should address the issue once we pull in the new openstudio-gems to the main openstudio project.

kbenne added a commit that referenced this issue Oct 25, 2024
This change brings in webrick via openstudio-gems. Previous versions of
Ruby included webrick as part of the standard package, but it was
removed and when that happened our "classic" implementation of the
Measure Manager was broken.

This change enables `openstudio classic measure -s`

close #5212
@kbenne kbenne mentioned this issue Oct 25, 2024
19 tasks
jmarrec pushed a commit that referenced this issue Oct 29, 2024
This change brings in webrick via openstudio-gems. Previous versions of
Ruby included webrick as part of the standard package, but it was
removed and when that happened our "classic" implementation of the
Measure Manager was broken.

This change enables `openstudio classic measure -s`

close #5212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment