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

Windows Rubies - proper download URI #10

Closed
MSP-Greg opened this issue Jan 18, 2020 · 13 comments · Fixed by #11
Closed

Windows Rubies - proper download URI #10

MSP-Greg opened this issue Jan 18, 2020 · 13 comments · Fixed by #11
Assignees

Comments

@MSP-Greg
Copy link
Collaborator

@eregon

The following line adds a suffix:

https://github.com/eregon/use-ruby-action/blob/7978ff15791e44ccfeaedff4a522ad0be7b68079/windows.js#L16

Below is a truncated GraphQL grab of the releases, you'll notice a few have a suffix of -2. I believe this was done when build issues, RIDK/devkit issues, etc were noticed after the original -1 release.

I was waiting on this pending how things went with GitHub. I also have the flu, so I'm not big on writing code right now. I just thought I'd make you aware of it.

I don't know whether adding a json/yaml file for Windows URI mapping is a good idea, but checking for releases in the action itself seems a bit much. All my GraphQL code is Ruby; I could have it generate a json/yaml file...

{"name"=>"RubyInstaller-2.5.1-2 - 2018-06-24"},
{"name"=>"RubyInstaller-2.4.4-2 - 2018-06-24"},
{"name"=>"RubyInstaller-2.5.1-1 - 2018-03-29"},
{"name"=>"RubyInstaller-2.4.4-1 - 2018-03-29"},
{"name"=>"RubyInstaller-2.5.0-2 - 2018-02-27"},
{"name"=>"RubyInstaller-2.4.3-2 - 2018-02-27"},
{"name"=>"RubyInstaller-2.5.0-1 - 2017-12-25"},
{"name"=>"rubyinstaller-head"},
{"name"=>"RubyInstaller-2.4.3-1 - 2017-12-20"},
{"name"=>"RubyInstaller-2.4.2-2 - 2017-09-15"},
{"name"=>"RubyInstaller-2.4.2-1 - 2017-09-15"},
{"name"=>"RubyInstaller-2.4.1-2 - 2017-07-04"},
{"name"=>"RubyInstaller-2.4.1-1 - 2017-05-25"},
@eregon
Copy link
Member

eregon commented Jan 18, 2020

I think ideally this mapping would exist as a e.g. JSON file in https://github.com/oneclick/rubyinstaller2
I guess https://rubyinstaller.org/downloads/ also needs some mapping, or is it done manually?
cc @larskanis
Such a mapping from version to build would be similar to https://github.com/eregon/ruby-install-builder/blob/metadata/versions.json.

When I added Windows support I noticed the latest releases all used -1 so I simplified but indeed now that more versions are allowed, we should use the latest ones.

Using the release API to find out available versions would be nice, but I'm not sure how long it'd take to enumerate all releases. It's probably quite a bit more involved.
So I think for now we should start with a simple dictionary literal in windows.js listing the few cases with -2, and just default to -1 if not there.

@eregon
Copy link
Member

eregon commented Jan 18, 2020

Using the release API would have the other advantage to pick the latest available release from RubyInstaller2 for e.g. 2.6, which might not always be available at the same time than builds from https://github.com/eregon/ruby-install-builder. So it's probably the better solution longer-term.

@larskanis
Copy link
Contributor

The big large mapping file with all RubyInstaller releases since the ruby-1.8.7 era is here. I have some rake tasks that help me to fill the yaml file for every release, to verify integrity and to sign all binaries. Only the official release files are signed with a Microsoft trusted certificate. The procedure is described here.

@eregon
Copy link
Member

eregon commented Jan 19, 2020

Since I'm working on this I looked at whether we can support Ruby 2.3 easily on Windows.
However it seems to not find certificates correctly:

Run ruby -ropen-uri -e 'puts open(%{https://rubygems.org/}) { |f| f.read(1024) }'
C:/ruby-2.3.3-x64-mingw32/lib/ruby/2.3.0/net/http.rb:933:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (OpenSSL::SSL::SSLError)

https://github.com/eregon/use-ruby-action/runs/397621963

Is that a known issue? Any recommendation to fix it?

@eregon
Copy link
Member

eregon commented Jan 19, 2020

Fixed with #11.
@larskanis Thank you for the YAML file, that was much easier to get the information from than GitHub releases.
I made a small script to extract the information from it:
https://github.com/eregon/use-ruby-action/blob/4ff821c778170d86de82a2c27f7ddbd8e4aad0b5/generate-ruby-installer-versions.rb
which then generates a .js file with the data I need:
https://github.com/eregon/use-ruby-action/blob/4ff821c778170d86de82a2c27f7ddbd8e4aad0b5/ruby-installer-versions.js

@MSP-Greg
Copy link
Collaborator Author

whether we can support Ruby 2.3 easily on Windows

Depends on what is meant by 'support'. Windows Rubies 2.3 and lower use a proprietary package of MSYS for their 'devkit'. In theory, a dll is a dll, and MSYS2 and MSYS use the same msvc runtime.

Re 2.3, I have tried building a few extension gems with MSYS2 devkit, and they do build and pass tests. One could download and install the old devkit, but that's kind of a pita.

Is that a known issue? Any recommendation to fix it?

Yes & yes. Sorry, forgot about this one. Rather outdated info on the issue is at https://www.appveyor.com/docs/lang/ruby/#openssl-verification

One solution (only when loading Ruby 2.3) would be to add the equivalent of:

ENV['X509::DEFAULT_CERT_FILE'] = 'C:/hostedtoolcache/windows/Ruby/2.7.0/x64/ssl/cert.pem'

but use the logic to get the most recent path in the toolcache that you have.

@eregon
Copy link
Member

eregon commented Jan 19, 2020

@MSP-Greg Do you mean setting ENV['SSL_CERT_FILE'] = ... above? Thanks, I'll try that.

@MSP-Greg
Copy link
Collaborator Author

Yes. Sorry. I had it right before I copy & pasted the actual file path...

@eregon
Copy link
Member

eregon commented Jan 19, 2020

@MSP-Greg That works, thanks!
Implemented in 7da380d
Run: https://github.com/eregon/use-ruby-action/runs/397792666

@MSP-Greg
Copy link
Collaborator Author

MSP-Greg commented Jan 19, 2020

@eregon

Some background...

Re Windows Ruby 2.3, I'm sure you noticed that the last build was 2.3.3. The people who developed the RubyInstaller/MYS system became busy with other things, and support fell apart, possibly also due to the fact that MSYS itself was losing support.

So, RubyInstaller2 based on MSYS2 came into being, thanks to the work of Lars. About the same time, I was working with master and the test suites.

A while ago, there was some discussion about whether to release RubyInstaller2/MSYS2 builds of 2.3, and some people did build it.

I think the consensus was that having both RubyInstaller/MSYS and RubyInstaller2/MSYS2 builds (which used different compile tools) publicly available could turn into a support mess (especially for new users), so no builds were released.

Also, support in terms of testing by ruby/ruby was much less that it is with newer Ruby versions.

@larskanis
Copy link
Contributor

@eregon Could you also add RubyInstaller-head to available versions? Should I add it to the YAML file?

@eregon
Copy link
Member

eregon commented Jan 19, 2020

@MSP-Greg Thanks for the background, good to know. I think more recent versions of Ruby 2.3 with MSYS2 would be a nice-to-have, but OTOH if nobody asks for it it's probably fine to not have them.

@larskanis Currently this action doesn't support any -head version, but I'm starting to consider it.
I'd keep out of the YAML file since that lists specific releases and version numbers.

@MSP-Greg
Copy link
Collaborator Author

@eregon

Thanks for update. I updated https://github.com/MSP-Greg/use-ruby-action-info/runs/397883746 and everything looks really good. If you want the code for it, feel free.

I also posted another message to the Where's Ubuntu cert file? issue at https://github.com/actions/virtual-environments

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

Successfully merging a pull request may close this issue.

3 participants