-
Notifications
You must be signed in to change notification settings - Fork 193
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
OS 3.8 broke json-schema validation #5208
Comments
Maybe it's as simple as updating the gem? The OS CLI has json-schema 2.7.0 which was released in 2016 (!!). The latest version is 4.3.0. I see that 2.7.0 doesn't support ruby 3. |
Take a really quick deep dive, this old-dated package comes from:
https://github.com/rd2/tbd/blob/develop/tbd.gemspec#L33 |
|
@shorowit Tell that to openstudio-standards. This is used for BTAP / NECB. The Canadian codes take thermal bridging into account. |
Also, this works fine if you read the error message and just reorder the imports -openstudio -e 'require "json-schema"; require "stringio"; ...
+openstudio -e 'require "stringio"; require "json-schema"; ... I'm not saying the StringIO thing isn't an issue. It's one I had already encountered outside of this gem I think. But also, that's because the gem uses StringIO and doesn't actually require 'stringio', cf https://github.com/voxpupuli/json-schema/blob/4aed27d505aa3e31445bf60e0718203af2d40f5f/lib/json-schema/validator.rb#L441 . I think it works on regular ruby but not on ours because of the static initialization we have. Perhaps we're missing an Init_ call somewhere. Anyways, I opened an upstream PR at voxpupuli/json-schema#512 |
The easiest might just be to do the same as here: OpenStudio/ruby/engine/openstudio_cli.rb Line 45 in cdee54c
eg put it here: OpenStudio/ruby/bindings/InitRubyBindings.cpp Line 474 in cdee54c
There is a "Init_stringio" https://github.com/ruby/ruby/blob/e51014f9c05aa65cbf203442d37fef7c12390015/ext/stringio/stringio.c#L1864 Except it is supposedly called already via ext/extinit.c. On my mac:
|
Addresses #5208, OS 3.8 broke json-schema validation
Issue overview
OpenStudio 3.7 works (validation error returned):
OpenStudio 3.8 fails (ruby exception):
The text was updated successfully, but these errors were encountered: