Skip to content

Test Rake on TruffleRuby#331

Merged
hsbt merged 3 commits into
ruby:masterfrom
eregon:test-truffleruby
Nov 26, 2019
Merged

Test Rake on TruffleRuby#331
hsbt merged 3 commits into
ruby:masterfrom
eregon:test-truffleruby

Conversation

@eregon

@eregon eregon commented Nov 21, 2019

Copy link
Copy Markdown
Member

@eregon

eregon commented Nov 21, 2019

Copy link
Copy Markdown
Member Author

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

eregon commented Nov 21, 2019

Copy link
Copy Markdown
Member Author

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

eregon commented Nov 21, 2019

Copy link
Copy Markdown
Member Author

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

eregon commented Nov 21, 2019

Copy link
Copy Markdown
Member Author

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

hsbt commented Nov 21, 2019

Copy link
Copy Markdown
Member

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

@eregon

eregon commented Nov 22, 2019

Copy link
Copy Markdown
Member Author

@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

eregon commented Nov 22, 2019

Copy link
Copy Markdown
Member Author

I just merged truffleruby/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

hsbt commented Nov 26, 2019

Copy link
Copy Markdown
Member

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants