public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@gentoo.org>
To: Sebastian Pipping <sping@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Needs ideas: Upcoming circular dependency: expat <> CMake
Date: Wed, 18 Dec 2019 23:58:22 +0000	[thread overview]
Message-ID: <20191218235822.5b036cf2@sf> (raw)
In-Reply-To: <85c9df6f-fcf5-61d7-90af-a375f5c75088@gentoo.org>

On Wed, 18 Dec 2019 22:02:47 +0100
Sebastian Pipping <sping@gentoo.org> wrote:

> Hi all,
> 
> 
> I noticed that dev-util/cmake depends on dev-libs/expat and that
> libexpat upstream (where I'm involved) is in the process of
> dropping GNU Autotools altogether in favor of CMake in the near future,
> potentially the next release (without any known target release date).
> 
> CMake bundles a (previously outdated and vulnerable) copy of expat so
> I'm not sure if re-activating that bundle — say with a new use flag
> "system-expat" — would be a good thing to resort to for breaking the
> cycle, with regard to security in particular.
> 
> Do you have any ideas how to avoid a bad circular dependency issue for
> our users in the future?  Are you aware of similar problems and
> solutions from the past?

Fun fact: cmake is not keyworded for riscv.

To think of solutions enumerating the arising problems explicitly might
help here. I see a few:
1. initial system bootstrap requires solving a circular dependency
2. recovery from broken state (expat soname bump without preserved
  libs or cmake broken by one of many depends it has)

[2.] effectively forbids a dependency circle.

[1.] is hard to solve without users' intervention to at least flip a default flag.

Some other distributions provide two packages to break the cycle.
Example Gentoo solution would be: "cmake.ebuild" depends on "expat.ebuild",
"expat.ebuild" depends on "cmake-with-bundled-expat.ebuild".

Some examples of circular dependencies are:
a) gcc/glibc/binutils toolchain. the solution is to provide prebuilt
  binaries as part of stage3.
b) self-hosted languages without an interpreter in C (rust, golang, ghc).
  The solution is to provide prebuilt binaries in ebuilds.
c) circular dependencies in tests. The solution is careful user's USE flags
  juggling: enable USE=test only for a package being tested.
d) glibc depends on libidn2 to implement modern DNS demangling.
    glibc fixes it by not depending on libidn at build time and does manual
    library loading with dlopen()/dlsym().
e) vast majority of others: dependency bundling (users of autotools, gnulib, zlib, lua).

All the above are not pretty. a) is simplest to maintain by ebuild maintainer
and gentoo user, but probably not by releng. c) moves the burden to user.

I personally would explore [e]: unconditional bundling of expat into
cmake and make sure it's kept up-to-date there.

[c] would be nice to be solved at portage level if portage could schedule
multiple merges for the same package with different USE flags.

-- 

  Sergei


  parent reply	other threads:[~2019-12-18 23:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1a722f8f-36b5-c313-b6e1-eac75e0839c5@gentoo.org>
2019-12-18 21:02 ` [gentoo-dev] Needs ideas: Upcoming circular dependency: expat <> CMake Sebastian Pipping
2019-12-18 21:08   ` Michał Górny
2019-12-18 21:10     ` Piotr Karbowski
2019-12-18 21:14       ` Michał Górny
2019-12-18 21:44   ` Francesco Riosa
2019-12-19 13:32     ` Rolf Eike Beer
2019-12-19 14:18       ` Sebastian Pipping
2019-12-18 23:58   ` Sergei Trofimovich [this message]
2019-12-19  1:38     ` Kent Fredric
2019-12-19  8:31     ` Michał Górny
2019-12-19 14:39       ` Sebastian Pipping
2019-12-19 16:03         ` Michał Górny
2019-12-19 17:28           ` Sebastian Pipping
2019-12-19 17:37             ` Michał Górny
2019-12-19 18:43               ` Sebastian Pipping
2019-12-19 19:21                 ` Michał Górny
2019-12-20 13:41                 ` Gerion Entrup
2019-12-20 14:25                   ` Rich Freeman
2019-12-19 21:28               ` Michael Orlitzky
2019-12-19  0:19   ` Michael Orlitzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218235822.5b036cf2@sf \
    --to=slyfox@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=sping@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox