[SRU] ruby-sdbm should be backported to jammy

Bug #1979128 reported by Mitsuya Shibata
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bsfilter (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Mitsuya Shibata
ruby-sdbm (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Fix Released
Undecided
Lucas Kanashiro

Bug Description

[Impact]

In jammy, the bsfilter package assumes that ruby has the sdbm library built in. However, the sdbm library was removed in Ruby 3.0 and became a separate package. Therefore, the learning function of bsfilter does not work anymore.

Therefore, we will add the ruby-sdbm package to bsfilter's Depends field.

[Test Plan]

$ lxc launch ubuntu-daily:jammy bsfilter-test
$ lxc shell bsfilter-test
# apt install -y bsfilter
# touch foo
# bsfilter --sub-clean --add-spam --insert-flag --insert-probability --update foo
# echo $?
0

no display load error for "require" instruction, and bsfilter command should succeed.

[Where problems could occur]

The bsfilter command always fails if ruby-sdbm is not installed, because it tries to load the sdbm library by default if the DB option is unspecified. Therefore, I consider that there is no risk of regression.

---

Following for SRU of ruby-sdbm

[Impact]

In Ruby 3.0, sdbm has been removed from the standard library[1]. However, some packages, such as the bsfilter package, will fail at startup without the sdbm library, LP: #1972040 .

The ruby-sdbm package does not exist in Jammy, only in Kinetic. Therefore, backporting ruby-sdbm from kinetic to jammy and relying on ruby-sdbm on the bsfilter side seems to solve the problem.

[1] https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/

[Test Plan]

$ lxc launch ubuntu-daily:jammy ruby-sdbm-test
$ lxc shell ruby-sdbm-test
# apt install -y ruby-sdbm
# ruby -e "require 'sdbm'; SDBM.open 'my_database' do |db| db.update('foo' => 'bar') end"

The command above will create 2 files: my_database.dir and my_database.pag. No exception is expected.

[Where problems could occur]

The ruby-sdbm package does not exist in Jammy, I do not believe that any regression will occur.

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

@ubuntu-sponsors

If I would like to backport new package SRU process, I cannot generate debdiff.
Do I need to attach anything else?

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for letting us know about this issue Mitsuya. I'll try to drive this forward.

tags: added: server-todo
Changed in ruby-sdbm (Ubuntu):
assignee: nobody → Lucas Kanashiro (lucaskanashiro)
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

ruby-sdbm was uploaded to Jammy, it is in NEW now waiting for review.

Changed in ruby-sdbm (Ubuntu Jammy):
assignee: nobody → Lucas Kanashiro (lucaskanashiro)
Changed in ruby-sdbm (Ubuntu):
assignee: Lucas Kanashiro (lucaskanashiro) → nobody
status: New → Fix Released
description: updated
Changed in ruby-sdbm (Ubuntu Jammy):
status: New → In Progress
Changed in bsfilter (Ubuntu Jammy):
status: New → Triaged
Changed in bsfilter (Ubuntu):
status: New → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Mitsuya, or anyone else affected,

Accepted ruby-sdbm into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ruby-sdbm/1.0.0-2~ubuntu0.22.04.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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 ruby-sdbm (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

(this package has been reviewed by Christian, who is an AA + my additional checks for SRUability)

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :
Download full text (4.9 KiB)

I verified, it is ok. Thanks for updating!

root@sdbm:~# apt install -y ruby-sdbm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package ruby-sdbm
root@sdbm:~# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF
root@sdbm:~# cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF
root@sdbm:~# apt update
(snip)
root@sdbm:~# apt policy ruby-sdbm
ruby-sdbm:
  Installed: (none)
  Candidate: 1.0.0-2~ubuntu0.22.04.1
  Version table:
     1.0.0-2~ubuntu0.22.04.1 400
        400 http://archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 Packages
root@sdbm:~# apt install ruby-sdbm
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  fonts-lato javascript-common libjs-jqu...

Read more...

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote (last edit ):

Thanks for the verification Mitsuya! Once we land ruby-sdbm in jammy-updates we can also fix bsfilter, adding ruby-sdmb as a dependency. Would you like to do it? I'd be happy to review and sponsor the package for you.

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

Attached is a debdiff file for bsfilter.

The only change is to add ruby-sdbm to Depends/Build-Depends to match the kinetic package, and to specify the package revision as in kinetic, but with 1.0.0 instead of 1.0.0-1 for lintian warnings. 1.0.0.0 instead of 1.0.0-1 for lintian warnings.

https://lintian.debian.org/tags/build-depends-on-1-revision

Is it ok to request SRU sponsor after ruby-sdbm moves from proposed to universe?

Changed in bsfilter (Ubuntu Jammy):
status: Triaged → In Progress
assignee: nobody → Mitsuya Shibata (cosmos-door)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ruby-sdbm - 1.0.0-2~ubuntu0.22.04.1

---------------
ruby-sdbm (1.0.0-2~ubuntu0.22.04.1) jammy; urgency=medium

  * Backport to Jammy (LP: #1979128).

 -- Lucas Kanashiro <email address hidden> Tue, 29 Nov 2022 16:17:01 -0300

Changed in ruby-sdbm (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ruby-sdbm has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

I have tried fixed bsfilter package with ruby-sdbm in jammy-updates pocket. Its result is ok.

Would anyone like to sponsor comment 8's patch?

https://bugs.launchpad.net/ubuntu/+source/ruby-sdbm/+bug/1979128/comments/8

# apt install ./bsfilter_1.0.19-2.1ubuntu1_all.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'bsfilter' instead of './bsfilter_1.0.19-2.1ubuntu1_all.deb'
The following additional packages will be installed:
  ruby-sdbm
Suggested packages:
  ruby-mecab ruby-qdbm
The following NEW packages will be installed:
  bsfilter ruby-sdbm
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 16.5 kB/82.3 kB of archives.
After this operation, 285 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 /root/bsfilter_1.0.19-2.1ubuntu1_all.deb bsfilter all 1:1.0.19-2.1ubuntu1 [65.9 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 ruby-sdbm amd64 1.0.0-2~ubuntu0.22.04.1 [16.5 kB]
Fetched 16.5 kB in 1s (22.6 kB/s)
Selecting previously unselected package ruby-sdbm.
(Reading database ... 37125 files and directories currently installed.)
Preparing to unpack .../ruby-sdbm_1.0.0-2~ubuntu0.22.04.1_amd64.deb ...
Unpacking ruby-sdbm (1.0.0-2~ubuntu0.22.04.1) ...
Selecting previously unselected package bsfilter.
Preparing to unpack .../bsfilter_1.0.19-2.1ubuntu1_all.deb ...
Unpacking bsfilter (1:1.0.19-2.1ubuntu1) ...
Setting up ruby-sdbm (1.0.0-2~ubuntu0.22.04.1) ...
Setting up bsfilter (1:1.0.19-2.1ubuntu1) ...
Processing triggers for man-db (2.10.2-1) ...

# bsfilter --sub-clean --add-spam --insert-flag --insert-probability --update foo
/usr/bin/bsfilter:326:in `open_ro': foo is not file (RuntimeError)
        from /usr/bin/bsfilter:2311:in `block in update_token_dbs'
        from /usr/bin/bsfilter:2310:in `each'
        from /usr/bin/bsfilter:2310:in `update_token_dbs'
        from /usr/bin/bsfilter:3336:in `run'
        from /usr/bin/bsfilter:3414:in `<main>'

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Sorry for the delay Mitsuya. I took a quick look at your debdiff and I have some comments:

- I'd change the version used from 1:1.0.19-2.1ubuntu1 to 1:1.0.19-2.1ubuntu0.1. This is the standard used by the security team and in this case it makes clear that the delta was added post release and not during its development cycle.

- The other thing is to be consistent in the version constraints you added. In the build depends you added ruby-sdbm (>= 1.0.0) and in the runtime depends you added ruby-sdbm (>= 1.0.0-1). Since 1.0.0-2~ubuntu0.22.04.1 is the only ruby-sdbm possible in Jammy, you would not need a version constraint to be honest. But if you want to add you should use ruby-sdbm (>= 1.0.0) without the debian revision. Moreover, I wouldn't care much about the lintian warning you mentioned since it is related to backports of new versions, we do not do that in Ubuntu stable releases (just for "special" packages which is not the case here).

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

Hi Lukas,

Thank you for reviewing!

I reworked the debdiff based on your comment.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Now, LGTM. Could you update the bug description following the SRU template for bsfilter instead of ruby-sdbm before I upload the package?

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote (last edit ):

Ah, you forgot to run the update-maintainer script from ubuntu-dev-tools. This will make Ubuntu developers as the maintainers of this package since we are adding a delta for the first time. But I can fix it by myself, let's just try to update the bug description following the SRU guidelines.

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

> Ah, you forgot to run the update-maintainer script from ubuntu-dev-tools.

Oh, sorry. I re-upload debdiff.

Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

> Could you update the bug description following the SRU template for bsfilter instead of ruby-sdbm before I upload the package?

I updated it. Could you please review it?

description: updated
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks Mitsuya, LGTM. I uploaded the package, waiting for the SRU team now.

tags: removed: server-todo
Revision history for this message
Andreas Hasenack (ahasenack) wrote : Please test proposed package

Hello Mitsuya, or anyone else affected,

Accepted bsfilter into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/bsfilter/1:1.0.19-2.1ubuntu0.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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 bsfilter (Ubuntu Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
removed: verification-done verification-done-jammy
Revision history for this message
Mitsuya Shibata (cosmos-door) wrote :

Thanks Lucas and Andreas. I verified new bsfilter package.

# install bsfilter

root@sdbm:~# cat <<EOF >/etc/apt/sources.list.d/ubuntu-$(lsb_release -cs)-proposed.list
# Enable Ubuntu proposed archive
deb http://archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-proposed restricted main multiverse universe
EOF
root@sdbm:~# cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF
root@sdbm:~# apt update
root@sdbm:~# apt policy bsfilter
bsfilter:
  Installed: (none)
  Candidate: 1:1.0.19-2.1
  Version table:
     1:1.0.19-2.1ubuntu0.1 400
        400 http://archive.ubuntu.com/ubuntu jammy-proposed/universe amd64 Packages
     1:1.0.19-2.1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
root@sdbm:~# apt install -t jammy-proposed bsfilter
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  fonts-lato javascript-common libjs-jquery libruby3.0 rake ruby ruby-net-telnet ruby-rubygems ruby-sdbm ruby-webrick ruby-xmlrpc ruby3.0 rubygems-integration unzip zip
Suggested packages:
  ruby-mecab ruby-qdbm apache2 | lighttpd | httpd ri ruby-dev bundler
The following NEW packages will be installed:
  bsfilter fonts-lato javascript-common libjs-jquery libruby3.0 rake ruby ruby-net-telnet ruby-rubygems ruby-sdbm ruby-webrick ruby-xmlrpc ruby3.0 rubygems-integration unzip zip
0 upgraded, 16 newly installed, 0 to remove and 31 not upgraded.
Need to get 9008 kB of archives.
After this operation, 39.0 MB of additional disk space will be used.
(snip)
  => install ruby-sdbm too.

# test bsfilter
root@sdbm:~# touch foo
root@sdbm:~# bsfilter --sub-clean --add-spam --insert-flag --insert-probability --update foo
root@sdbm:~# echo $?
0

tags: added: verification-done verification-done-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bsfilter - 1:1.0.19-2.1ubuntu0.1

---------------
bsfilter (1:1.0.19-2.1ubuntu0.1) jammy; urgency=medium

  * d/control: add dependency on ruby-sdbm (LP: #1979128)

 -- Mitsuya Shibata <email address hidden> Sat, 10 Dec 2022 11:05:45 +0000

Changed in bsfilter (Ubuntu Jammy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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