aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

;;; This file returns a manifest containing entries to build past Guix
;;; releases from the current Guix, as per 'guix time-machine'.

(use-modules (srfi srfi-9) (ice-9 match)
             (guix channels) (guix gexp)
             ((guix store) #:select (%store-monad))
             ((guix monads) #:select (mparameterize return))
             ((guix git) #:select (%repository-cache-directory))
             ((guix build utils) #:select (mkdir-p)))

;; Representation of the latest channels.  This type exists just so we can
;; refer to such records in a gexp.
(define-record-type <guix-instance>
  (guix-instance channels)
  guix-instance?
  (channels guix-instance-channels))

(define-gexp-compiler (guix-instance-compiler (instance <guix-instance>)
                                              system target)
  (match instance
    (($ <guix-instance> channels)
     ;; When this manifest is evaluated by Cuirass, make sure it does not
     ;; fiddle with the cached checkout that Cuirass is also using since
     ;; concurrent accesses are unsafe.
     (mparameterize %store-monad ((%repository-cache-directory
                                   (string-append (%repository-cache-directory)
                                                  "/time-travel/" system)))
       (return (mkdir-p (%repository-cache-directory)))
       (latest-channel-derivation channels)))))

(define (guix-instance->manifest-entry instance)
  "Return a manifest entry for INSTANCE."
  (define (shorten commit)
    (string-take commit 7))

  (manifest-entry
    (name "guix")
    (version (string-join (map (compose shorten channel-commit)
                               (guix-instance-channels instance))
                          "-"))
    (item instance)))

(define (commit->guix-instance commit)
  "Return a Guix instance for COMMIT."
  (guix-instance (list (channel
                        (inherit %default-guix-channel)
                        (commit commit)))))

(define %release-commits
  ;; Release commits: the list of version/commit pairs.
  ;;
  ;; Note: To merely compute the derivation of these revisions, we need to be
  ;; able to build their dependencies.  Some of them no longer build from
  ;; source due to time traps like <https://issues.guix.gnu.org/58650>; those
  ;; need to be built beforehand in a virtual build machine running "in the
  ;; past".
  '(("1.4.0" . "8e2f32cee982d42a79e53fc1e9aa7b8ff0514714")
    ("1.3.0" . "a0178d34f582b50e9bdbb0403943129ae5b560ff")
    ("1.2.0" . "a099685659b4bfa6b3218f84953cbb7ff9e88063")
    ("1.1.0" . "d62c9b2671be55ae0305bebfda17b595f33797f2")
    ("1.0.1" . "d68de958b60426798ed62797ff7c96c327a672ac")
    ("1.0.0" . "6298c3ffd9654d3231a6f25390b056483e8f407c")
    ("0.16.0" . "4a0b87f0ec5b6c2dcf82b372dd20ca7ea6acdd9c")))

(manifest
 (map (match-lambda
        ((version . commit)
         (let ((entry (guix-instance->manifest-entry
                       (commit->guix-instance commit))))
           (manifest-entry
             (inherit entry)
             (version version)))))
      %release-commits))
9c47ce8f2fb280f24c0a6d4e76f8bc7'>build: Add 'run-system-tests.scm'....Ludovic Courtès 2016-05-04tests: Add whole-system test....Ludovic Courtès 2016-05-04build: Preserve stderr for shell tests....Ludovic Courtès 2016-05-04utils: Move combinators to (guix combinators)....Ludovic Courtès 2016-04-27build: 'assert-' targets now depend on the .go files....Ludovic Courtès 2016-04-21build: Move 'Makefile' fragments to subdirectories....Mathieu Lirzin 2016-04-13hydra: Add 'hydra-jobs.scm' target to compute the Hydra jobs....Ludovic Courtès 2016-04-03build: Distribute 'build-aux/test-driver.scm'....Mathieu Lirzin 2016-04-03build: Add a Guile custom test driver using SRFI-64....Mathieu Lirzin 2016-03-23doc: Add "lightweight desktop" OS config example....Ludovic Courtès 2016-03-19build: Protect against misconfiguration of localstatedir....Ludovic Courtès 2016-03-15gnu: linux-libre: Update to 4.5, while preserving linux-libre-4.4....Mark H Weaver 2016-03-14build: Add Ant build system....Ricardo Wurmus 2016-03-09upstream: Fix 'signature-urls' coalescing....Ludovic Courtès 2016-03-03build: Build (guix import github) only when Guile-JSON is available....Ludovic Courtès 2016-02-26import: Add github-updater....Ben Woodcroft 2016-02-22derivations: Move grafts to (guix grafts)....Ludovic Courtès 2016-02-08Add (guix build bournish) and use it in the initrd....Ludovic Courtès 2016-02-02gnu: Add linux-libre-4.1....Mark H Weaver 2016-02-01guix build: Transformations operate on single objects....Ludovic Courtès 2016-01-28build: Use 'GEN' and 'at' silent rules....Mathieu Lirzin 2016-01-28build: Add 'HELP2MAN' silent rule....Mathieu Lirzin 2016-01-28build: Add 'EMACS' silent rule....Mathieu Lirzin 2016-01-28build: Add 'DOT' silent rule....Mathieu Lirzin 2016-01-28build: Add 'DL' silent rule....Mathieu Lirzin 2016-01-22system: grub: Search root device by label or UUID if possible....Ludovic Courtès 2016-01-20tests: Move beatify-description tests to import-tests....Ben Woodcroft 2016-01-18build: Speed up .go compilation....Taylan Ulrich Bayırlı/Kammer 2016-01-12build: 'make check' errors out if file name limits would be hit....Ludovic Courtès