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

TravisCI caching and Bundler use the same path for C extensions for different TruffleRuby versions #1715

Closed
eregon opened this issue Jul 5, 2019 · 5 comments
Assignees
Milestone

Comments

@eregon
Copy link
Member

eregon commented Jul 5, 2019

This leads to errors such as:

RuntimeError:
  Global variable rb_tr_true is declared but not defined.

Example build: https://travis-ci.org/socketry/async-websocket/jobs/554414769

We see msgpack is not recompiled (Using msgpack 1.3.0 in the log), even though it was compiled with TruffleRuby 19.0.0 and now reused on TruffleRuby 19.1.0, which doesn't work.

TravisCI caching seems to simply ignore the TruffleRuby version when using:

rvm:
- truffleruby

The cache URLs seem to just consider the value of rvm::

fetching master/cache-linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--rvm-2.6--gemfile-Gemfile.tgz
fetching master/cache-linux-xenial-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855--rvm-truffleruby--gemfile-Gemfile.tgz

This seems like a bug that needs to be fixed in TravisCI.
If RUBY_ENGINE_VERSION was used, then it should work out of the box.

A workaround until this is fixed in the next release is to manually delete the caches on TravisCI.
This is necessary only if having a cache against 19.0.0 and needs to be done only once, as after the cache will be rebuilt against 19.1.0 and the next release will include a fix this.

On the TruffleRuby side, maybe we could try to have a better error in such a case, but that's probably quite difficult to achieve, because we'd need a check before starting to load the C extension.

cc @ioquatix

@eregon
Copy link
Member Author

eregon commented Jul 5, 2019

From that log I see that paths like these are used:

/home/travis/build/socketry/async-websocket/vendor/bundle/truffleruby/2.6.0/gems/rspec-core-3.8.2/exe/rspec

2.6.0 is most likely RbConfig::CONFIG['ruby_version'], which seems to be considered as the binary compatibility/ABI version.
Maybe we should just set RbConfig::CONFIG['ruby_version'] to the TruffleRuby version.

@eregon
Copy link
Member Author

eregon commented Jul 5, 2019

I can reproduce the problem locally, and confirm setting RbConfig::CONFIG['ruby_version'] to the TruffleRuby version solves it for bundle install --path .... I'll do a fix with that.

@eregon eregon added this to the 19.2.0 milestone Jul 5, 2019
@eregon eregon changed the title TravisCI uses the same Bundler cache for C extensions for different TruffleRuby versions TravisCI caching and Bundler use the same path for C extensions for different TruffleRuby versions Jul 5, 2019
graalvmbot pushed a commit that referenced this issue Jul 8, 2019
* See #1715
* Fix path to bundled gems inside the TruffleRuby home.
@eregon
Copy link
Member Author

eregon commented Jul 17, 2019

Fixed by 5ed7adc, at least for the Bundler case.

chruby needs a fix to not reuse the same GEM_HOME for multiple TruffleRuby releases.

@eregon
Copy link
Member Author

eregon commented Jul 17, 2019

Let's track the fix for chruby separately: #1723, and close this issue since it will be fixed in the upcoming release.

@eregon
Copy link
Member Author

eregon commented Aug 23, 2019

TruffleRuby 19.2.0 was released and fixes this bug, please try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant