Skip to content

Conversation

chrisseaton
Copy link
Collaborator

@graalvmbot
Copy link
Collaborator

Hello Matt Valentine-House, thanks for contributing a PR to our project!

We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address matt -(at)- eightbitraptor -(dot)- com. You can sign it at that link.

If you think you've already signed it, please comment below and we'll check.

@chrisseaton
Copy link
Collaborator Author

Matt is a Shopify employee.

@eregon eregon self-requested a review December 18, 2019 22:03
@eregon eregon self-assigned this Dec 18, 2019
@eregon
Copy link
Member

eregon commented Dec 18, 2019

Thank you for the PR!

From https://github.com/eregon/actions-shell/runs/327245855, RUBY_PLATFORM is

  • on Linux: x86_64-linux
  • on macOS: x86_64-darwin18
  • on Windows: x64-mingw32

So the kernel version only seems used on macOS.

@chrisseaton
Copy link
Collaborator Author

Have you taken a look at --with-os-version-style=? We think major is the default (but I'm not used to reading these Autoconf files). We're trying to match a default build. We found gems in the wild depending on this https://github.com/freerange/mocha/blob/master/lib/mocha/macos_version.rb.

@eregon
Copy link
Member

eregon commented Dec 19, 2019

The value of RUBY_PLATFORM seems to come from autoconf's $target_os.
In any case, let's match MRI, so on macOS we need the version as this PR does, but on Linux (and I think for other platforms too) we shouldn't have it in RUBY_PLATFORM:
The added spec does not pass on MRI on Linux:

$ jt -u ruby test spec/ruby/core/builtin_constants/builtin_constants_spec.rb
ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
                                                                                             
1)
RUBY_PLATFORM contains the current kernel major version FAILED
Expected "x86_64-linux" =~ /5/
to be truthy but was nil
/home/eregon/code/truffleruby-ws/truffleruby/spec/ruby/core/builtin_constants/builtin_constants_spec.rb:41:in `block (3 levels) in <top (required)>'
/home/eregon/code/truffleruby-ws/truffleruby/spec/ruby/core/builtin_constants/builtin_constants_spec.rb:33:in `<top (required)>'

@eightbitraptor
Copy link
Contributor

Thanks for the feedback @eregon and @chrisseaton - I've pushed a commit that restricts this functionailty to Darwin based OS's only now, and uses the original behaviour for other systems. I've run the tests locally on both Ubuntu 18.04 and macOS 10.15.2 so I'm hopeful 👍

I think it's important to note that we're only replicating the default behaviour of MRI at this stage. I don't have much context about what the --with-os-version-style flag is used for, only that it's possible to compile Ruby with a different setting.

Thanks both.

@eregon
Copy link
Member

eregon commented Dec 20, 2019

Thanks for the update, I'll integrate the PR.

https://github.com/freerange/mocha/blob/master/lib/mocha/macos_version.rb

FWIW, a better way to do that seems to be Etc.uname[:release].

I guess 99+% don't set --with-os-version-style, so let's not worry about until we find a problem related to it.

@eregon eregon added this to the 20.0.0 milestone Dec 20, 2019
@graalvmbot
Copy link
Collaborator

Matt Valentine-House has signed the Oracle Contributor Agreement (based on email address matt -(at)- eightbitraptor -(dot)- com) so can contribute to this repository.

@eregon eregon added the in-ci The PR is being tested in CI. Do not push new commits. label Dec 20, 2019
@eregon
Copy link
Member

eregon commented Dec 23, 2019

@chrisseaton Could you remove the last commit?
I did the formatting and a few small fixes on top, so rebasing is not easy and the PR already passed CI.

The issue is that if there is an extra commit on the GitHub PR it won't be regarded as "merged" on GitHub (but just closed).

To avoid this kind of issue I add the label in-ci when creating the internal PR.
The label in-ci means the PR is being tested in the internal CI and no new commits should be pushed on the GitHub PR.

@chrisseaton
Copy link
Collaborator Author

Done.

graalvmbot pushed a commit that referenced this pull request Dec 23, 2019
@graalvmbot graalvmbot merged commit f0d0910 into oracle:master Dec 23, 2019
@eregon
Copy link
Member

eregon commented Dec 23, 2019

@eightbitraptor @chrisseaton Merged in 83abd2e with a few tweaks, thank you for the PR!

@chrisseaton chrisseaton deleted the ruby-platform branch December 28, 2019 02:16
@chrisseaton chrisseaton added the shopify Pull requests from Shopify label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility in-ci The PR is being tested in CI. Do not push new commits. oca-signed shopify Pull requests from Shopify
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants