aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2018, 2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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/>.

(define-module (test-system)
  #:use-module (gnu)
  #:use-module ((gnu services) #:select (service-value))
  #:use-module (guix store)
  #:use-module (guix monads)
  #:use-module ((guix gexp) #:select (lower-object))
  #:use-module ((guix utils) #:select (%current-system))
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64))

;; Test the (gnu system) module.

(define %root-fs
  (file-system
    (device (file-system-label "my-root"))
    (mount-point "/")
    (type "ext4")))

(define %os
  (operating-system
    (host-name "komputilo")
    (timezone "Europe/Berlin")
    (locale "en_US.utf8")
    (bootloader (bootloader-configuration
                 (bootloader grub-bootloader)
                 (targets '("/dev/sdX"))))
    (file-systems (cons %root-fs %base-file-systems))

    (users %base-user-accounts)))

(define %luks-device
  (mapped-device
   (source "/dev/foo") (target "my-luks-device")
   (type luks-device-mapping)))

(define %os-with-mapped-device
  (operating-system
    (host-name "komputilo")
    (timezone "Europe/Berlin")
    (locale "en_US.utf8")
    (bootloader (bootloader-configuration
                 (bootloader grub-bootloader)
                 (targets '("/dev/sdX"))))
    (mapped-devices (list %luks-device))
    (file-systems (cons (file-system
                          (inherit %root-fs)
                          (dependencies (list %luks-device)))
                        %base-file-systems))
    (users %base-user-accounts)))

(%graft? #f)


(test-begin "system")

(test-assert "operating-system-store-file-system"
  ;; %BASE-FILE-SYSTEMS defines a bind-mount for /gnu/store, but this
  ;; shouldn't be a problem.
  (eq? %root-fs
       (operating-system-store-file-system %os)))

(test-assert "operating-system-store-file-system, prefix"
  (let* ((gnu (file-system
                (device "foobar")
                (mount-point (dirname (%store-prefix)))
                (type "ext5")))
         (os  (operating-system
                (inherit %os)
                (file-systems (cons* gnu %root-fs
                                     %base-file-systems)))))
    (eq? gnu (operating-system-store-file-system os))))

(test-assert "operating-system-store-file-system, store"
  (let* ((gnu (file-system
                (device "foobar")
                (mount-point (%store-prefix))
                (type "ext5")))
         (os  (operating-system
                (inherit %os)
                (file-systems (cons* gnu %root-fs
                                     %base-file-systems)))))
    (eq? gnu (operating-system-store-file-system os))))

(test-equal "operating-system-user-mapped-devices"
  '()
  (operating-system-user-mapped-devices %os-with-mapped-device))

(test-equal "operating-system-boot-mapped-devices"
  (list %luks-device)
  (operating-system-boot-mapped-devices %os-with-mapped-device))

(test-equal "operating-system-boot-mapped-devices, implicit dependency"
  (list %luks-device)

  ;; Here we expect the implicit dependency between "/" and
  ;; "/dev/mapper/my-luks-device" to be found, in spite of the lack of a
  ;; 'dependencies' field in the root file system.
  (operating-system-boot-mapped-devices
   (operating-system
     (inherit %os-with-mapped-device)
     (file-systems (cons (file-system
                           (device "/dev/mapper/my-luks-device")
                           (mount-point "/")
                           (type "ext4"))
                         %base-file-systems)))))

(test-equal "non-boot-file-system-service"
  '()

  ;; Make sure that mapped devices with at least one needed-for-boot user are
  ;; handled exclusively from the initrd.  See <https://bugs.gnu.org/31889>.
  (append-map file-system-dependencies
              (service-value
               ((@@ (gnu system) non-boot-file-system-service)
                (operating-system
                  (inherit %os-with-mapped-device)
                  (file-systems
                   (list (file-system
                           (mount-point "/foo/bar")
                           (device "qux:baz")
                           (type "none")
                           (dependencies (list %luks-device)))
                         (file-system
                           (device (file-system-label "my-root"))
                           (mount-point "/")
                           (type "ext4")
                           (dependencies (list %luks-device))))))))))

(test-assert "lower-object, %current-system sensitivity"
  ;; Make sure that 'lower-object' returns the same derivation, no matter what
  ;; '%current-system' is.  See <https://issues.guix.gnu.org/55951>.
  (let ((drv1 (with-store store
                (parameterize ((%current-system "x86_64-linux"))
                  (run-with-store store
                    (lower-object %os "aarch64-linux")))))
        (drv2 (with-store store
                (parameterize ((%current-system "aarch64-linux"))
                  (run-with-store store
                    (lower-object %os "aarch64-linux"))))))
    (eq? drv1 drv2)))

(test-end)
uix/commit/gnu/packages/version-control.scm?id=33e58fa963e40b5a8e0e2ba47adfe71dec7ddc7f'>gnu: libgit2-1.5: Update to 1.5.2....* gnu/packages/version-control.scm (libgit2-1.5): Update to 1.5.2. Change-Id: I6243b17dac63b68ffc7c69953ac0f20d56ed90c3 Efraim Flashner 2024-02-28Merge branch 'rust-team'...Change-Id: Iee31c5de29c357c822f60df4fa8ce758779eb349 Efraim Flashner 2024-02-27gnu: libgit2-1.4: Update to 1.4.6....* gnu/packages/version-control.scm (libgit2-1.4): Update to 1.4.6. Change-Id: Ieb470e93d6be9a2e45585b747efb695ef9f33161 Efraim Flashner 2024-02-27gnu: libgit2-1.7: Update to 1.7.2....* gnu/packages/version-control.scm (libgit2-1.7): Update to 1.7.2. Change-Id: I60ad4aa2a5b29b027755cf8add848bd4a8b71282 Efraim Flashner 2024-02-26gnu: libgit2: Introduce ‘libgit2-1.5’ variable....* gnu/packages/version-control.scm (libgit2): Rename to… (libgit2-1.5): … this. (libgit2): Alias for ‘libgit2-1.5’. Change-Id: I7f6aff23df3b968d914736fe723dcdd435176ce2 Ludovic Courtès 2024-02-26gnu: libgit2: Set ‘GITTEST_FLAKY_STAT’ when running tests on GNU/Hurd....* gnu/packages/version-control.scm (libgit2)[arguments]: Install ‘pre-check’ phase when ‘target-hurd?’ returns true. Change-Id: I664d4aa2a0ad76a10a47ae7bc3c5912756972b46 Ludovic Courtès 2024-02-25gnu: git-filter-repo: Update to 2.38.0....* gnu/packages/patches/git-filter-repo-generate-doc.patch: New file. * gnu/local.mk (dist_patch_DATA): Regisiter it. * gnu/packages/version-control.scm (git-filter-repo): Update to 2.38.0. [source]: Switch to git-fetch. Use the patch. [build-system]: Switch to gnu-build-system. [native-inputs]: Add asciidoc, docbook-xsl, libxml2, xmlto. Modified-by: Hilton Chain <hako@ultrarare.space> Change-Id: I7b15975ea56c44ae580d19cfe5a9e3eb75c6db0d Signed-off-by: Hilton Chain <hako@ultrarare.space> Josselin Poiret 2024-02-25gnu: b4: Ensure git presence....* gnu/packages/version-control.scm (b4): Ensure git presence. [arguments]<#:phases>: Add phase hardcode-git-bin. [inputs]: Add git-minimal. Change-Id: Ib2dca06009cdacc0e5ab4ab227cd30991474404c Signed-off-by: Hilton Chain <hako@ultrarare.space> Nicolas Graves via Guix-patches via 2024-02-20gnu: rust-gix: Move to (gnu packages crates-vcs)....* gnu/packages/crates-io.scm (rust-gix-0.54, rust-gix-0.45, rust-gix-actor-0.27, rust-gix-actor-0.21, rust-gix-archive-0.5, rust-gix-attributes-0.19, rust-gix-attributes-0.13, rust-gix-bitmap-0.2, rust-gix-chunk-0.4, rust-gix-command-0.2, rust-gix-commitgraph-0.21, rust-gix-commitgraph-0.16, rust-gix-config-0.30, rust-gix-config-0.23, rust-gix-config-value-0.14, rust-gix-config-value-0.12, rust-gix-credentials-0.20, rust-gix-credentials-0.15, rust-gix-date-0.8, rust-gix-date-0.5, rust-gix-diff-0.36, rust-gix-diff-0.30, rust-gix-discover-0.25, rust-gix-discover-0.19, rust-gix-features-0.35, rust-gix-features-0.30, rust-gix-filter-0.5, rust-gix-fs-0.7, rust-gix-fs-0.2, rust-gix-glob-0.13, rust-gix-glob-0.8, rust-gix-hash-0.13, rust-gix-hash-0.11, rust-gix-hashtable-0.4, rust-gix-hashtable-0.2, rust-gix-ignore-0.8, rust-gix-ignore-0.3, rust-gix-index-0.25, rust-gix-index-0.17, rust-gix-lock-10, rust-gix-lock-6, rust-gix-macros-0.1, rust-gix-mailmap-0.19, rust-gix-mailmap-0.13, rust-gix-negotiate-0.8, rust-gix-negotiate-0.2, rust-gix-object-0.37, rust-gix-object-30, rust-gix-odb-0.53, rust-gix-odb-0.46, rust-gix-pack-0.43, rust-gix-pack-0.36, rust-gix-packetline-0.16, rust-gix-packetline-blocking-0.16, rust-gix-path-0.10, rust-gix-path-0.8, rust-gix-pathspec-0.3, rust-gix-prompt-0.7, rust-gix-prompt-0.5, rust-gix-protocol-0.40, rust-gix-protocol-0.33, rust-gix-quote-0.4, rust-gix-ref-0.37, rust-gix-ref-0.30, rust-gix-refspec-0.18, rust-gix-refspec-0.11, rust-gix-revision-0.22, rust-gix-revision-0.15, rust-gix-revwalk-0.8, rust-gix-revwalk-0.1, rust-gix-sec-0.10, rust-gix-sec-0.8, rust-gix-status-0.1, rust-gix-submodule-0.4, rust-gix-tempfile-10, rust-gix-tempfile-6, rust-gix-trace-0.1, rust-gix-transport-0.37, rust-gix-transport-0.32, rust-gix-traverse-0.33, rust-gix-traverse-0.26, rust-gix-url-0.24, rust-gix-url-0.19, rust-gix-utils-0.1, rust-gix-validate-0.8, rust-gix-validate-0.7, rust-gix-worktree-0.26, rust-gix-worktree-0.18, rust-gix-worktree-state-0.3, rust-gix-worktree-stream-0.5): Move from here ... * gnu/packages/crates-vcs.scm: ... to here. Change-Id: Ie4f7466ded8ecd5210c7cce2d26f41c1ed926922 Efraim Flashner 2024-02-19gnu: go-github-go-git: Adjust imports....* gnu/packages/version-control.scm (go-github-go-git) [native-inputs]: Move go-github-com-alcortesm-tgz, go-github-com-emirpasic-gods, go-github-com-go-git-gcfg, go-github-com-go-git-go-billy, go-github-com-go-git-go-git-fixtures, go-github-com-imdario-mergo, go-github-com-jbenet-go-context, go-github-com-kevinburke-ssh-config, go-github-com-mitchellh-go-homedir, go-github-com-sergi-go-diff, go-github-com-xanzy-ssh-agent, go-golang-org-x-crypto, go-golang-org-x-net, go-golang-org-x-text, go-gopkg-in-check-v1 and go-gopkg-in-warnings from here ... [propagated-inputs]: ... to here. Change-Id: I9c16fe28dcbbaf7c53e201625f56a04bceb21fcb Sharlatan Hellseher 2024-02-19gnu: go-github-go-git: Remove labels....* gnu/packages/version-control.scm (go-github-go-git) [native-inputs]: Remove labels. Change-Id: Icf5eb3902a520e8f1306d72c7cbc533ff45d8cf4 Sharlatan Hellseher 2024-02-19gnu: ghq: Fix build....Fix build as seen in <https://ci.guix.gnu.org/build/3490264/details>. * gnu/packages/version-control.scm (ghq): Use G-expressions. [arguments] <#:go>: Use go-1.21. <#:phases>: Remove trailing #t from lambda. Change-Id: Ifb1e133a2570dcd04212ef43b46c8b41c3507c88 Sharlatan Hellseher 2024-02-19gnu: ghq: Remove package labels....* gnu/packages/version-control.scm (ghq): Remove labels. Change-Id: Icc4b951bac4a1187c5d83a8309753d1dd842273a Sharlatan Hellseher 2024-02-19gnu: go-github-com-songmu-gitconfig: Move to golang-xyz....* gnu/packages/golang.scm (go-github-com-songmu-gitconfig): Move from here ... * gnu/packages/golang-xyz.scm: ... to here. * gnu/packages/version-control.scm: Add (gnu packages golang-xyx) module. Change-Id: Ibab2595d981d46096501bb8ab495e899d2aacf7d Sharlatan Hellseher 2024-02-18gnu: Add git-sizer....* gnu/packages/version-control.scm (git-sizer): New variable. Change-Id: I82a61e364782dabfd59d0e81ff310fa916b5ff23 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Greg Hogan 2024-02-13gnu: go-golang-org-x-net: Move to golang-build....* gnu/packages/golang.scm (go-golang-org-x-net, go-golang-org-x-net-0.17, go-golang-org-x-net-html): Move from here ... * gnu/packages/golang-build.scm: ... to here. * gnu/packages/configuration-management.scm: Add (gnu packages golang-build) module. * gnu/packages/education.scm: As above ... * gnu/packages/file-systems.scm: As above ... * gnu/packages/golang-check.scm: As above ... * gnu/packages/golang-crypto.scm: As above ... * gnu/packages/golang-web.scm: As above ... * gnu/packages/golang-xyz.scm: As above ... * gnu/packages/golang.scm: As above ... * gnu/packages/ipfs.scm: As above ... * gnu/packages/messaging.scm: As above ... * gnu/packages/networking.scm: As above ... * gnu/packages/uucp.scm: As above ... * gnu/packages/version-control.scm: As above ... Change-Id: If009e62555ada293f17cf0f42fde82c21ef4615e Sharlatan Hellseher 2024-01-28gnu: go-github-com-xanzy-ssh-agent: Move to (gnu packages golang-crypto)....* gnu/packages/golang.scm (go-github-com-xanzy-ssh-agent): Move from here ... * gnu/packages/golang-crypto.scm: ... to here. Change-Id: I9eff26086b2b5e9e53e9271a64060f18b6197b3c Sharlatan Hellseher 2024-01-22gnu: cgit: Fix patch-absolute-file-names phase....* gnu/packages/version-control.scm (cgit) [arguments]: Fix regexp in patch-absolute-file-names phase. Change-Id: I06c624ba23bfd0b8ca45045d1d2155c53258047e Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> muradm 2024-01-09gnu: Add xdiff....* gnu/packages/version-control.scm (xdiff): New variable. Maxim Cournoyer 2024-01-07gnu: cgit: Update to 1.2.3-793c420....* gnu/packages/version-control.scm (cgit): Update to 793c420897e18eb3474c751d54cf4e0983f85433. [inputs]: Update git to 2.43.0. Change-Id: I3441e9e2837d22ae208f5cccc53d815cc3e0f042 Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Tomas Volf 2024-01-03gnu: go-github-com-aws-aws-sdk-go-v2: Move to (gnu packages golang-web)....* gnu/packages/golang.scm (go-github-com-aws-aws-sdk-go-v2): Move from here... * gnu/packages/golang-web.scm: ...to here. * gnu/packages/version-control.scm: Add (gnu packages golang-web) module. Change-Id: I6e980749d9f9c1373adfc717b0195a1b8c32d6af Sharlatan Hellseher 2023-12-31gnu: shflags: Update to 1.3.0....* gnu/packages/version-control.scm (shflags): Update to 1.3.0. Change-Id: I8463a45d4a2526d971441292e7ec94c9e0710521 Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Greg Hogan 2023-12-25gnu: Adjust to removing ed.scm and nano.scm...This is a follow-up to f6817e71dff7d0d9fdb55db8b85a1d3d04e2bf5a and e11e65a9ad08e18ea2faac3c9f4639a7b189bf76. * gnu/installer.scm, gnu/packages/algebra.scm, gnu/packages/base.scm, gnu/packages/cook.scm, gnu/packages/lisp.scm, gnu/packages/patchutils.scm, gnu/packages/version-control.scm, gnu/packages/web-browsers.scm, gnu/system.scm: Adjust module imports. Change-Id: I25e5519fa003c35a14b81c3dda37b24527858634 Efraim Flashner 2023-12-10Merge remote-tracking branch 'origin/master' into rust-team...Change-Id: Ic45f7071abd6a02c2ccad411500e5103c8272ffb Efraim Flashner 2023-11-28gnu: stgit-2: Install info pages, shell completions....* gnu/packages/version-control.scm (stgit-2)[arguments]: Add a phase to build the info pages and shell completions. Add a phase to install the info pages and shell completions. [native-inputs]: Add asciidoc, docbook2x, libxslt, perl, texinfo, xmlto. Change-Id: Ie82d723e9dc2448492f327329c5a4ef0370f532e Efraim Flashner 2023-11-28gnu: Add stgit-2....* gnu/packages/version-control.scm (stgit-2): New variable. Change-Id: Ic5f29a5f0e3b5caa6c2aee4daf65d7e5dc09a6d5 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Steve George 2023-11-28gnu: Add libgit2-1.7....* gnu/packages/version-control.scm (libgit2-1.7): New variable. Change-Id: I872208575dace0868dc7a2acd35c08f43871030e Efraim Flashner 2023-11-28gnu: Add libgit2-1.6....* gnu/packages/version-control.scm (libgit2-1.6): New variable. Change-Id: I6e6bc8a7f0a084c299899d97c74b70eacceb810b Efraim Flashner 2023-12-02gnu: hut: Update to 0.4.0...* gnu/packages/version-control.scm (hut): Update to 0.4.0 Change-Id: Ib5dc28de6dbc3b69ca55a9530b923f71ca0ce7b5 Signed-off-by: Andrew Tropin <andrew@trop.in> Co-authored-by: Andrew Tropin <andrew@trop.in> Filip Lajszczak 2023-11-08gnu: git-lfs: Support building on more systems....* gnu/packages/version-control.scm (git-lfs)[arguments]: Only run man-page related phases when ruby-asciidoctor is available. [native-inputs]: Only include ronn-ng, ruby-asciidoctor when building on a platform which has support for ruby-asciidoctor. Change-Id: Icbf8416998dc5d1f9d7c8299b4f929380dc29165 Efraim Flashner