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

[WIP] upgrading ruby to 3.3 #23142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[WIP] upgrading ruby to 3.3 #23142

wants to merge 2 commits into from

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Aug 12, 2024

3.2 ref

Highlights:

  • optional: Regexp.timeout = 1.0 or Regexp.new('^a*b?a*()\1$', timeout: Float::INFINITY)
  • All methods wishing to delegate keyword arguments through *args must now be marked with ruby2_keywords, with no exception.
  • Hash#shift (empty returns nil instead of default)
  • Struct no longer needs keyword_init
  • removed: Fixnum, Bignum Random::DEFAULT, Struct::Group, Struct::Passwd
  • removed: Dir.exists?, File.exists?
  • removed: Kernel#=~, Kernel#taint, Kernel#untaint, Kernel#tainted?, Kernel#trust, Kernel#untrust, Kernel#untrusted?
  • lib no longer included: libyaml. (was in psych. May need libyaml-dev on ubuntu)
  • lib no longer included: libffi. (was in fiddle - only used on windows)
  • add Queue#pop, SizedQueue#push, SizedQueue#pop added param timeout:

3.3

Highlights:

punt:

  • ERB::Util.html_escape is made faster than CGI.escapeHTML
  • no longer need require "set" (supporting older ruby versions)
    • this is not hurting anyone, and this change is not compatible for ruby <3.2 - which we still support

Build Issues

current solution:

gem install --verbose ovirt-engine-sdk -v4.6.0 -- --with-cflags="-Wno-error=incompatible-function-pointer-types -Wno-error=implicit-function-declaration"

@@ -16,6 +16,7 @@ jobs:
ruby-version:
- '3.0'
- '3.1'
- '3.3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kbrock Even if we jump from 3.1 to 3.3 in a release, we should include 3.2 with 3.3 so if they fail in CI, we can determine if it's a problem unique to 3.3 or also a problem in 3.2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, since we will never use 3.2, I'm mixed on this one.
Already got 2 thumbs up, so I'll add it.
But it seems a waste of cycles and unnecessary granularity

@bdunne
Copy link
Member

bdunne commented Aug 14, 2024

For build, EL9 ships with ruby 3.0 by default and has dnf modules for 3.1 and 3.3, but not 3.2.

@Fryguy
Copy link
Member

Fryguy commented Aug 15, 2024

so weird that el9 jumped a version 😕

@kbrock
Copy link
Member Author

kbrock commented Aug 16, 2024

The gem build failure for ovirt-engine-sdk is frustrating.
I can see that @jrafanie and others had issues building it for oVirt/ovirt-engine-sdk-ruby#11

Hopefully it shouldn't be too hard. Guess this is where it all begins. Wish they had a C guide titled "this is what changed over the past 20 years" - because that code has a bunch of stuff I do not recognize

@jrafanie
Copy link
Member

ov_http_request.c:75:29: warning: excess elements in array initializer
   75 |         .reserved = { NULL, NULL }
      |                             ^~~~
ov_http_request.c:75:29: note: (near initialization for
‘ov_http_request_type.function.reserved’)
ov_http_request.c: In function ‘ov_http_request_define’:
ov_http_request.c:347:77: error: ‘rb_cData’ undeclared (first use in this
function)
347 |     ov_http_request_class = rb_define_class_under(ov_module,
"HttpRequest", rb_cData);
|                                                                         
^~~~~~~~
ov_http_request.c:347:77: note: each undeclared identifier is reported only once
for each function it appears in
ov_http_request.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been
intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have
been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may
have been intended to silence earlier diagnostics
make: *** [Makefile:248: ov_http_request.o] Error 1

This looks alittle different. There's no option reported in the output to silence it.

@Fryguy
Copy link
Member

Fryguy commented Aug 16, 2024

That's also an error, whereas the others were warnings.

@jrafanie
Copy link
Member

jrafanie commented Aug 16, 2024

That's also an error, whereas the others were warnings.

sorry, it's different than the one we had previously where it told you that you can ignore it by opting into that behavior:

implicit function declarations [-Wimplicit-function-declaration]

oVirt/ovirt-engine-sdk-ruby#11

This one is a undeclared variable if I'm reading correctly.

@kbrock kbrock self-assigned this Aug 20, 2024
@micwoj92
Copy link

micwoj92 commented Sep 9, 2024

@jrafanie in the linked issue from your last comment you tried to build version 4.6.0 of ovirt engine sdk. This error is because the CI pulls 4.4.1 and it is unrelated. This issue has already been fixed with latest version. See oVirt/ovirt-engine-sdk-ruby@97df88c

@kbrock
Copy link
Member Author

kbrock commented Sep 10, 2024

@kbrock kbrock marked this pull request as ready for review September 10, 2024 21:33
@kbrock kbrock requested a review from Fryguy as a code owner September 10, 2024 21:33
@kbrock kbrock changed the title upgrading ruby to 3.3 [WIP] upgrading ruby to 3.3 Sep 10, 2024
@kbrock kbrock added the wip label Sep 10, 2024
miq-bot pushed a commit to ManageIQ/manageiq-cross_repo-tests that referenced this pull request Sep 10, 2024
@Fryguy
Copy link
Member

Fryguy commented Sep 12, 2024

@kbrock I find this site more useful for detailing changes in Ruby:

@kbrock kbrock force-pushed the ruby33 branch 3 times, most recently from 5322c93 to 02a88ad Compare September 20, 2024 22:31
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@miq-bot
Copy link
Member

miq-bot commented Sep 25, 2024

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Sep 26, 2024

Checked commit kbrock@2129ca5 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 👍

locally forcing ruby 3.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants