Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

WeakDependencies.txt 4.5 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  1. = Weak Dependencies Policy
  2. == Introduction
  3. Weak dependencies are basically variants of the `+Requires:+` tag and
  4. are matched against (virtual) `+Provides:+` and package names using
  5. `+Epoch-Version-Release+` range comparisons, just like regular
  6. `+Requires:+`. They come in two strengths: "weak" and "hint" and two
  7. directions "forward" (analogous to `+Requires:+`) and "backwards"
  8. (which has no analog in the previous dependency system).
  9. [cols=",,",]
  10. |===============================
  11. | |Forward |Backward
  12. |Weak |Recommends: |Supplements:
  13. |Hint |Suggests: |Enhances:
  14. |===============================
  15. Weak dependencies allow smaller minimal installations while keeping the default
  16. installation feature rich. They also allow packages to specify preferences for
  17. specific providers while maintaining the flexibility of virtual provides, for
  18. example, preferring ruby vs jruby or community-mysql vs mariadb.
  19. == Weak dependencies
  20. Weak dependencies are by default treated similarly to regular
  21. `+Requires:+`. Matching packages are added to the dnf transaction. If
  22. adding the package would lead to an error dnf will by default ignore the
  23. dependency. This allows users to exclude packages that would be added by weak
  24. dependencies or remove them later. To skip installing weak dependencies, pass
  25. `--setopt=install_weak_deps=False` to `dnf`.
  26. As with regular dependencies, weak dependencies MUST be satisfiable within the official Fedora repositories.
  27. Weak dependencies may only be used in a package if the package still functions
  28. without the dependency present. It is acceptable, however, to create packages
  29. that have very limited functionality without adding any of its weak
  30. requirements. Weak dependencies should be used where possible to minimize the
  31. installation for reasonable use cases, especially for building virtual machines
  32. or containers that have a single purpose only and do not require the full
  33. feature set of the package.
  34. Typical use cases for weak dependencies are:
  35. * Documentation
  36. ** Documentation viewers if missing them is handled gracefully
  37. * Examples
  38. * Plug-ins or add-ons
  39. ** Support for file formats
  40. ** Support for protocols
  41. ** ...
  42. == Hints
  43. Hints are by default ignored by dnf. They may be used by GUI tools to offer
  44. add-on packages that are not installed by default but might be useful in
  45. combination with the installed packages. The requirements of the main use cases
  46. of a package should not merely be referenced by hints but included by strong or
  47. weak dependencies.
  48. == Package Preference
  49. dnf (or more precisely libsolv) will use weak dependencies and hints to decide
  50. which package to use if there is a choice between multiple equally valid
  51. packages. In these cases packages that are pointed at by dependencies from
  52. installed or to be installed packages are preferred. Note, that this does not
  53. alter the normal rules of dependency resolution. For example, weak
  54. dependencies cannot enforce a older version of a package to be chosen.
  55. If there are multiple (typically virtual) providers for a dependency the
  56. requiring package may add a Suggests: to provide a hint to the dependency
  57. resolver as to which option is preferred. `+Enhances:+` should only
  58. be used for the rare occasion when the main package and other providers agree
  59. that adding the hint to the required package is for some reason the cleaner
  60. solution.
  61. === Real life example
  62. Package A:
  63. Requires: mysql
  64. Package mariadb:
  65. Provides: mysql
  66. Package community-mysql:
  67. Provides: mysql
  68. If you want to prefer mariadb over community-mysql -> add `+Suggests:+`
  69. `+mariadb+` to Package A.
  70. == Forward vs Backward Dependencies
  71. Forward dependencies are, as Requires, evaluated for packages that are being
  72. installed. The best of the matching (fulfilling) packages are also installed.
  73. For reverse dependencies the packages containing the dependency are installed if
  74. a matching package is getting installed also.
  75. In general forward dependencies should be used. Add the dependency to the
  76. package getting the other package added to the system.
  77. Reverse dependencies are mainly designed for 3rd party vendors who can attach
  78. their plug-ins/add-ons/extensions to distribution or other 3rd party packages.
  79. Within Fedora the control over which packages a package requires should stay
  80. with the package maintainer. There are, however, cases when it is easier for
  81. the requiring package not needing to care about all add-ons. In this cases
  82. reverse dependencies may be used with the agreement of the package maintainer of
  83. the targeted package.
  84. Note, that EPEL or other third party repositories may have (and are encouraged
  85. to have) a different policy.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...