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

Test Rake on TruffleRuby #331

Merged
merged 3 commits into from
Nov 26, 2019
Merged

Test Rake on TruffleRuby #331

merged 3 commits into from
Nov 26, 2019

Conversation

eregon
Copy link
Member

@eregon eregon commented Nov 21, 2019

@eregon
Copy link
Member Author

eregon commented Nov 21, 2019

One error on this run: https://github.com/ruby/rake/pull/331/checks?check_run_id=314340711

  1) Error:
TestRakeClean#test_clean:
NoMethodError: undefined method `desc' for #<#<Class:0x5600>:0x33168>
    /home/runner/work/rake/rake/lib/rake/clean.rb:68:in `<top (required)>'
    /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `load'
    /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `block in load'
    /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `each'
    /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `load'
    /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `test_clean'

590 runs, 1629 assertions, 0 failures, 1 errors, 0 skips

@eregon
Copy link
Member Author

eregon commented Nov 21, 2019

The issue seems to be that load "rake/clean.rb", true sets the top-level self to main in MRI, but to some other class instance on TruffleRuby:
https://github.com/oracle/truffleruby/blob/c3845389c4f38e51283b48a1ea3ccdac4962adbf/src/main/java/org/truffleruby/core/kernel/TruffleKernelNodes.java#L108
cc @chrisseaton

@eregon
Copy link
Member Author

eregon commented Nov 21, 2019

That's a trivial fix (use the main object in both cases), and then I can run all rake locally successfully.

We'll need a nightly build of TruffleRuby to test in CI though, or skip that load "rake/clean.rb", true test until then.

@eregon
Copy link
Member Author

eregon commented Nov 21, 2019

It's actually not the same main object but some sort of copy of the normal main, including modules in the singleton class of the original main.

In Ruby terms:

wrap_module = Module.new
new_main = main.clone # make a copy of the singleton class and the methods there
new_main.extend(wrap_module)

@hsbt
Copy link
Member

hsbt commented Nov 21, 2019

@eregon Thanks for your work. I'm okay to merge when CI was fixed.

@eregon
Copy link
Member Author

eregon commented Nov 22, 2019

@hsbt The CI now passes, with that test slightly modified when running on TruffleRuby 19.3.0, is that acceptable? (18508c4)
I think it would be useful to test TruffleRuby in Rake's CI from now, and not need to wait for the next release.

@eregon
Copy link
Member Author

eregon commented Nov 22, 2019

I just merged oracle/truffleruby@f054b32, which fixes load(path, wrap=true) on TruffleRuby.
But that is not part of the 19.3.0 release of course, it will only be in the 20.0.0 release.

@hsbt
Copy link
Member

hsbt commented Nov 26, 2019

@hsbt The CI now passes, with that test slightly modified when running on TruffleRuby 19.3.0, is that acceptable? (18508c4)

👍

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

Successfully merging this pull request may close these issues.

2 participants