-
Notifications
You must be signed in to change notification settings - Fork 183
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
Make load path cache work on TruffleRuby #450
Conversation
3cae6a7
to
d443e4e
Compare
66e3af0
to
f0889ee
Compare
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.
A few nitpicks, but looks mostly OK to me.
bb77e60
to
d531d5a
Compare
e2eb363
to
ba6e82a
Compare
assert_same path, internal_path | ||
|
||
if truffleruby? | ||
assert_equal path, internal_path |
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.
Is this comparison different from CRuby due to oracle/truffleruby#3138?
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.
no, i haven't filed an issue on truffleruby for it yet, but on CRuby $LOADED_FEATURES.last
is the same (frozen) string object, but on TruffleRuby this is not the case (it's a different string object, not frozen).
Load Path Cache can work on the latest TruffleRuby (23.1.0 is due out in September) and offers a small speedup on an example project.
It does require an unreleased bug fix (oracle/truffleruby#3131)
so I added
truffleruby-head
to CI to prove that it works on both the current and the next release.I used a string comparison on
RUBY_ENGINE_VERSION < "23.1.0"
to do that checkwhich is consistent with other
RUBY_VERSION >= "2.7"
style comparisons used in this repoand I think will work for the foreseeable future.
A few kernel tests are skipped due to oracle/truffleruby#3138.
A few test assertions had to be changed from "same" to "equal"
to account for TruffleRuby making copies of the strings that end up in
$LOADED_FEATURES
.TruffleRuby also has a long string prefix on "builtin" features, so i added a bit of code to strip that off
so that the rest of the code is consistent. Does that make sense?