-
Notifications
You must be signed in to change notification settings - Fork 93
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
Use File.exist?
for Ruby 3.2 compatibility
#1216
Conversation
Preparing Ruby 3.2 for Fedora, I have noticed that sdformat package build fails: ~~~ ... snip ... [ 4%] Running xml schema compiler on actor.sdf cd /builddir/build/BUILD/sdformat-6.0.0/redhat-linux-build/sdf/1.6 && /usr/bin/ruby /builddir/build/BUILD/sdformat-6.0.0/tools/xmlschema.rb -s /builddir/build/BUILD/sdformat-6.0.0/sdf/1.6 -i /builddir/build/BUILD/sdformat-6.0.0/sdf/1.6/actor.sdf -o /builddir/build/BUILD/sdformat-6.0.0/redhat-linux-build/sdf/1.6 [ 5%] Building CXX object src/CMakeFiles/sdformat.dir/Exception.cc.o cd /builddir/build/BUILD/sdformat-6.0.0/redhat-linux-build/src && /usr/bin/g++ -Dsdformat_EXPORTS -DBUILDING_DLL -I/builddir/build/BUILD/sdformat-6.0.0/test/gtest/include -I/builddir/build/BUILD/sdformat-6.0.0/include -I/builddir/build/BUILD/sdformat-6.0.0/redhat-linux-build -I/builddir/build/BUILD/sdformat-6.0.0/redhat-linux-build/include -isystem /usr/include/ignition/math4 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Waddress -Warray-bounds -Wcomment -Wformat -Wnonnull -Wparentheses -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-var -Wextra -Wno-long-long -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic -Wno-pragmas -Wc++11-compat -DNDEBUG -fPIC -fPIC -MD -MT src/CMakeFiles/sdformat.dir/Exception.cc.o -MF CMakeFiles/sdformat.dir/Exception.cc.o.d -o CMakeFiles/sdformat.dir/Exception.cc.o -c /builddir/build/BUILD/sdformat-6.0.0/src/Exception.cc /builddir/build/BUILD/sdformat-6.0.0/tools/xmlschema.rb:268:in `<main>': undefined method `exists?' for File:Class (NoMethodError) elsif !File.exists?(infile) ^^^^^^^^ Did you mean? exist? gmake[2]: *** [sdf/1.6/CMakeFiles/schema1_6.dir/build.make:130: sdf/1.6/actor.xsd] Error 1 gmake[2]: Leaving directory '/builddir/build/BUILD/sdformat-6.0.0/redhat-linux-build' gmake[1]: *** [CMakeFiles/Makefile2:1675: sdf/1.6/CMakeFiles/schema1_6.dir/all] Error 2 gmake[1]: *** Waiting for unfinished jobs.... [ 5%] Building CXX object src/CMakeFiles/sdformat.dir/Filesystem.cc.o ... snip ... ~~~ This is due to this change in Ruby: https:/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L589 Signed-off-by: Vít Ondruch <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Codecov Report
@@ Coverage Diff @@
## sdf13 #1216 +/- ##
=======================================
Coverage 87.20% 87.20%
=======================================
Files 124 124
Lines 16229 16229
=======================================
Hits 14152 14152
Misses 2077 2077 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
The macOS failure seems to be unrelated |
After I merged, I noticed the logs say |
Thx for heads up. That might very well by the case, but I'll leave the update to sdformat Fedora maintainer. |
`File.exists?` has been deprecated and is now removed in Ruby 3.2. https:/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L58 Signed-off-by: Vít Ondruch <[email protected]> Co-authored-by: Addisu Z. Taddese <[email protected]>
`File.exists?` has been deprecated and is now removed in Ruby 3.2. https:/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L58 Signed-off-by: Vít Ondruch <[email protected]> Co-authored-by: Addisu Z. Taddese <[email protected]>
`File.exists?` has been deprecated and is now removed in Ruby 3.2. https:/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L58 Signed-off-by: Vít Ondruch <[email protected]> Co-authored-by: Addisu Z. Taddese <[email protected]>
Preparing Ruby 3.2 for Fedora, I have noticed that sdformat package build fails:
This is due to this change in Ruby:
https:/ruby/ruby/blob/a528908271c678360d2d8ca232c178e7cdd340b4/NEWS.md?plain=1#L589
Please note that I have not tested this patch in any way. Just thought that it will be better to sent PR instead of opening ticket :)