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

Re: Are circular dependencies inside a source package OK?

Le dimanche 27 février 2011 à 16:31 +0100, Lucas Nussbaum a écrit : 
> Ideally, we would have binary packages named like that:
> ruby-foo: arch-indep part of the foo library
> ruby1.8-foo: arch-dep part of the foo library, built for ruby1.8
> ruby1.9.1-foo: arch-dep part of the foo library, built for ruby1.9.1
> jruby-foo: arch-dep part of the foo library, built for jruby
> rubinius-foo: arch-dep part of the foo library, built for rubinius
> But then, we have a problem, because:
> - ruby-foo need one of (ruby1.8-foo, ruby1.9.1-foo, jruby-foo,
>   rubinius-foo) installed to work correctly
> - ruby1.8-foo, ruby1.9.1-foo, jruby-foo, rubinius-foo need ruby-foo
>   installed

Which size is ruby-foo? If it’s not significant, you’re probably wasting
your time.

> What we would like to do to reflect this is:
> - ruby-foo depend on the implementation-specific package for the default
>   version of Ruby (so Depends: ruby1.8-foo)
> - ruby<interpreter_version>-foo Depends: ruby-foo
> However, that creates many small dependency cycles. I am under the
> impression that dependency cycles are considered bad, but that we have
> many of them already, and that no important part of our infrastructure
> or tools really has problems with them. Also, they are limited to a
> single source package here.

Circular dependencies, in the same source package or not, tend to create
a lot of breakage, especially at uninstall time - partly because dpkg
doesn’t cope well with them.

> Is there a good reason not to do the above?

Yes: circular dependencies are bad. They make the dependency resolver’s
behavior less predictable, and they cause various bugs since postinst
and prerm scripts are run in random order. Triggers often hide these
bugs, but the conceptual problem is still here.

If you really want to split the arch-indep parts, you should create:
- ruby-foo-common containing the arch-indep part;
- ruby1.8-foo (and so on) containing the arch-dependent part;
- ruby-foo which is an empty package depending on ruby1.8-foo.

The simpler solution is to copy the arch-dependent parts in all binary

 .''`.      Josselin Mouette
: :' :
`. `'  “If you behave this way because you are blackmailed by someone,
  `-    […] I will see what I can do for you.”  -- Jörg Schilling

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: