aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2016, 2017 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/>.

(define-module (test-size)
  #:use-module (guix store)
  #:use-module (guix monads)
  #:use-module (guix packages)
  #:use-module (guix derivations)
  #:use-module (guix gexp)
  #:use-module (guix tests)
  #:use-module (guix scripts size)
  #:use-module (gnu packages)
  #:use-module (gnu packages bootstrap)
  #:use-module (ice-9 match)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-64))


(test-begin "size")

(test-assertm "store-profile"
  (mlet* %store-monad ((file1 (gexp->derivation "file1"
                                                #~(symlink #$%bootstrap-guile
                                                           #$output)))
                       (file2 (text-file* "file2"
                                          "the file => " file1)))
    (define (matching-profile item)
      (lambda (profile)
        (string=? item (profile-file profile))))

    (mbegin %store-monad
      (built-derivations (list file2))
      (mlet %store-monad ((profiles (store-profile
                                     (list (derivation->output-path file2))))
                          (bash     (interned-file
                                     (search-bootstrap-binary
                                      "bash" (%current-system)) "bash"
                                      #:recursive? #t))
                          (guile    (package->derivation %bootstrap-guile)))
        (define (lookup-profile item)
          (find (matching-profile (if (derivation? item)
                                      (derivation->output-path item)
                                      item))
                profiles))

        (letrec-syntax ((match* (syntax-rules (=>)
                                  ((_ ((drv => profile) rest ...) body)
                                   (match (lookup-profile drv)
                                     ((? profile? profile)
                                      (match* (rest ...) body))))
                                  ((_ () body)
                                   body))))
          ;; Make sure we get all three profiles with sensible values.
          (return (and (= (length profiles) 4)
                       (match* ((file1 => profile1)
                                (file2 => profile2)
                                (guile => profile3)
                                (bash  => profile4)) ;dependency of GUILE
                         (and (> (profile-closure-size profile2) 0)
                              (= (profile-closure-size profile2)
                                 (+ (profile-self-size profile1)
                                    (profile-self-size profile2)
                                    (profile-self-size profile3)
                                    (profile-self-size profile4))))))))))))

(test-assertm "store-profile with multiple items"
  (mlet* %store-monad ((file1 (gexp->derivation "file1"
                                                #~(symlink #$%bootstrap-guile
                                                           #$output)))
                       (file2 (text-file* "file2"
                                          "the file => " file1)))
    (mbegin %store-monad
      (built-derivations (list file2))
      (mlet %store-monad ((profiles  (store-profile
                                      (list (derivation->output-path file2)
                                            (derivation->output-path file1))))
                          (reference (store-profile
                                      (list (derivation->output-path file2)))))
        (return (and (= (length profiles) 4)
                     (lset= equal? profiles reference)))))))

(test-end "size")

;;; Local Variables:
;;; eval: (put 'match* 'scheme-indent-function 1)
;;; End:
cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: python-jaraco-functools: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/python-xyz.scm (python-jaraco-functools)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: python-path: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/python-xyz.scm (python-path)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: python-fonttools-full: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/python-xyz.scm (python-fonttools-full)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: proot: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/linux.scm (proot)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: julia-interpolations: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/julia-xyz.scm (julia-interpolations)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: julia-reversediff: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/julia-xyz.scm (julia-reversediff)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: julia-forwarddiff: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/julia-xyz.scm (julia-forwarddiff)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: julia-arrayinterface: Don't ask to run tests when cross-compiling.Maxime Devos * gnu/packages/julia-xyz.scm (julia-arrayinterface)[arguments]{#:tests?}: When cross-compiling, set to #false. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30gnu: ghc-statistics: Properly enable tests.Maxime Devos The comment states there are test failures and hence it is implied that the intent was to disable tests, not enable them, but tests pass and the code below enabled tests instead of disabling them. Remove #:tests? #true to satisfy the tests-true linter. * gnu/packages/haskell-xyz.scm (ghc-statistics)[arguments]{#:tests?}: Remove. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30guix system: Use standard cross and native build options.Thiago Jung Bauermann This change prevents guix system from erroring out with an ugly backtrace when it's passed an invalid value to the “--system” or “--target” option. It also adds the “--list-systems” and “--list-targets” options. The manual section about guix system doesn't mention the “--target” option, so add it there. * guix/scripts/system (show-help): Call show-cross-build-options-help and show-native-build-options-help. (%options): Remove own implementation of “system” and “target” options and use the ones in %standard-cross-build-options and %standard-native-build-options. * doc/guix.texi (Invoking guix system): Document “--target” option. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-08-30bootloader: Wrap lines.Mathieu Othacehe * gnu/bootloader (<bootloader-configuration>): Wrap lines, no functional change. 2022-08-30bootloader: Add device-tree-support? option.Reza Alizadeh Majd In some specific cases where the device tree file is already loaded in RAM, it can be preferable that the bootloader does not try to use a device tree from the Linux kernel tree. * gnu/bootloader.scm (<bootloader-configuration>)[device-tree-support?]: New field. * gnu/bootloader/extlinux.scm (extlinux-configuration-file): Add FDTDIR line based on <device-tree-support?> field of <bootloader-configuration>. * doc/guix.texi (Bootloader Configuration)[device-tree-support?]: Add documentation for the new field. 2022-08-30Revert "reconfigure: Use 'current-channels' to obtain provenance data."宋文武 This fixes <https://issues.guix.gnu.org/57480>. This reverts commit b08439809f0868a74d0bd0e14d45cb3e5dd46a8c. 2022-08-30gnu: Add hydrus-network.Tomasz Jeneralczyk * gnu/packages/image-viewers.scm (hydrus-network): Add variable. Co-authored-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30gnu: python-cloudscraper: Update to 1.2.60.Tomasz Jeneralczyk * gnu/packages/python-web.scm (python-cloudscraper): Update to 1.2.60 [propagated-inputs]: Change python-pyparsing to its mainstream version. Co-authored-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30gnu: opencv: Build Python bindings.Tomasz Jeneralczyk * gnu/packages/image-processing.scm (opencv)[arguments]: Change variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30gnu: Add python-mpv.Tomasz Jeneralczyk * gnu/packages/python-xyz.scm (python-mpv): Add variable. Co-authored-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30gnu: Add python-xvfbwrapper.Tomasz Jeneralczyk * gnu/packages/python-check.scm (python-xvfbwrapper): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30gnu: Add swftools.Tomasz Jeneralczyk * gnu/packages/animation.scm (swftools): Add variable. Co-authored-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30gnu: Add mmg.Paul A. Patience * gnu/packages/graphics.scm (mmg): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2022-08-30reconfigure: Use 'current-channels' to obtain provenance data.Ludovic Courtès Previously, build-time metadata from (guix config) would be ignored when available--e.g., when running /run/current-system/profile/bin/guix. This is a followup to 316fc2acbb112bfa572ae30f95a93bcd56621234. * guix/scripts/system/reconfigure.scm (check-forward-update): Use 'current-channels' rather than 'current-profile' + 'profile-channels'. 2022-08-30services: provenance: Use 'current-channels' to obtain provenance data.Ludovic Courtès Previously, build-time metadata from (guix config) would be ignored when available--e.g., when running /run/current-system/profile/bin/guix. This is a followup to 316fc2acbb112bfa572ae30f95a93bcd56621234. * gnu/services.scm (provenance-entry): Use 'current-channels' instead of 'current-profile' + 'profile-channels'. 2022-08-29gnu: Add missing copyright line.Marius Bakke This is a follow-up to commit 3e0abde17be944153be57ab5faeefc645266d39d. * gnu/tests/virtualization.scm: Add copyright header for myself. 2022-08-29tests: libvirt: Ensure the default network can be started.Marius Bakke * gnu/tests/virtualization.scm (run-libvirt-test): Run commands to create and start the default network. 2022-08-29gnu: libvirt: Use absolute dnsmasq.Lars-Dominik Braun Fixes <https://bugs.gnu.org/57272>. Reported by Lars-Dominik Braun <lars@6xq.net>. * gnu/packages/virtualization.scm (libvirt)[arguments]: Substitute the absolute dnsmasq file name. Disable one test. Co-authored-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: snakemake-7: Convert dependencies to propagated-inputsKonrad Hinsen * gnu/packages/python-xyz.scm (snakemake-7)[inputs]: Change to ... [propagated-inputs]: ... this, to ensure that "python -m snakemake" works (because snakemake uses it internally). Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: snakemake-6: Convert dependencies to propagated-inputsKonrad Hinsen * gnu/packages/python-xyz.scm (snakemake-6)[inputs]: Change to ... [propagated-inputs]: ... this, to ensure that "python -m snakemake" works (because snakemake uses it internally). Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: snakemake-7: Fix cluster execution bugKonrad Hinsen * gnu/packages/python-xyz.scm (snakemake-7)[arguments]: Revise the patch for the cluster execution script Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: gnupg: Use mirror URL.Maxime Devos In commit 38747a27f36dbaadadb1399ec085d88e48c97555, the package switched from a mirror:// URL to a ftp:// URL, but there doesn't appear to have been any particular reason for that. * gnu/packages/gnupg.scm (gnupg)[source]{uri}: Use a mirror:// again. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: uncrustify: Update to 0.75.1.Michael Rohleder * gnu/packages/code.scm (uncrustify): Update to 0.75.1. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: rr: Update to 5.6.0.Michael Rohleder * gnu/packages/debug.scm (rr): Update to 5.6.0. [arguments]<#:configure-flags>: Add -rpath to zlib to satisfy validate-runpath. [inputs]: Add zlib. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: Add python-django-cleanup.Luis Felipe * gnu/packages/django.scm (python-django-cleanup): New variable. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: emacs-clang-format: Remove inherited propagated inputs.Clément Lassieur * gnu/packages/llvm.scm (emacs-clang-format)[propagated-inputs]: Remove them. 2022-08-29gnu: zathura-pdf-mupdf: Remove input labels.Marius Bakke * gnu/packages/pdf.scm (zathura-pdf-mupdf)[inputs]: Remove labels. 2022-08-29gnu: zathura-pdf-mupdf: Update to 0.3.9.Marius Bakke * gnu/packages/pdf.scm (zathura-pdf-mupdf): Update to 0.3.9. [inputs]: Add GUMBO-PARSER and TESSERACT-OCR. [arguments]: Remove obsolete configure flag. Adjust mupdf substitutions. 2022-08-29gnu: mupdf: Update to 1.20.3.Pierre-Henry Fröhring * Copy/paste is fixed. The build now uses the patched version of freeglut that is included in the thirdparty directory so that copy/paste works. * gnu/packages/pdf.scm (mupdf)[source](snippet): Preserve freeglut. [inputs]: Add LIBXRANDR and LIBXI. [arguments]: Explicitly add configure flags for system libraries. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: tesseract-ocr: Propagate leptonica.Marius Bakke * gnu/packages/ocr.scm (tesseract-ocr)[inputs]: Move LEPTONICA ... [propagated-inputs]: ... here. 2022-08-29gnu: ruby: Replace with 2.7.6 [security fixes].Remco van 't Veer Includes fixes for: CVE-2022-28739, CVE-2021-41816, and CVE-2021-41817. * gnu/packages/ruby.scm (ruby-2.7-fixed): New variable. (ruby-2.7)[replacement]: Graft. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: ruby: Update to 3.1.2 [security fixes].Remco van 't Veer Includes fixes for: CVE-2022-28738, and CVE-2022-28739. * gnu/packages/ruby.scm (ruby-3.1): Update to 3.1.2. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: ruby: Update to 3.0.4 [security fixes].Remco van 't Veer Includes fixes for: CVE-2022-28738, CVE-2022-28739, CVE-2021-41819, CVE-2021-41816, and CVE-2021-41817. * gnu/packages/ruby.scm (ruby-3.0): Update to 3.0.4. Signed-off-by: Marius Bakke <marius@gnu.org> 2022-08-29gnu: ruby: Update to 2.6.10 [security fixes].Remco van 't Veer Includes fixes for: CVE-2022-28739, CVE-2021-41819, CVE-2021-41817, CVE-2021-31810, CVE-2021-32066, CVE-2021-28965, CVE-2020-25613, and CVE-2020-10933. * gnu/packages/ruby.scm (ruby-2.6): Update to 2.6.10. Signed-off-by: Marius Bakke <marius@gnu.org>