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

truffleruby is broken with rake test suite #1739

Closed
hsbt opened this issue Aug 19, 2019 · 8 comments
Closed

truffleruby is broken with rake test suite #1739

hsbt opened this issue Aug 19, 2019 · 8 comments

Comments

@hsbt
Copy link

hsbt commented Aug 19, 2019

HI, I would like to support truffleruby in rake.

I try to add truffleruby provided by RVM in GitHub Actions. But I got the test failure like this:

https://github.com/ruby/rake/runs/196971401#step:6:5

I'm not sure why that has happened. It's great to resolve at the next version of truffleruby.

Thanks,

@chrisseaton
Copy link
Collaborator

There's two failures here

2019-08-19T11:48:57.4884841Z   1) Error:
2019-08-19T11:48:57.4884892Z TestRakeFileUtils#test_sh_with_hash_option:
2019-08-19T11:48:57.4884956Z RuntimeError: Unknown spawn option: chdir
2019-08-19T11:48:57.4885308Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `block in posix_spawnp'
2019-08-19T11:48:57.4885535Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `each_pair'
2019-08-19T11:48:57.4885702Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `posix_spawnp'
2019-08-19T11:48:57.4886096Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `spawn'
2019-08-19T11:48:57.4886305Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `spawn'
2019-08-19T11:48:57.4886461Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `spawn'
2019-08-19T11:48:57.4886640Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `system'
2019-08-19T11:48:57.4886795Z     /home/runner/work/rake/rake/lib/rake/file_utils.rb:54:in `sh'
2019-08-19T11:48:57.4886972Z     /home/runner/work/rake/rake/test/test_rake_file_utils.rb:189:in `block in test_sh_with_hash_option'
2019-08-19T11:48:57.4887151Z     /home/runner/work/rake/rake/lib/rake/file_utils_ext.rb:59:in `verbose'
2019-08-19T11:48:57.4887325Z     /home/runner/work/rake/rake/test/test_rake_file_utils.rb:188:in `test_sh_with_hash_option'
2019-08-19T11:48:57.4887358Z 
2019-08-19T11:48:57.4887397Z   2) Error:
2019-08-19T11:48:57.4887451Z TestRakeClean#test_clean:
2019-08-19T11:48:57.4887501Z RuntimeError: <no message> (UnsupportedOperationException)
2019-08-19T11:48:57.4887552Z 	from org.truffleruby.core.kernel.TruffleKernelNodes$LoadNode.load(TruffleKernelNodes.java:75)
2019-08-19T11:48:57.4887623Z 	from org.truffleruby.core.kernel.TruffleKernelNodesFactory$LoadNodeFactory$LoadNodeGen.executeAndSpecialize(TruffleKernelNodesFactory.java:225)
2019-08-19T11:48:57.4887683Z 	from org.truffleruby.core.kernel.TruffleKernelNodesFactory$LoadNodeFactory$LoadNodeGen.execute(TruffleKernelNodesFactory.java:207)
2019-08-19T11:48:57.4887735Z 	from org.truffleruby.language.control.SequenceNode.execute(SequenceNode.java:34)
2019-08-19T11:48:57.4887964Z 	from org.truffleruby.language.methods.ExceptionTranslatingNode.execute(ExceptionTranslatingNode.java:51)
2019-08-19T11:48:57.4888001Z 	from org.truffleruby.language.RubyRootNode.execute(RubyRootNode.java:54)
2019-08-19T11:48:57.4888035Z 	from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(OptimizedCallTarget.java:328)
2019-08-19T11:48:57.4888101Z 	from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot(OptimizedCallTarget.java:318)
2019-08-19T11:48:57.4888139Z 	from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:305)
2019-08-19T11:48:57.4888178Z 	from com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget.doInvoke(SubstrateOptimizedCallTarget.java:135)
2019-08-19T11:48:57.4888230Z Translated to internal error
2019-08-19T11:48:57.4888364Z     /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `load'
2019-08-19T11:48:57.4888491Z     /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `block in load'
2019-08-19T11:48:57.4888632Z     /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `each'
2019-08-19T11:48:57.4888755Z     /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `load'
2019-08-19T11:48:57.4888880Z     /home/runner/work/rake/rake/test/test_rake_clean.rb:7:in `test_clean'

For #spwan with :chdir it looks like this is indeed not yet supported - it's tagged

fails:Process.spawn when passed :chdir changes to the directory passed for :chdir
fails:Process.spawn when passed :chdir calls #to_path to convert the :chdir value
.

For the UnsupportedOperationException it's from here

throw new UnsupportedOperationException();
, so this is #load with wrap set, which is also indeed not yet supported, and tagged
fails:Kernel#load when passed true for 'wrap' loads from an existing path
fails:Kernel#load when passed true for 'wrap' sets the enclosing scope to an anonymous module
fails:Kernel#load when passed true for 'wrap' allows referencing outside namespaces
fails:Kernel#load when passed true for 'wrap' with top-level methods allows calling top-level methods
fails:Kernel#load when passed true for 'wrap' with top-level methods does not pollute the receiver
fails:Kernel.load when passed true for 'wrap' loads from an existing path
fails:Kernel.load when passed true for 'wrap' sets the enclosing scope to an anonymous module
fails:Kernel.load when passed true for 'wrap' allows referencing outside namespaces
fails:Kernel.load when passed true for 'wrap' with top-level methods allows calling top-level methods
fails:Kernel.load when passed true for 'wrap' with top-level methods does not pollute the receiver
.

So it's two unimplemented features. The error message could be better on the second one.

We'll need to implement these features, thanks.

@hsbt
Copy link
Author

hsbt commented Aug 20, 2019

@chrisseaton Thanks. I temporary removed truffleruby on CI of ruby/rake. I will add it again when it was resolved.

@chrisseaton
Copy link
Collaborator

I've got a fix on the way for Kernel#load (the second failure.)

The first failure is a bit more tricky - it requires us to chdir on the thread running spawn (because it's not actually part of the system call) but we run threads in parallel so we might cause problems doing that. JRuby run a sub-command to change directory and then run the spawn. Maybe we should do that as well.

@eregon
Copy link
Member

eregon commented Aug 22, 2019

spawn(chdir:) is tracked as #1492, I'll try to get to that.
I think the most promising approach there is to use a small executable to chdir() and then exec(), much like Java does in some cases.

@chrisseaton
Copy link
Collaborator

Kernel#load is fixed in 5ccaefb.

@eregon eregon self-assigned this Aug 23, 2019
@eregon
Copy link
Member

eregon commented Aug 26, 2019

I fixed spawn(chdir:) (#1492) in d39f45e, it will be in the next release.
I'll try to run the tests locally to make sure they pass now.

@chrisseaton
Copy link
Collaborator

Thanks for that @eregon - I though supporting chdir was going to be very difficult.

@eregon eregon added this to the 19.3.0 milestone Sep 28, 2019
eregon added a commit to eregon/rake that referenced this issue Nov 21, 2019
@eregon eregon modified the milestones: 19.3.0, 20.0.0 Nov 22, 2019
@eregon
Copy link
Member

eregon commented Nov 27, 2019

TruffleRuby now runs in Rake's CI: ruby/rake#331
@hsbt Thank you for the bug report!

@eregon eregon closed this as completed Nov 27, 2019
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

3 participants