-
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
Fix #5315 - OpenStudio CLI unable to require uuid in OpenStudio 3.9 (thereby breaking dependencies like openstudio-extension) #5316
base: develop
Are you sure you want to change the base?
Conversation
# Test for 5315 | ||
add_test(NAME OpenStudioCLI.EmbeddedScripting.uuid | ||
COMMAND $<TARGET_FILE:openstudio> ${CMAKE_CURRENT_SOURCE_DIR}/test/ensure_uuid_can_be_loaded.rb | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before fix on on Windows:
Start 3757: OpenStudioCLI.EmbeddedScripting.uuid
3757: Test command: C:\src\OpenStudio\build-release\Products\openstudio.exe "C:/src/OpenStudio/src/cli/test/ensure_uuid_can_be_loaded.rb"
3757: Working Directory: C:/src/OpenStudio/build-release/src/cli
3757: Test timeout computed to be: 1500
3757:
3757: NoMethodError: undefined method `flock' for #<StringIO:0x0000021f46ae7380>
3757: Backtrace:
3757: :/ruby/3.2.0/rubygems.rb:788:in `block in open_file'
3757: eval:464:in `open'
3757: :/ruby/3.2.0/rubygems.rb:785:in `open_file'
3757: :/ruby/3.2.0/rubygems/specification.rb:1158:in `load'
3757: :/ruby/3.2.0/gems/uuid-2.3.9/lib/uuid.rb:66:in `<module:Version>'
3757: :/ruby/3.2.0/gems/uuid-2.3.9/lib/uuid.rb:65:in `<class:UUID>'
3757: :/ruby/3.2.0/gems/uuid-2.3.9/lib/uuid.rb:62:in `<main>'
3757: eval:236:in `eval'
3757: eval:236:in `require_embedded_absolute'
3757: eval:221:in `block in require_embedded'
3757: eval:215:in `each'
3757: eval:215:in `require_embedded'
3757: eval:190:in `rescue in require'
3757: eval:184:in `require'
3757: <internal::/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
3757: C:/src/OpenStudio/src/cli/test/ensure_uuid_can_be_loaded.rb:1:in `<top (required)>'
3757: eval:182:in `require'
3757: eval:182:in `require'
3757: <internal::/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
3757: eval:4:in `<main>'
3757: Failed to execute 'C:/src/OpenStudio/src/cli/test/ensure_uuid_can_be_loaded.rb'
1/1 Test #3757: OpenStudioCLI.EmbeddedScripting.uuid ...***Failed 2.67 sec
ruby/engine/embedded_help.rb
Outdated
# We patch Kernel.open, and IO.open | ||
# to read embedded files as a StringIO, not as a FileIO | ||
# But Gem.open_file for eg expects it to be a File, not a StringIO, and on | ||
# Windows it will call File::flock (file lock) to protect access, but StringIO | ||
# does not have this method | ||
class FakeFileAsStringIO < StringIO | ||
def flock | ||
return 0 | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Kernel.open and IO.open, when we returned a StringIO, we now return this FakeFileAsStringIO which will have the flock method...
@wenyikuang concerned that the Windows hapilly reports green, when in reality tests have failed here. |
CI Results for d382214:
|
Hi Julien, @jmarrec You mean these ones:
Right? |
Way more than these on this commit: The test I just added failed. All of workflow based ones have been failing silently since before 3.9.0 (I fixed the add_dll_directory on this PR after realizing).
|
Pull request overview
require uuid
in OpenStudio 3.9 (thereby breaking dependencies like openstudio-extension) #5315Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.