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

[Truffle] Add to loadedFeatures before loading #3192

Merged
merged 1 commit into from
Jul 28, 2015

Conversation

bbelleville
Copy link
Contributor

For classloader and core features, add the feature to the collection of
loaded features before performing the load to break endless recursion in
the presence of cyclic dependencies.

This brings the behavior of core and classloader features in line with file features. I am encountering a cyclic dependency when doing ahead of time compilation. Since I include all ruby files in the image, features that would have been resolved as files instead are found with the classloader.

A quick way to expose this issue is to add require_relative 'core.rb' to truffle/src/main/ruby/core.rb.

@bbelleville bbelleville changed the title [truffle] Add to loadedFeatures before loading [Truffle] Add to loadedFeatures before loading Jul 27, 2015
For classloader and core features, add the feature to the collection of
loaded features before performing the load to break endless recursion in
the presence of cyclic dependencies.
@eregon eregon added the truffle label Jul 28, 2015
@eregon eregon added this to the truffle-dev milestone Jul 28, 2015
@eregon
Copy link
Member

eregon commented Jul 28, 2015

Sounds good, this is already how the normal files are loaded,
except that additionally the path is removed from $LOADED_FEATURES if there is an error.
Proper locking around require/load (which needs to be done) should also help to detect this recursion.

eregon added a commit that referenced this pull request Jul 28, 2015
[Truffle] Add to loadedFeatures before loading
@eregon eregon merged commit 6d91894 into jruby:master Jul 28, 2015
@bbelleville bbelleville deleted the load-feature branch August 6, 2015 18:07
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants