public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [pre-GLEP] Optional runtime dependencies via runtime-switchable USE flags
@ 2012-06-17 20:31 Michał Górny
  2012-06-17 20:38 ` Ciaran McCreesh
                   ` (5 more replies)
  0 siblings, 6 replies; 72+ messages in thread
From: Michał Górny @ 2012-06-17 20:31 UTC (permalink / raw
  To: Gentoo Developer Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 253 bytes --]

Hello,

A simple solution to a program long-unsolved. In GLEP form.

Both attached and published as a gist:

https://gist.github.com/2945569

(please note that github doesn't render GLEP headers correctly)

-- 
Best regards,
Michał Górny

[-- Attachment #1.2: iuse-runtime.txt.rst --]
[-- Type: text/plain, Size: 4558 bytes --]

GLEP: XXX
Title: Optional runtime dependencies via runtime-switchable USE flags
Version: $Revision:$
Last-Modified: $Date:$
Author: Michał Górny <mgorny@gentoo.org>
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 17 Jun 2012
Post-History:


Abstract
========

This GLEP addresses the issue of referencing optional runtime
dependencies in Gentoo packages and ebuilds. It does introduce
a concept of runtime-switchable USE flags to achieve that goal.


Motivation
==========

Optional runtime dependencies are often found in packages installing
various scripts (shell, python, perl). These are not strictly required
for the particular package to work but installing them enables
additional functionality.

Unlike in compiled programs, enabling or disabling those features
(dependencies) does not affect the files installed by the package.
They can be installed and uninstalled independently of the package,
resulting in changes of functionality without a need to rebuild
the package.

Currently such dependencies are usually expressed only through
``pkg_postinst()`` messages. This forces user to manually install
the necessary dependencies, and uninstall them when they are no longer
necessary.

Another solution is using regular USE flags. Those flags do not strictly
follow the principles of USE flags because they do not affect files
installed by the package and are not entirely effective to the package
(a disabled feature will still be available if necessary dependency is
installed). Additionally, it requires unnecessary rebuilds
of the package in order to change the dependencies.


Specification
=============

The ebuilds aiming to provide features enabled through optional runtime
dependencies should:

1. create regular USE flags for all those features, following
   appropriate specifications for Gentoo ebuilds, and including
   the flags in the ``IUSE`` variable;
2. introduce additional ``IUSE_RUNTIME`` variable listing names of USE
   flags related to optional runtime dependencies (without prefixes
   related to IUSE defaults).

Additionally, the ebuilds must obey the following rules:

1. all flags listed in ``IUSE_RUNTIME`` have to be listed in ``IUSE``,
2. flags listed in ``IUSE_RUNTIME`` can be referred in ``RDEPEND``,
   ``PDEPEND`` and ``REQUIRED_USE`` variables,
3. flags listed in ``IUSE_RUNTIME`` must not be referred in phase
   functions, ``DEPEND`` or ``SRC_URI``,
4. flags listed in ``IUSE_RUNTIME`` may be referred through USE
   dependencies by other packages' ``DEPEND``, ``RDEPEND``
   and ``PDEPEND`` variables.

The package manager should treat flags listed in ``IUSE_RUNTIME``
as regular USE flags, except for the following:

1. the state of the flags must be re-evaluated each time the package
   dependency graph is considered,
2. enabling or disabling any of the flags must not involve rebuilding
   the package,
3. the flags may be listed in the visual output in a distinct way
   to inform the user that they affect runtime dependencies only.


Rationale
=========

The proposed solution tries to solve the issue of handling runtime
dependencies while reusing the existing infrastructure. Most
importantly, users will be able to reuse the existing tools
and configuration files to enable and disable optional runtime
and build-time dependencies alike.

The remaining reused features include:

- dependency syntax,
- ability to use ``REQUIRED_USE``, USE dependencies,
- ability to describe flags in `metadata.xml`,
- global flag names (and descriptions).

Alternative proposed solution involved creating additional ``SDEPEND``
variable. That proposition had the following disadvantages:

- being package-oriented rather than feature-oriented,
- lack of ability to express multiple packages required by a single
  feature,
- lack of ability to express cross-feature dependencies,
- lack of ability to describe features provided by enabled packages,
- necessity of implementing a new user interface parts to control
  the dependencies,
- lack of backwards compatibility.


Backwards compatibility
=======================

Package managers not implementing this GLEP will consider
the ``IUSE_RUNTIME`` variable as an irrelevant bash variable and treat
runtime-switchable USE flags as regular USE flags. The dependency tree
will still be consistent yet packages may be rebuilt unnecessarily.


Copyright
=========

This document has been placed in the public domain.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2012-09-30 21:16 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-17 20:31 [gentoo-dev] [pre-GLEP] Optional runtime dependencies via runtime-switchable USE flags Michał Górny
2012-06-17 20:38 ` Ciaran McCreesh
2012-06-17 20:43   ` Michał Górny
2012-06-19  3:04 ` Brian Harring
2012-06-19  8:43   ` Michał Górny
2012-06-19 10:48     ` Ciaran McCreesh
2012-06-19 14:13 ` hasufell
2012-06-19 16:53 ` hasufell
2012-06-20 15:05   ` Marien Zwart
2012-06-20 16:57     ` hasufell
2012-06-20 17:07       ` Michał Górny
2012-06-20 17:11         ` hasufell
2012-06-20 17:24           ` Ciaran McCreesh
2012-06-20 18:53             ` Ralph Sennhauser
2012-06-21  7:29             ` Michał Górny
2012-06-21  7:30               ` Ciaran McCreesh
2012-06-21  7:42                 ` Michał Górny
2012-06-21  7:41                   ` Ciaran McCreesh
2012-06-21  8:54                     ` Michał Górny
2012-06-21  8:56                       ` Ciaran McCreesh
2012-06-22  5:04                   ` Doug Goldstein
2012-06-21 19:05 ` David Leverton
2012-06-21 19:20   ` Ian Stakenvicius
2012-06-21 19:55   ` Michał Górny
2012-06-21 20:26     ` David Leverton
2012-06-21 20:41       ` Michał Górny
2012-06-21 21:32         ` David Leverton
2012-06-22  4:48           ` Zac Medico
2012-06-22 13:42             ` Ian Stakenvicius
2012-06-22 18:29               ` David Leverton
2012-06-22 21:37                 ` Michał Górny
2012-06-22  6:12           ` Michał Górny
2012-06-22  6:45             ` Zac Medico
2012-06-22  7:36               ` Alec Warner
2012-06-22 16:27   ` Marien Zwart
2012-06-22 18:39     ` David Leverton
2012-09-25 15:04 ` hasufell
2012-09-25 15:10   ` Ciaran McCreesh
2012-09-25 15:17     ` hasufell
2012-09-25 15:23       ` Ciaran McCreesh
2012-09-25 15:25       ` Alexis Ballier
2012-09-25 15:30         ` hasufell
2012-09-25 15:36           ` Alexis Ballier
2012-09-25 15:43             ` hasufell
2012-09-25 15:57               ` Fabian Groffen
2012-09-25 16:02                 ` hasufell
2012-09-25 16:17                   ` Ciaran McCreesh
2012-09-25 15:43     ` Alexis Ballier
2012-09-25 16:00       ` Ciaran McCreesh
2012-09-25 16:19         ` Ian Stakenvicius
2012-09-25 16:25           ` Ciaran McCreesh
2012-09-25 16:40             ` Ian Stakenvicius
2012-09-25 18:03               ` [gentoo-dev] Addressing GLEP-62 itself Ian Stakenvicius
2012-09-25 18:47                 ` Ian Stakenvicius
2012-09-25 18:58                   ` Michał Górny
2012-09-25 19:54                     ` Brian Harring
2012-09-26  6:02                       ` Michał Górny
2012-09-26 10:29                         ` Brian Harring
2012-09-26 17:38                           ` Alexis Ballier
2012-09-26 21:02                             ` Brian Harring
2012-09-26 21:35                               ` hasufell
2012-09-26 22:25                               ` Alexis Ballier
2012-09-27 19:53                                 ` Brian Harring
2012-09-27 20:13                                   ` Zac Medico
2012-09-27 20:30                                     ` Ian Stakenvicius
2012-09-27 20:52                                       ` Zac Medico
2012-09-29  9:55                           ` Michał Górny
2012-09-30 21:15                             ` Brian Harring
2012-09-25 18:55                 ` Michał Górny
2012-09-25 16:20         ` [gentoo-dev] [pre-GLEP] Optional runtime dependencies via runtime-switchable USE flags Michał Górny
2012-09-25 16:30           ` Ciaran McCreesh
2012-09-26  1:49             ` [gentoo-dev] " Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox