pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
72 stars 68 forks source link

Install thwait for ruby >= 2.7.x #114

Closed mtchavez closed 4 years ago

mtchavez commented 4 years ago

What

Check for ruby version to see if it is one that no longer includes thwait in the stlib. Install the gem of thwait if it is not in the ruby version. This is needed because ruby 2.7 has removed thwait from the standard library and is now installed via a gem.

Changes


fixes #115

mtchavez commented 4 years ago

Can't tell if this change affects jruby or not by the travis output. Appears to be a build environment concern:

LoadError: library `java' could not be loaded: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to module jruby

1.32s$ gem install bundler -v '< 2'

WARNING: Unknown module: org.jruby.dist specified to --add-opens

WARNING: Unknown module: org.jruby.dist specified to --add-opens

WARNING: Unknown module: org.jruby.dist specified to --add-opens

unsupported Java version "11", defaulting to 1.7

LoadError: library `java' could not be loaded: java.lang.reflect.InaccessibleObjectException: Unable to make protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException accessible: module java.base does not "opens java.lang" to module jruby

The command "gem install bundler -v '< 2'" failed and exited with 1 during .

Your build has been stopped.
bethesque commented 4 years ago

Based on this stackoverflow post, the changes you are proposing won't work https://stackoverflow.com/questions/39346334/manage-gem-dependencies-based-on-ruby-version

We can try making the change without any version restrictions and seeing if everything still works as normal.

mtchavez commented 4 years ago

Updated the code to have thwait as a runtime dependency. Also, I had to add e2mmap as a runtime dependency since it no longer gets bundled with ruby >= 2.7. JRuby on TravisCI still fails, still appears to be a build environment or setup issue that isn't quite related. Let me know if there is something else needed to get it merged in. Thanks

bethesque commented 4 years ago

Removed thwait require, tests pass without it.

mtchavez commented 4 years ago

117 opened to address the issue of requiring it on ruby >= 2.7