[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: the sorted_set problem



Le Wed, Oct 13, 2021 at 09:51:39PM -0300, Antonio Terceiro a écrit :
> On Wed, Oct 13, 2021 at 10:10:12PM +0200, Cédric Boutillier wrote:
> > Hi,
> > 
> > I am packaging sorted_set, as it was extracted from the standard library
> > as an independent gem for ruby3.0. I stumbled on the following issue:
> > 
> > - sorted_set depends on set >= 1.0
> > - set is available as an independent gem but is also bundled with ruby
> >   stdlib:
> >   - as a bundled gem with ruby3.0 (with a correct version >= 1.0)
> >   - just as a file, with no version info in ruby2.7 with the class
> >     SortedSet provided by the new `sorted_set` gem.
> > 
> > I am thinking about removing explicitly the dependency on the `set` gem
> > in `sorted_set`:
> > - for ruby3.0, as set is bundled, no issue
> > - for ruby2.7, no code in Debian for the moment requires directly
> >   sorted_set, but only `set` to use the SortedSet class from that file.
> > - If we add the dependency to ruby-sorted-set to these packages, this
> >   will be a noop for ruby2.7 and ensure ruby-sorted for ruby2.7
> > 
> > Any comment on my proposition? Am I overlooking somethin?
> 
> Should we change ruby2.7 to add `Provides: ruby-sorted-set (= 0.0)` to
> libruby2.7 to make that dependency even possible? Otherwise all packages
> would need to depend on `ruby-sorted-set | libruby2.7`.
> 
> Otherwise, LGTM

Good question.
I am not sure that adding the 'Provides: ruby-sorted-set' to libruby2.7
would have any effect, at least in the long term. If a package uses the
SortedSet class, we add the dependency to ruby-sorted-set in
debian/control.
- if we run it with ruby2.7, it will use the version of SortedSet from
  the standard library, Files from ruby-sorted-set are not loaded
- if we run it with ruby3.0, files from ruby-sorted-set are
  automatically autoloaded when the class SortedSet is used after a
  'require "set"'

Not adding the 'Provides: ruby-sorted-set' to libruby2.7 will just force
the installation of a package which is not needed when ruby2.7 is the
default interpreter, but will be needed later when ruby3.0 is the
default. Adding the 'Provides' is a little more work, but this solution
is more "correct" from the point of view of minimality of the number of
packages installed. However this gain would be valid only for the time
of the transition.

Anyway, since that is something that we can decide _after_ the upload of
ruby-sorted-set, I will go ahead and upload ruby-sorted-set after having
removed the mention of 'set' in its gemspec file.

Best wishes,

Cédric

Attachment: signature.asc
Description: PGP signature


Reply to: