report 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Goals:
  2. * Reduce rift between Guix and Rust by making Rust packages work
  3. nicely in Guix.
  4. * Eliminating #:skip-build? and making compile time faster,
  5. by not re-compiling dependencies and by reusing compiled dependencies
  6. in dependents. (solved)
  7. * Allow crates to be shared libraries, such that grafting can work
  8. and maybe for space usage. (not solved yet)
  9. * regular inputs/native-inputs (solved)
  10. Non-goals:
  11. * Produce exactly the same binaries with exactly the same dependencies as with
  12. Cargo. If you want to reproduce a binary produced with Cargo, use Cargo.
  13. * Cross-compilation is left for later.
  14. Side-goals: (not the main goal, but partially solved along the way)
  15. * Having multiple versions of the same dependency is inconvenient for
  16. antioxidant, so often only the latest version is preserved.
  17. Less package variants -> less space usage, less compilation time, less
  18. opportunities for sneaking malware through, less old buggy versions.
  19. * As part of resolving build failures caused by using antioxidant,
  20. some crates were updated or added.
  21. Solved issues:
  22. * <https://issues.guix.gnu.org/25327>
  23. ‘cargo build-system should be able to filter out target.cfg(windows) dependencies’
  24. * <https://issues.guix.gnu.org/53127>
  25. ‘[PATCH RFC] Turning Rust/Cargo inputs into “regular” inputs?’
  26. * <https://issues.guix.gnu.org/40412>
  27. ‘cargo-build-system hides the package dependency graph’
  28. (at least, after transforming the packages appropriately)
  29. * <https://issues.guix.gnu.org/50015>
  30. ‘Rust packages are not reproducible’
  31. (at least, "guix build --check" hasn't failed for me yet)
  32. Avoided issues:
  33. * <https://issues.guix.gnu.org/42049>
  34. ‘[PATCH 0/4] build-system/cargo: Propagations across the crate closure.’
  35. * <https://issues.guix.gnu.org/36470>
  36. ‘Cargo-build-system guix-vendor does not provide packages correctly 2 levels down’
  37. * <https://issues.guix.gnu.org/40413>
  38. ‘Handling source-only dependencies in a generic way’
  39. Pros/cons of antioxidant:
  40. * pro: less compilation time: when rust-foo is compiled, antioxidant
  41. only compiles rust-foo and not its dependencies rust-bar0 ... rust-bar200.
  42. * pro: theoretically less space usage (source code is not copied to the #$output
  43. and build results of dependencies are linked to). However: not measured,
  44. and we're not setting LTO and -Os compilation flags yet.
  45. * pro: antioxidant just uses inputs/native-inputs, so "guix graph", "guix refresh -l"
  46. will be useful after transforming existing package definitions.
  47. * cons: probably not everything of Cargo.toml is implemented yet
  48. Status:
  49. * Unless they have been broken, the following packages are known to build:
  50. antioxidated-castor
  51. antioxidated-dutree
  52. antioxidated-diffr
  53. antioxidated-git-absorb
  54. antioxidated-hex
  55. antioxidated-hexyl
  56. antioxidated-ripgrep
  57. antioxidated-rtss
  58. antioxidated-sniffglue
  59. antioxidated-swayhide
  60. antioxidated-tealdeer
  61. * I wouldn't know how many fail to build
  62. Next steps :
  63. (a) The antioxidant channel has information on how to transform
  64. package definitions using cargo-build-sstem to antioxidant-build-system.
  65. Maybe "guix style" could be taught to perform these changes to
  66. the source code?
  67. (b) To get a good grasp on what builds/what not, it would be useful
  68. to build the channel at ci.guix.gnu.org or such. More concretely,
  69. the CI would grab all cargo-build-system rust apps from (gnu packages ...),
  70. feed them to the package transformation procedure 'vitaminate/auto',
  71. and build the results. Then we can have a look at a dashboard like
  72. <https://ci.guix.gnu.org/eval/361030/dashboard>.
  73. (c) Maybe there could be some kind of transition period, where
  74. 'antioxidant.scm' and 'antioxidant-packages.scm' is added
  75. to the Guix repo, known-to-build packages are replaced by
  76. their antioxidated variant (using vitaminate/auto) and gradually
  77. all rust apps are becoming supported by antioxidant. Finally,
  78. when all are supported, the "guix style" from (a) could be run
  79. to clean up the source code?
  80. Though for now, I would prefer to do something like (b) first.
  81. (d) Implement support for "cdylib" such that things like librsvg can be built.
  82. (e) Make sure the optimisation settings are reasonable (LTO, -Os etc)