check-available-binaries.scm 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. ;;;
  19. ;;; Check whether important binaries are available.
  20. ;;;
  21. (use-modules (guix store)
  22. (guix grafts)
  23. (guix packages)
  24. (guix derivations)
  25. (gnu packages emacs)
  26. (gnu packages make-bootstrap)
  27. (srfi srfi-1)
  28. (srfi srfi-26)
  29. (ice-9 format))
  30. (with-store store
  31. (parameterize ((%graft? #f))
  32. (let* ((native (append-map (lambda (system)
  33. (map (cut package-derivation store <> system)
  34. (list %bootstrap-tarballs emacs)))
  35. %hydra-supported-systems))
  36. (cross (map (cut package-cross-derivation store
  37. %bootstrap-tarballs <>)
  38. '("mips64el-linux-gnu"
  39. "arm-linux-gnueabihf")))
  40. (total (append native cross)))
  41. (set-build-options store
  42. #:use-substitutes? #t
  43. #:substitute-urls %default-substitute-urls)
  44. (let* ((total (map derivation->output-path total))
  45. (available (substitutable-paths store total))
  46. (missing (lset-difference string=? total available)))
  47. (if (null? missing)
  48. (format (current-error-port)
  49. "~a packages found substitutable on~{ ~a~}~%"
  50. (length total) %hydra-supported-systems)
  51. (format (current-error-port)
  52. "~a packages are not substitutable:~%~{ ~a~%~}~%"
  53. (length missing) missing))
  54. (exit (null? missing))))))