README.MultiArch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Before we start with this topic: Note that MultiArch is not yet ready for
  2. prime time and/or for the casual user. The implementation is so far widely
  3. untested and only useful for developers of packagemanagment tools which
  4. use APT and his friends and maintainers of (upcoming) MultiArch packages.
  5. This README is especially NOT written for the casual user and is NOT a
  6. usage guide - you have been warned. It is assumed that the reader has
  7. at least a bit of knowledge about APT internals, dependency relations
  8. and the MultiArch spec [0].
  9. The implementation is focused on NOT breaking existing singleArch-only
  10. applications and/or systems as this is the current status-quo for all
  11. systems. Also, many systems don't need (or can't make use of) MultiArch,
  12. so APT will proceed in thinking SingleArch as long as it is not explicitly
  13. told to handle MultiArch:
  14. To activate MultiArch handling you need to specify architectures you
  15. want to be considered by APT with the config list APT::Architectures
  16. (Insert architectures in order of preference).
  17. APT will download Packages files for all these architectures in the
  18. update step. Exception: In the sourcelist is the optionfield used:
  19. deb [ arch=amd64,i386 ] http://example.org/ experimental main
  20. (This optionfield is a NOP in previous apt versions)
  21. Internally in APT a package is represented as a PkgIterator -
  22. before MultiArch this PkgIterator was architecture unaware,
  23. only VerIterators include the architecture they came from.
  24. This is/was a big problem as all versions in a package are
  25. considered for dependency resolution, so pinning will not work in all cases.
  26. The problem is solved by a conceptional change:
  27. A PkgIterator is now architecture aware, so the packages
  28. of foobar for amd64 and for i386 are now for apt internal totally
  29. different packages. That is a good thing for e.g. pinning, but
  30. sometimes you need the information that such packages are belonging together:
  31. All these foobar packages therefore form a Group accessible with GrpIterators.
  32. Note that the GrpIterator has the same name as all the packages in this group,
  33. so e.g. apt-cache pkgnames iterates over GrpIterator to get the package names:
  34. This is compatible to SingleArch as a Group consists only of a single package
  35. and also to MultiArch as a Group consists of possible many packages which
  36. all have the same name and are therefore out of interest for pkgnames.
  37. Caused by the paragraph "Dependencies involving Architecture: all packages"
  38. in the MultiArch spec we have a second major conceptional change
  39. which could even break existing applications, but we hope for the best…
  40. An Architecture: all package is internally split into pseudo packages
  41. for all MultiArch Architectures and additional a package with the
  42. architecture "all" with no dependencies which is a dependency of all
  43. these architecture depending packages. While the architecture depending
  44. packages are mainly used for dependency resolution (a package of arch A which
  45. depends on an arch all package assumes that the dependencies of this package
  46. are also from arch A. Packages also sometimes change from any to all or v.v.)
  47. the arch "all" package is used for scheduling download/installation of the
  48. underlying "real" package. Note that the architecture depending packages can
  49. be detected with Pseudo() while the "all" package reports exactly this arch
  50. as package architecture and as pseudo architecture of the versions of this pkg.
  51. Beware: All versions of a "real" architecture all package will be report "all"
  52. as their architecture if asked with Arch() regardless if they are the "all" or
  53. the architecture depending packages. If you want to know the architecture this
  54. pseudo package was created for call Arch(true). Also, while the spec say that
  55. arch:all packages are not allowed to have a MultiArch flag APT assigns a
  56. special value to them: MultiArch: all.
  57. As you might guess this arch:all handling has a few problems (but we think so
  58. far that the problems are minor compared to the problems we would have with
  59. other implementations.)
  60. APT doesn't know which pseudo packages of such an arch all package are
  61. "installed" (to satisfy dependencies), so APT will generate a Cache in which
  62. all these pseudo packages are installed (e.g. apt-cache policy will display
  63. them all as installed). Later in the DepCache step it will "remove"
  64. all pseudo packages whose dependencies are not satisfied.
  65. The expense is that if the package state is broken APT could come to the
  66. conclusion to "remove" too many pseudo packages, but in a stable environment
  67. APT should never end up in a broken system state…
  68. Given all these internal changes it is quite interesting that the actual
  69. implementation of MultiArch is trivial: Some implicit dependencies and a few
  70. more provides are all changes needed to get it working. Especially noteworthy
  71. is that it wasn't needed to change the resolver in any way and other parts only
  72. need to be told about ignoring pseudo packages or using GrpIterator instead of
  73. PkgIterator, so chances are good that libapt-applications will proceed to work
  74. without or at least only require minor changes, but your mileage may vary…
  75. Known Issues and/or noteworthy stuff:
  76. * The implementation is mostly untested, so it is very likely that APT will
  77. eat your kids if you aren't as lucky as the author of these patches.
  78. * the (install)size of a pseudo package is always NULL - if you want to know
  79. the (install)size you need to get the info from the arch "all" package.
  80. * It is maybe confusing, but the arch "all" package does have the same versions
  81. and in general roughly the same information with one subtil difference:
  82. It doesn't have any dependency, regardless of the type. The pseudo packages
  83. depend on this package.
  84. * apt-cache policy foobar on installed architecture all package foobar will
  85. report all architecture depending packages as installed. Displaying here the
  86. correct information would require to build the complete DepCache…
  87. * [BUG] An installed package which changes the architecture from any to all
  88. (and v.v.) shows up in the NEW packages section instead of UPGRADE.
  89. * [TODO] Investigate the DepCache pseudo-package killer heuristic:
  90. e.g. add more safety guards…
  91. * [FIXME] a few corner cases/missing features marked as FIXME in the code
  92. [0] https://wiki.ubuntu.com/MultiarchSpec