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

jruby-head #1

Closed
MSP-Greg opened this issue Feb 12, 2020 · 22 comments
Closed

jruby-head #1

MSP-Greg opened this issue Feb 12, 2020 · 22 comments

Comments

@MSP-Greg
Copy link
Owner

@eregon

I just did a PR for a repo that uses the equivalent of 'jruby' and 'jruby-head', which were done with rvm.

Do you hope to generate a 'jruby-head' build in the future? Just wondering, no hurry....

Thanks, Greg

@eregon
Copy link

eregon commented Feb 12, 2020

Yes, it's in the plans.
There is already https://github.com/ruby/jruby-dev-builder but no builds there yet.

@eregon
Copy link

eregon commented Feb 12, 2020

Which repo is that, and how did you deal with jruby-head there?

@MSP-Greg
Copy link
Owner Author

MSP-Greg commented Feb 12, 2020

Which repo is that, and how did you deal with jruby-head there?

Psych. For the time being, I left the workflow using rvm for jruby and jruby-head. See: https://github.com/ruby/psych/blob/master/.github/workflows/ubuntu-jruby.yml

The PR I did was ruby/psych#432, and of course, someone didn't like it.

Thanks for the jruby-head plans. and thanks for all your work with the builds. I don't think the Travis builds were/are tested, at least not fully. So now that yours are, I'm encouraging people to use them.

As you may have seen, I've got actions-ruby allowing ruby-loco mingw and mswin builds to be used. I don't think the ruby-head mingw build you're using runs test-all, and with MRI Ruby, that's a must.

I've always been about master building & testing...

@eregon
Copy link

eregon commented Feb 15, 2020

@MSP-Greg I'm looking at having jruby-head on Windows.
However I'm hitting some very strange behavior where tar tf lists bin/jruby.exe, but after tar xf the file is not there! On Linux I can extract and I see it's there. And bin/jrubyw.exe extracts fine.
https://github.com/ruby/jruby-dev-builder/runs/448013601
Any idea what's going on?

I guess I could try to use the .zip instead, but such a major bug in tar on Windows seems surprising. Also using a .tar.gz for all platforms avoids code duplication.
Finally, on .tar.gz release archives of JRuby, I could extract jruby.exe just fine.

@eregon
Copy link

eregon commented Feb 15, 2020

When trying with unzip I see:

  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jrubyw.exe  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jruby.bash  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jirb.bat  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/ri.bat  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jgem  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jruby.dll  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jirb_swing  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jruby.bat  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jrubyd.bat  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/testrb  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jruby.exe  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jirb  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/irb.bat  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jirb_swing.bat  
replace jruby-9.2.10.0-SNAPSHOT/bin/jruby? [y]es, [n]o, [A]ll, [N]one, [r]ename:  NULL
(EOF or read error, treating as "[N]one" ...)
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/jrubyc.bat  
  inflating: jruby-9.2.10.0-SNAPSHOT/bin/rdoc  

Not sure what that means.

@MSP-Greg
Copy link
Owner Author

Give me a second...

I downloaded it, extracted with 7z GUI, and running jruby --version outputs Cannot find Java 1.5 or higher. which I assume is an error message in the exe file?

Now, why tar is misbehaving, that might take me a few minutes to figure put...

@eregon
Copy link

eregon commented Feb 15, 2020

Looks like both tar and unzip have the issue, and they consider two files named jruby and jruby.exe to be the same apparently on Windows? Is that a Windows or filesystem restriction maybe?

I managed to work around by explicitly not extracting bin/jruby (so only bin/jruby.exe).

@MSP-Greg
Copy link
Owner Author

There's a few tar.exe files on the Actions Windows image. I don't know what node uses, and we're using node for the extraction, right?

Let me check the MSYS tar and see what it does...

@MSP-Greg
Copy link
Owner Author

MSP-Greg commented Feb 15, 2020

Using the MSYS2 tar or the git tar, the below worked. Does that help?

tar.exe -xzf jruby-head.tar.gz

@eregon
Copy link

eregon commented Feb 15, 2020

I'm using just tar in the bash shell on Windows.
The command succeeds, but does not extract bin/jruby.exe.

@eregon
Copy link

eregon commented Feb 15, 2020

For https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.9.0/jruby-dist-9.2.9.0-bin.tar.gz it works fine, probably because jruby is before jruby.exe.

OTOH, for https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-dist/9.2.10.0-SNAPSHOT/jruby-dist-9.2.10.0-20200214.210645-79-bin.tar.gz jruby.exe is before jruby, and it seems tar/unzip consider it should "override/delete" jruby.exe for some reason.

@MSP-Greg
Copy link
Owner Author

Oddly enough, it was the 2nd file that I used. I never checked to see what Actions uses for Windows bash. Maybe I should do that...

@MSP-Greg
Copy link
Owner Author

This is messy. I'm working on it.

@MSP-Greg
Copy link
Owner Author

I think I'm losing my mind. I thought I posted this AM.

Anyway, Windows 10 and the image on Actions both have a Windows tar command. Also, the mv command was doing some odd things.

The following worked, although Windows specific:

- name: Download latest jruby nightly archive
  if: startsWith(matrix.os, 'windows')
  run: |
    $url=$(ruby find-jruby-head-url.rb)
    echo "$url"
    curl --fail -L -o archive.tar.gz "$url"
    C:\Windows\System32\tar.exe -xzf archive.tar.gz
    gci -Path ./jruby-* -Attributes Directory | Rename-Item -NewName jruby-head
    ls jruby-head/bin

@eregon
Copy link

eregon commented Feb 16, 2020

Thanks! I'll try that.

@eregon
Copy link

eregon commented Feb 16, 2020

So it looks like tar inside the Bash shell misbehaves and does not extract jruby.exe.
Running tar in the default Windows shell works and extracts both jruby and jruby.exe.

@eregon
Copy link

eregon commented Feb 16, 2020

FWIW, jruby-head seems currently broken on Windows: jruby/jruby#6073
Maybe I should just make it available on non-Windows first.

@MSP-Greg
Copy link
Owner Author

Maybe I need to install Java. How would one detect that the Ruby installation is JRuby on Windows?

@eregon
Copy link

eregon commented Feb 16, 2020

We found out the root issue, see jruby/jruby-launcher#29 (comment)

@MSP-Greg
Copy link
Owner Author

MSP-Greg commented Feb 16, 2020

Yes. I guess I broke it (rubygems/rubygems#2119). Sorry...

EDIT: Reading further, I guess I fixed it in rubygems/rubygems#2876.

@MSP-Greg
Copy link
Owner Author

MSP-Greg commented Feb 16, 2020

Running jruby-head, I just did

gem update --system -N

Which seems to have install RG 3.1.2 and Bundler 2.1.2, but it creates binstubs named jgem & jbundle.

The old gem binstub works...

Copied jbundle and jbundle.bat and renamed without j, and all is good.

@eregon
Copy link

eregon commented Feb 16, 2020

No worry, my jruby-head builds work now.
Here is the release for setup-ruby: https://github.com/ruby/setup-ruby/releases/tag/v1.17.0
Could you close this issue?

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

No branches or pull requests

2 participants