Skip to content

RuboCop dependency issues via measure tester gem #5370

@DavidGoldwasser

Description

@DavidGoldwasser

Issue overview

Impacting URBANopt and may impact other downstream internal and external tools as well.

Current Behavior

Email thread for background

From Nicholas:
I think it works because there were a few gems that we build for packaging, and I am pretty sure that JSON was one of those. I don’t know why there is a just version of rubocop though.

If we move measure tester’s JSON dependency to be a development dependency, then it will just mean that windows users will have to install DevKit, which we didn’t want to do. That way a measure developer could still run tests without having to deal with the nightmare of DevKit (but maybe that has improved).

From Katherine

When we run a UO project, we have a Gemfile in the project directly and the OpenStudio CLI installs that Gemfile. This is done via OpenStudio’s ruby when users use the UO installer which packages OS and Ruby…

The Gemfile lists a bunch of the OpenStudio measure gems, which all depend on OpenStudio extension gem.

OpenStudio extension gem has a dependency on OpenStudio Measure tester gem.

Measure-tester-gem in turn depends on robocop 1.50. Rubocop has a json dependency that has a native gem extension and must be compiled.

This famously does not work with OpenStudio unless we package OpenStudio with the gem ahead of time.

I am curious to understand how OpenStudio is packaging openstudio-measure-tester without issues. And why Julien made its’ own fork of robocop:

https://github.com/NREL/openstudio-gems/commit/0e84b9a21307c7e513a71ca95487a1e7c1d27d27

This seemed to fix the issue with measure tester gem’s json dependency(ies). But it’s not working outside the box for the UO workflow.

I found the following workaround for the UO workflow:

https://github.com/NREL/OpenStudio-measure-tester-gem/tree/remove-json-gem

This makes the 3 rubocop dependencies development dependencies, so they will not be installed at runtime when we run the UO workflow. I am not 100% on the implications of this change for OpenStudio though, and for the OpenStudio CLI update_measures call.

Long, Nicholas, what are your thoughts here? How did this ever work without shipping the native extension json with OpenStudio??

Expected Behavior

Steps to Reproduce

Require these gems from OpenStudio's Ruby
https://github.com/NREL/OpenStudio-measure-tester-gem/blob/develop/openstudio_measure_tester.gemspec#L37-L39

Possible Solution

Details

Environment

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

  • Platform (Operating system, version): I believe it impacts all platforms
  • Version of OpenStudio (if using an intermediate build, include SHA): At least OS 3.8 and 3.9

Context

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions