[SRU] svn2git crashes due to API change in ruby 3.2

Bug #2073346 reported by Coenraad Stijne
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
svn2git (Ubuntu)
Status tracked in Oracular
Noble
Fix Committed
Undecided
Unassigned
Oracular
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

svn2git is completely unusable. It will immediately when any user executes it.
The error will be:

$ svn2git
/usr/lib/ruby/vendor_ruby/svn2git/migration.rb:58:in `parse': undefined method `exists?' for File:Class (NoMethodError)

      if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
             ^^^^^^^^
Did you mean? exist?
 from /usr/lib/ruby/vendor_ruby/svn2git/migration.rb:14:in `initialize'
 from /usr/bin/svn2git:26:in `new'
 from /usr/bin/svn2git:26:in `<main>'

This is cause by Ruby3.2 upgrade in Ubuntu as the API (which was deprecated) has been removed now.

[ Test Plan ]

sudo apt install svn2git
mkdir test
cd test
svn2git svn://repo.hu/fungw/trunk -v -m --rootistrunk

After the above command completes:

'git log' to confirm that the svn is now available as a git repo locally.

[ Where problems could occur ]

There is a small change in the code to use File.exist() instead of File.exists() which has been removed from Ruby-3.2. Looking at the code, the new API is using stat() or fstat() system calls but the previous API had a different implementation. So, there can be a risk that the new API does not work same way as the old one.
But considering that currently svn2git does not even start so as a worst case scenario if the fix causes some regression then the user will not see any new issue but will continue to see the same problem as is now.

[ Other Info ]

The issue is not seen in Debian yet as Debian is still using the old Ruby-3.1

[ Original Bug Description ]

svn2git will crash with the following error message:

/usr/lib/ruby/vendor_ruby/svn2git/migration.rb:58:in `parse': undefined method `exists?' for File:Class (NoMethodError)

Due to API change, `exists` -> `exist`

svn2git:
  Installed: 2.4.0-3
  Candidate: 2.4.0-3
  Version table:
 *** 2.4.0-3 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
        100 /var/lib/dpkg/status

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04 LTS"
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Changed in svn2git (Ubuntu Noble):
status: New → In Progress
Changed in svn2git (Ubuntu Oracular):
status: New → In Progress
Changed in svn2git (Ubuntu Noble):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in svn2git (Ubuntu Oracular):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in svn2git (Ubuntu Oracular):
assignee: Sudip Mukherjee (sudipmuk) → nobody
summary: - svn2git crashes due to API change in ruby 3.2
+ [SRU] svn2git crashes due to API change in ruby 3.2
description: updated
description: updated
description: updated
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Uploaded to SRU queue now.

Changed in svn2git (Ubuntu Noble):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package svn2git - 2.4.0-3ubuntu1

---------------
svn2git (2.4.0-3ubuntu1) oracular; urgency=medium

  * Fix crash with ruby3.2 by using correct API. (LP: #2073346)

 -- Sudip Mukherjee <email address hidden> Mon, 12 Aug 2024 13:30:40 +0100

Changed in svn2git (Ubuntu Oracular):
status: In Progress → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Coenraad, or anyone else affected,

Accepted svn2git into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/svn2git/2.4.0-3ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in svn2git (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-noble
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.