From 0c5d0c57d370b34f3ba677838deaa8baf7bca58a Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 6 Nov 2020 08:54:27 -0500 Subject: services: mpd: Do not eagerly look for a user. Running 'guix system search mpd' would throw a backtrace because the mpd-shepherd-service service start Gexp contained an unquoted call to 'getpwnam', which would look for a missing 'mpd' user and fail. * gnu/services/audio.scm (mpd-shepherd-service): gexp-unquote only the relevant variable rather than the whole expression. --- gnu/services/audio.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 37f2efa479..5d33032501 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -143,11 +143,11 @@ audio_output { #:pid-file #$(mpd-file-name config "pid") #:environment-variables ;; Required to detect PulseAudio when run under a user account. - '(#$(string-append - "XDG_RUNTIME_DIR=/run/user/" - (number->string + (list (string-append + "XDG_RUNTIME_DIR=/run/user/" + (number->string (passwd:uid - (getpwnam (mpd-configuration-user config)))))) + (getpwnam #$(mpd-configuration-user config)))))) #:log-file #$(mpd-file-name config "log"))) (stop #~(make-kill-destructor)))) -- cgit v1.2.3 From 3c69e81d85e337ccceb2248c497bd1732a63f7ec Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 6 Nov 2020 16:12:10 +0100 Subject: tests: docker-system: Increase VM memory. The test was failing with ENOSPC. * gnu/tests/docker.scm (run-docker-system-test)[vm]: Increase 'memory-size'. (%test-docker-system): Change 'locale-libcs' for the OS passed to 'system-docker-image'. --- gnu/tests/docker.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gnu') diff --git a/gnu/tests/docker.scm b/gnu/tests/docker.scm index ea6c9a33fe..c70c3ddb9e 100644 --- a/gnu/tests/docker.scm +++ b/gnu/tests/docker.scm @@ -27,8 +27,9 @@ #:use-module (gnu services networking) #:use-module (gnu services docker) #:use-module (gnu services desktop) - #:use-module (gnu packages docker) + #:use-module ((gnu packages base) #:select (glibc)) #:use-module (gnu packages guile) + #:use-module (gnu packages docker) #:use-module (guix gexp) #:use-module (guix grafts) #:use-module (guix monads) @@ -206,7 +207,7 @@ inside %DOCKER-OS." ;; load' must be able to store the whole image into memory, hence the ;; huge memory requirements. We should avoid the volatile-root setup ;; instead. - (memory-size 3500) + (memory-size 4000) (port-forwardings '()))) (define test @@ -298,5 +299,9 @@ inside %DOCKER-OS." (description "Run a system image as produced by @command{guix system docker-image} inside Docker.") (value (with-monad %store-monad - (>>= (system-docker-image (simple-operating-system)) + (>>= (system-docker-image (operating-system + (inherit (simple-operating-system)) + ;; Use locales for a single libc to + ;; reduce space requirements. + (locale-libcs (list glibc)))) run-docker-system-test))))) -- cgit v1.2.3 From 7209d7cbc37c108ca1148561a681258bb2222ab1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 6 Nov 2020 22:58:28 +0100 Subject: services: mpd: Always create the "mpd" user account. * gnu/services/audio.scm (%mpd-accounts): New variable. (mpd-service-type)[extensions]: Add ACCOUNT-SERVICE-TYPE extension. --- gnu/services/audio.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gnu') diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 5d33032501..5729b6bb0e 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Peter Mikkelsen ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,8 @@ #:use-module (guix gexp) #:use-module (gnu services) #:use-module (gnu services shepherd) + #:use-module (gnu system shadow) + #:use-module (gnu packages admin) #:use-module (gnu packages mpd) #:use-module (guix records) #:use-module (ice-9 match) @@ -162,6 +165,22 @@ audio_output { (mkdir-p directory) (chown directory (passwd:uid %user) (passwd:gid %user)))))) + +(define %mpd-accounts + ;; Default account and group for MPD. + (list (user-group (name "mpd") (system? #t)) + (user-account + (name "mpd") + (group "mpd") + (system? #t) + (comment "Music Player Daemon (MPD) user") + + ;; Note: /var/run/mpd hosts one sub-directory per user, of which + ;; /var/run/mpd/mpd corresponds to the "mpd" user. + (home-directory "/var/run/mpd/mpd") + + (shell (file-append shadow "/sbin/nologin"))))) + (define mpd-service-type (service-type (name 'mpd) @@ -169,6 +188,8 @@ audio_output { (extensions (list (service-extension shepherd-root-service-type (compose list mpd-shepherd-service)) + (service-extension account-service-type + (const %mpd-accounts)) (service-extension activation-service-type mpd-service-activation))) (default-value (mpd-configuration)))) -- cgit v1.2.3 From bb124f6e9c0af0a23736f233c2ea2c9c9b4a40a6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 6 Nov 2020 23:10:18 +0100 Subject: services: mpd: Fix daemon startup. Until now it would wait for a PID file that'd never come. * gnu/services/audio.scm (mpd-shepherd-service): Add 'requirement'. Remove #:pid-file from 'start'. (mpd-service-activation): Create the ".mpd" directory since that's what the daemon expects. --- gnu/services/audio.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm index 5729b6bb0e..627b941871 100644 --- a/gnu/services/audio.scm +++ b/gnu/services/audio.scm @@ -138,12 +138,12 @@ audio_output { (define (mpd-shepherd-service config) (shepherd-service (documentation "Run the MPD (Music Player Daemon)") + (requirement '(user-processes)) (provision '(mpd)) (start #~(make-forkexec-constructor (list #$(file-append mpd "/bin/mpd") "--no-daemon" #$(mpd-config->file config)) - #:pid-file #$(mpd-file-name config "pid") #:environment-variables ;; Required to detect PulseAudio when run under a user account. (list (string-append @@ -161,7 +161,7 @@ audio_output { (define %user (getpw #$(mpd-configuration-user config))) - (let ((directory #$(mpd-file-name config ""))) + (let ((directory #$(mpd-file-name config ".mpd"))) (mkdir-p directory) (chown directory (passwd:uid %user) (passwd:gid %user)))))) -- cgit v1.2.3 From 9909eddbc55c6cac5acccab453993cd113aa38a1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 6 Nov 2020 23:12:12 +0100 Subject: tests: mpd: Remove race condition; use default MPD configuration. * gnu/tests/audio.scm (%mpd-os): Use the default 'mpd-configuration'. (run-mpd-test)[test]("mpd listening"): New test. ("mpc connect"): Use 'system*' and 'test-equal'. --- gnu/tests/audio.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gnu') diff --git a/gnu/tests/audio.scm b/gnu/tests/audio.scm index 8eadaf02e1..7bf7d4ef14 100644 --- a/gnu/tests/audio.scm +++ b/gnu/tests/audio.scm @@ -28,9 +28,7 @@ (define %mpd-os (simple-operating-system - (service mpd-service-type - (mpd-configuration - (user "root"))))) + (service mpd-service-type))) (define (run-mpd-test) "Run tests in %mpd-os, which has mpd running." @@ -62,9 +60,14 @@ (start-service 'mpd)) marionette)) - (test-assert "mpc connect" + (test-assert "mpd listening" + ;; Wait until mpd is actually listening before spawning 'mpc'. + (wait-for-tcp-port 6600 marionette)) + + (test-equal "mpc connect" + 0 (marionette-eval - '(zero? (system #$(file-append mpd-mpc "/bin/mpc"))) + '(system* #$(file-append mpd-mpc "/bin/mpc")) marionette)) (test-end) -- cgit v1.2.3 From 02f5ee01c96589fc13f1e21b85b0b48100aec4e8 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 26 Mar 2020 15:06:23 +0100 Subject: gnu: libffi: Fix building on powerpc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/libffi.scm (libffi)[inputs]: New field. [arguments]: Add 'apply-patch' phase when targeting PowerPC. * gnu/packages/patches/libffi-3.3-powerpc-fixes.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Co-authored-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/libffi.scm | 24 +++- .../patches/libffi-3.3-powerpc-fixes.patch | 138 +++++++++++++++++++++ 3 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/libffi-3.3-powerpc-fixes.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index 72f81a9913..105e4dd28c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1194,6 +1194,7 @@ dist_patch_DATA = \ %D%/packages/patches/jsoncpp-fix-inverted-case.patch \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ + %D%/packages/patches/libffi-3.3-powerpc-fixes.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index ec8703ffdb..d324892330 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -1,8 +1,8 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2020 Ludovic Courtès ;;; Copyright © 2014 Federico Beffa ;;; Copyright © 2015, 2019 Ricardo Wurmus -;;; Copyright © 2016, 2017 Efraim Flashner +;;; Copyright © 2016, 2017, 2020 Efraim Flashner ;;; Copyright © 2016, 2017 Ben Woodcroft ;;; Copyright © 2017, 2019, 2020 Marius Bakke ;;; Copyright © 2018 Tobias Geerinckx-Rice @@ -55,7 +55,25 @@ (arguments `(;; Prevent the build system from passing -march and -mtune to the ;; compiler. See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4". - #:configure-flags '("--enable-portable-binary" "--without-gcc-arch"))) + #:configure-flags '("--enable-portable-binary" "--without-gcc-arch") + + ;; TODO: Inline patch on next rebuild cycle. + ,@(if (string-prefix? "powerpc-" (or (%current-target-system) + (%current-system))) + '(#:phases (modify-phases %standard-phases + (add-after 'unpack 'apply-patch + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch (assoc-ref inputs + "powerpc-patch"))) + (invoke "patch" "--batch" "-p1" + "-i" patch)))))) + '()))) + (inputs + (if (string-prefix? "powerpc-" (or (%current-target-system) + (%current-system))) + `(("powerpc-patch" ,@(search-patches + "libffi-3.3-powerpc-fixes.patch"))) + '())) (outputs '("out" "debug")) (synopsis "Foreign function call interface library") (description diff --git a/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch b/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch new file mode 100644 index 0000000000..971ed26180 --- /dev/null +++ b/gnu/packages/patches/libffi-3.3-powerpc-fixes.patch @@ -0,0 +1,138 @@ +This is a combination of the following 4 commits: +https://github.com/libffi/libffi/commit/01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.patch +https://github.com/libffi/libffi/commit/6663047f56c2932a6b10a790f4ac6666dd181326.patch +https://github.com/libffi/libffi/commit/e50b9ef8b910fa642ef158f6642e60d54d7ad740.patch +https://github.com/libffi/libffi/commit/4d6d2866ae43e55325e8ee96561221804602cd7a.patch + +From 2dbfa92a95e3bacabca431b89d2a5925e48a0e40 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Thu, 28 Nov 2019 12:42:41 +0000 + +powerpc: fix build failure on power7 and older (#532) + +Build failure looks as: +``` +libtool: compile: powerpc-unknown-linux-gnu-gcc \ + -O2 -mcpu=powerpc -mtune=powerpc -pipe ... -c src/powerpc/ffi.c ... +In file included from src/powerpc/ffi.c:33: +src/powerpc/ffi_powerpc.h:65:9: error: '__int128' is not supported on this target + 65 | typedef __int128 float128; + | ^~~~~~~~ +``` + +The fix avoids using __int128 in favour of aligned char[16]. + +Closes: https://github.com/libffi/libffi/issues/531 +Signed-off-by: Sergei Trofimovich + +Address platforms with no __int128. + +powerpc64: Use memcpy to help platforms with no __int128. (#534) + +Signed-off-by: Khem Raj + +Update powerpc sysv assembly for ffi_powerpc.h changes (#541) + +Some of the flag bits were moved when adding powerpc64 vector support. + +Fixes #536 +--- + src/powerpc/ffi_linux64.c | 12 ++++++------ + src/powerpc/ffi_powerpc.h | 2 +- + src/powerpc/sysv.S | 12 +++++------- + 3 files changed, 12 insertions(+), 14 deletions(-) + +diff --git a/src/powerpc/ffi_linux64.c b/src/powerpc/ffi_linux64.c +index de0d033..4d50878 100644 +--- a/src/powerpc/ffi_linux64.c ++++ b/src/powerpc/ffi_linux64.c +@@ -547,9 +547,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) + if (next_arg.ul == gpr_end.ul) + next_arg.ul = rest.ul; + if (vecarg_count < NUM_VEC_ARG_REGISTERS64 && i < nfixedargs) +- *vec_base.f128++ = **p_argv.f128; ++ memcpy (vec_base.f128++, *p_argv.f128, sizeof (float128)); + else +- *next_arg.f128 = **p_argv.f128; ++ memcpy (next_arg.f128, *p_argv.f128, sizeof (float128)); + if (++next_arg.f128 == gpr_end.f128) + next_arg.f128 = rest.f128; + vecarg_count++; +@@ -680,9 +680,9 @@ ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) + { + if (vecarg_count < NUM_VEC_ARG_REGISTERS64 + && i < nfixedargs) +- *vec_base.f128++ = *arg.f128++; ++ memcpy (vec_base.f128++, arg.f128, sizeof (float128)); + else +- *next_arg.f128 = *arg.f128++; ++ memcpy (next_arg.f128, arg.f128++, sizeof (float128)); + if (++next_arg.f128 == gpr_end.f128) + next_arg.f128 = rest.f128; + vecarg_count++; +@@ -986,9 +986,9 @@ ffi_closure_helper_LINUX64 (ffi_cif *cif, + do + { + if (pvec < end_pvec && i < nfixedargs) +- *to.f128 = *pvec++; ++ memcpy (to.f128, pvec++, sizeof (float128)); + else +- *to.f128 = *from.f128; ++ memcpy (to.f128, from.f128, sizeof (float128)); + to.f128++; + from.f128++; + } +diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h +index 5ee2a70..8e2f2f0 100644 +--- a/src/powerpc/ffi_powerpc.h ++++ b/src/powerpc/ffi_powerpc.h +@@ -62,7 +62,7 @@ typedef _Float128 float128; + #elif defined(__FLOAT128__) + typedef __float128 float128; + #else +-typedef __int128 float128; ++typedef char float128[16] __attribute__((aligned(16))); + #endif + + void FFI_HIDDEN ffi_closure_SYSV (void); +diff --git a/src/powerpc/sysv.S b/src/powerpc/sysv.S +index 1474ce7..df97734 100644 +--- a/src/powerpc/sysv.S ++++ b/src/powerpc/sysv.S +@@ -104,17 +104,16 @@ ENTRY(ffi_call_SYSV) + bctrl + + /* Now, deal with the return value. */ +- mtcrf 0x01,%r31 /* cr7 */ ++ mtcrf 0x03,%r31 /* cr6-cr7 */ + bt- 31,L(small_struct_return_value) + bt- 30,L(done_return_value) + #ifndef __NO_FPRS__ + bt- 29,L(fp_return_value) + #endif + stw %r3,0(%r30) +- bf+ 28,L(done_return_value) ++ bf+ 27,L(done_return_value) + stw %r4,4(%r30) +- mtcrf 0x02,%r31 /* cr6 */ +- bf 27,L(done_return_value) ++ bf 26,L(done_return_value) + stw %r5,8(%r30) + stw %r6,12(%r30) + /* Fall through... */ +@@ -145,10 +144,9 @@ L(done_return_value): + #ifndef __NO_FPRS__ + L(fp_return_value): + .cfi_restore_state +- bf 28,L(float_return_value) ++ bf 27,L(float_return_value) + stfd %f1,0(%r30) +- mtcrf 0x02,%r31 /* cr6 */ +- bf 27,L(done_return_value) ++ bf 26,L(done_return_value) + stfd %f2,8(%r30) + b L(done_return_value) + L(float_return_value): +-- +2.26.0 + -- cgit v1.2.3 From de6b649f8031cc2fa45099a3c41d78c2e302fdf2 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 7 Nov 2020 12:07:41 +0100 Subject: tests: git-http: Avoid race condition. * gnu/tests/version-control.scm (run-git-http-test)[test]("fcgiwrap listens"): New test. --- gnu/tests/version-control.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm index 230aa9edf9..d3cf19c913 100644 --- a/gnu/tests/version-control.scm +++ b/gnu/tests/version-control.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018 Oleg Pykhalov -;;; Copyright © 2017, 2018 Ludovic Courtès +;;; Copyright © 2017, 2018, 2020 Ludovic Courtès ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2018 Christopher Baines ;;; @@ -285,6 +285,10 @@ HTTP-PORT." '(file-exists? "/srv/git/test") marionette)) + (test-assert "fcgiwrap listens" + ;; Wait for fcgiwrap to be ready before cloning. + (wait-for-tcp-port 9000 marionette)) + ;; Make sure we can clone the repo from the host. (test-equal "clone" '#$README-contents -- cgit v1.2.3 From 7286c9b1879453ea4e0a08e91cc48706d8887f37 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 7 Nov 2020 12:48:24 +0100 Subject: tests: nfs-root-fs: Use the right store file name. * gnu/tests/nfs.scm (run-nfs-root-fs-test): Pass "nfs-root-fs-test" as the first argument to 'gexp->derivation'. --- gnu/tests/nfs.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm index da729ddcc9..5d04af38fb 100644 --- a/gnu/tests/nfs.scm +++ b/gnu/tests/nfs.scm @@ -404,7 +404,7 @@ directories can be mounted.") (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) - (gexp->derivation "nfs-server-test" test)) + (gexp->derivation "nfs-root-fs-test" test)) (define %test-nfs-root-fs (system-test -- cgit v1.2.3 From ae0fe289d3e5e0ae7d8c0764ddb4f58b275ee3b0 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Fri, 6 Nov 2020 10:59:54 +0100 Subject: installer: Limit listbox height. Fixes: . * gnu/installer/newt.scm (init): Print screen size. * gnu/installer/newt/page.scm (default-listbox-height): New variable. (run-listbox-selection-page): Use it. * gnu/installer/newt/wifi.scm (wifi-listbox-height): Ditto. * gnu/installer/newt/network.scm (run-technology-page): Set the maximum listbox height to 5. * gnu/installer/newt/ethernet.scm (run-ethernet-page): Ditto. * gnu/installer/newt/final.scm (run-config-display-page): Change listbox height. * gnu/installer/newt/partition.scm (run-disk-page): Ditto. * gnu/installer/newt/welcome.scm (display-logo?): New procedure. (run-menu-page): Use it. * gnu/installer/steps.scm (%configuration-file-width): Remove it. --- gnu/installer/newt.scm | 1 + gnu/installer/newt/ethernet.scm | 2 +- gnu/installer/newt/final.scm | 5 ++--- gnu/installer/newt/network.scm | 2 +- gnu/installer/newt/page.scm | 11 +++++++++-- gnu/installer/newt/partition.scm | 2 +- gnu/installer/newt/welcome.scm | 8 +++++++- gnu/installer/newt/wifi.scm | 3 ++- gnu/installer/steps.scm | 2 -- 9 files changed, 24 insertions(+), 12 deletions(-) (limited to 'gnu') diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm index fdab721b2f..a1cbeca49a 100644 --- a/gnu/installer/newt.scm +++ b/gnu/installer/newt.scm @@ -46,6 +46,7 @@ (newt-init) (clear-screen) (set-screen-size!) + (syslog "Display is ~ax~a.~%" (screen-columns) (screen-rows)) (push-help-line (format #f (G_ "Press for installation parameters.")))) diff --git a/gnu/installer/newt/ethernet.scm b/gnu/installer/newt/ethernet.scm index ba5e222a37..ecd22efbb2 100644 --- a/gnu/installer/newt/ethernet.scm +++ b/gnu/installer/newt/ethernet.scm @@ -77,7 +77,7 @@ connection is pending." #:title (G_ "Ethernet connection") #:listbox-items services #:listbox-item->text ethernet-service->text - #:listbox-height (min (+ (length services) 2) 10) + #:listbox-height (min (+ (length services) 2) 5) #:button-text (G_ "Exit") #:button-callback-procedure (lambda _ diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index 5019a67429..7f6dd9f075 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -40,9 +40,8 @@ file)) (define* (run-config-display-page #:key locale) - (let ((width (%configuration-file-width)) - (height (nearest-exact-integer - (/ (screen-rows) 2)))) + (let ((width (max 70 (- (screen-columns) 20))) + (height (default-listbox-height))) (run-file-textbox-page #:info-text (format #f (G_ "\ We're now ready to proceed with the installation! \ diff --git a/gnu/installer/newt/network.scm b/gnu/installer/newt/network.scm index 461d5d99c0..4af7143d63 100644 --- a/gnu/installer/newt/network.scm +++ b/gnu/installer/newt/network.scm @@ -80,7 +80,7 @@ network devices were found. Do you want to continue anyway?")) #:title (G_ "Internet access") #:listbox-items items #:listbox-item->text technology->text - #:listbox-height (min (+ (length items) 2) 10) + #:listbox-height (min (+ (length items) 2) 5) #:button-text (G_ "Exit") #:button-callback-procedure (lambda _ diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm index 1d6b9979b4..4209674c28 100644 --- a/gnu/installer/newt/page.scm +++ b/gnu/installer/newt/page.scm @@ -32,7 +32,9 @@ #:use-module (srfi srfi-34) #:use-module (srfi srfi-35) #:use-module (newt) - #:export (draw-info-page + #:export (default-listbox-height + + draw-info-page draw-connecting-page run-input-page run-error-page @@ -168,6 +170,10 @@ Like 'run-form', return two values: the exit reason, and an \"argument\"." (_ (values reason argument)))))) +(define (default-listbox-height) + "Return the default listbox height." + (max 5 (- (screen-rows) 20))) + (define (draw-info-page text title) "Draw an informative page with the given TEXT as content. Set the title of this page to TITLE." @@ -339,7 +345,8 @@ of the page is set to TITLE." (info-textbox-width 50) listbox-items listbox-item->text - (listbox-height 20) + (listbox-height + (default-listbox-height)) (listbox-default-item #f) (listbox-allow-multiple? #f) (sort-listbox-items? #t) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 35f76db3ed..8561eb1ecf 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -681,7 +681,7 @@ by pressing the Exit button.~%~%"))) (G_ "Guided partitioning") (G_ "Manual partitioning")) #:info-textbox-width 76 ;we need a lot of room for INFO-TEXT - #:listbox-height 12 + #:listbox-height (max 5 (- (screen-rows) 30)) #:listbox-items (disk-items) #:listbox-item->text cdr #:sort-listbox-items? #f diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm index 1b4b2df816..5f461279e2 100644 --- a/gnu/installer/newt/welcome.scm +++ b/gnu/installer/newt/welcome.scm @@ -38,6 +38,9 @@ (define info-textbox-width (make-parameter 70)) (define options-listbox-height (make-parameter 5)) +(define (display-logo?) + (> (screen-rows) 35)) + (define* (run-menu-page title info-text logo #:key listbox-items @@ -55,7 +58,10 @@ we want this page to occupy all the screen space available." items)) (let* ((logo-textbox - (make-textbox -1 -1 (logo-width) (logo-height) 0)) + (make-textbox -1 -1 + (if (display-logo?) (logo-width) 0) + (if (display-logo?) (logo-height) 0) + 0)) (info-textbox (make-reflowed-textbox -1 -1 info-text diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm index 3fd5756b99..f5d8f1fdbf 100644 --- a/gnu/installer/newt/wifi.scm +++ b/gnu/installer/newt/wifi.scm @@ -165,7 +165,8 @@ of records present in LISTBOX." (define service-name-max-length (make-parameter 20)) ;; Height of the listbox displaying wifi services. -(define wifi-listbox-height (make-parameter 20)) +(define wifi-listbox-height (make-parameter + (default-listbox-height))) ;; Information textbox width. (define info-textbox-width (make-parameter 40)) diff --git a/gnu/installer/steps.scm b/gnu/installer/steps.scm index 16d74c207f..fdcfb0cb4d 100644 --- a/gnu/installer/steps.scm +++ b/gnu/installer/steps.scm @@ -50,7 +50,6 @@ %installer-configuration-file %installer-target-dir - %configuration-file-width format-configuration configuration->file)) @@ -218,7 +217,6 @@ stored in RESULTS. Return #f otherwise." (define %installer-configuration-file (make-parameter "/mnt/etc/config.scm")) (define %installer-target-dir (make-parameter "/mnt")) -(define %configuration-file-width (make-parameter 79)) (define (format-configuration steps results) "Return the list resulting from the application of the procedure defined in -- cgit v1.2.3 From 4e9ded6d276bf488593f53a84b6e50771abac13f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 8 Nov 2020 14:27:35 +0100 Subject: image: Offload "disk-image" derivations. This is a followup to 99efa804bd6df5de4760ec5974ed2297f1746366. * gnu/system/image.scm (system-disk-image): Pass #:local-build? #f to 'computed-file'. --- gnu/system/image.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gnu') diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 4075a26552..81152f0fc4 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -414,6 +414,7 @@ image ~a { out-image)) (convert-disk-image out-image '#$format #$output))))) (computed-file name builder + #:local-build? #f ;too I/O-intensive #:options `(#:substitutable? ,substitutable?)))) -- cgit v1.2.3 From bc47583412745e38d994a4ba71cda6564aed3a35 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 8 Nov 2020 16:55:07 +0100 Subject: gnu: cross-base: Move glibc Hurd patches to 'inputs'. Fixes "guix build --target=i586-pc-gnu bootstrap-tarballs". * gnu/packages/cross-base.scm (cross-libc): Move Hurd patches from 'native-inputs' to 'inputs'. --- gnu/packages/cross-base.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gnu') diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index b35a3cb40b..c1e5f2eb79 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -539,19 +539,20 @@ and the cross tool chain." ;; FIXME: 'static-bash' should really be an input, not a native input, but ;; to do that will require building an intermediate cross libc. - (inputs '()) + (inputs (if (hurd-triplet? target) + `(;; TODO: move to glibc in the next rebuild cycle + ("hurd-mach-print.patch" + ,(search-patch "glibc-hurd-mach-print.patch")) + ("hurd-gettyent.patch" + ,(search-patch "glibc-hurd-gettyent.patch"))) + '())) (native-inputs `(("cross-gcc" ,xgcc) ("cross-binutils" ,xbinutils) ,@(if (hurd-triplet? target) `(("cross-mig" ,@(assoc-ref (package-native-inputs xheaders) - "cross-mig")) - ;; TODO: move to glibc in the next rebuild cycle - ("hurd-mach-print.patch" - ,@(search-patches "glibc-hurd-mach-print.patch")) - ("hurd-gettyent.patch" - ,@(search-patches "glibc-hurd-gettyent.patch"))) + "cross-mig"))) '()) ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc)))))) -- cgit v1.2.3 From ad2c3ba7504e34bc00808b2dc7d4df5e773f4ffd Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 8 Nov 2020 19:38:31 +0100 Subject: installer: parted: Add debug output. * gnu/installer/parted.scm (mkpart): Log partition creation. --- gnu/installer/parted.scm | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index f2352c5779..f592d315f5 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -758,11 +758,33 @@ cause them to cross." dev-constraint)) (no-constraint (constraint-any device)) ;; Try to create a partition with an optimal alignment - ;; constraint. If it fails, fallback to creating a partition with - ;; no specific constraint. + ;; constraint. If it fails, fallback to creating a partition + ;; with no specific constraint. + (partition-constraint-ok? + (disk-add-partition disk partition final-constraint)) + (partition-no-contraint-ok? + (or partition-constraint-ok? + (disk-add-partition disk partition no-constraint))) (partition-ok? - (or (disk-add-partition disk partition final-constraint) - (disk-add-partition disk partition no-constraint)))) + (or partition-constraint-ok? partition-no-contraint-ok?))) + (syslog "Creating partition: +~/type: ~a +~/filesystem-type: ~a +~/start: ~a +~/end: ~a +~/start-range: [~a, ~a] +~/end-range: [~a, ~a] +~/constraint: ~a +~/no-constraint: ~a +" + partition-type + (filesystem-type-name filesystem-type) + start-sector* + end-sector + (geometry-start start-range) (geometry-end start-range) + (geometry-start end-range) (geometry-end end-range) + partition-constraint-ok? + partition-no-contraint-ok?) ;; Set the partition name if supported. (when (and partition-ok? has-name? name) (partition-set-name partition name)) -- cgit v1.2.3 From 86e9e5cb230c3c10272a223ea04e7564f3c1463b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Mon, 9 Nov 2020 22:44:18 +0100 Subject: services: nginx: Re-introduce server-names-hash-bucket-size. This was unintentionally removed in 00014f769233facebd84f13a00b10032a22cb440. * gnu/services/web.scm (default-nginx-config): Re-introduce processing of server-names-hash-bucket-size option. --- gnu/services/web.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnu') diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 7e17dac6e2..53858436fa 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -668,6 +668,12 @@ of index files." '#$lua-package-cpath) ";")) "") + (if server-names-hash-bucket-size + (string-append + " server_names_hash_bucket_size " + (number->string server-names-hash-bucket-size) + ";\n") + "") (if server-names-hash-bucket-max-size (string-append " server_names_hash_bucket_max_size " -- cgit v1.2.3 From 70ffa8af1e93ab8a92c4622745e9cb4a2782f3c8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 9 Nov 2020 23:24:33 +0100 Subject: machine: ssh: Do not import the host (guix config). * gnu/machine/ssh.scm (machine-boot-parameters): Use 'make-config.scm' for (guix config). --- gnu/machine/ssh.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gnu') diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index a3a12fb54b..1b748c8da7 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -37,6 +37,7 @@ #:use-module (guix ssh) #:use-module (guix store) #:use-module (guix utils) + #:use-module ((guix self) #:select (make-config.scm)) #:use-module (gcrypt pk-crypto) #:use-module (ice-9 format) #:use-module (ice-9 match) @@ -353,8 +354,9 @@ of MACHINE's system profile, ordered from most recent to oldest." (define remote-exp (with-extensions (list guile-gcrypt) - (with-imported-modules (source-module-closure '((guix config) - (guix profiles))) + (with-imported-modules (source-module-closure + `(((guix config) => ,(make-config.scm)) + (guix profiles))) #~(begin (use-modules (guix config) (guix profiles) -- cgit v1.2.3 From 7a20c1676a8421f3ac06a2634a27c2837293df0b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Nov 2020 12:20:09 +0100 Subject: vm: 'system-qemu-image' forces the use of i386/BIOS GRUB. Fixes . Reported by Maxim Cournoyer . * gnu/system/vm.scm (system-qemu-image): Add 'bootloader' field to OS. --- gnu/system/vm.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gnu') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 21d777a3fe..c9580f6e7f 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -655,7 +655,14 @@ of the GNU system as described by OS." 'dce))) - (let* ((os (operating-system (inherit os) + (let* ((os (operating-system + (inherit os) + + ;; As in 'virtualized-operating-system', use BIOS-style GRUB. + (bootloader (bootloader-configuration + (bootloader grub-bootloader) + (target "/dev/vda"))) + ;; Assume we have an initrd with the whole QEMU shebang. ;; Force our own root file system. Refer to it by UUID so that -- cgit v1.2.3 From 74361d3ee8c1524ee3f3496f113b9a8bf644e023 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Nov 2020 16:43:59 +0100 Subject: gnu: python2-pygobject@2: Shorten patch file name. The file would not be included in the tarball produced by "make dist" because its name was too long. * gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch: Rename to... * gnu/packages/patches/python2-pygobject-2-deprecation.patch: ... this. * gnu/packages/glib.scm (python2-pygobject-2)[source]: Adjust accordingly. * gnu/local.mk (dist_patch_DATA): Likewise. --- gnu/local.mk | 2 +- gnu/packages/glib.scm | 3 +- .../patches/python2-pygobject-2-deprecation.patch | 39 ++++++++++++++++++++++ ...on2-pygobject-2-gi-info-type-error-domain.patch | 39 ---------------------- 4 files changed, 41 insertions(+), 42 deletions(-) create mode 100644 gnu/packages/patches/python2-pygobject-2-deprecation.patch delete mode 100644 gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index 105e4dd28c..9a8d6dd4d9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1524,7 +1524,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-paste-remove-timing-test.patch \ %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch \ %D%/packages/patches/python-pycrypto-time-clock.patch \ - %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ + %D%/packages/patches/python2-pygobject-2-deprecation.patch \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ %D%/packages/patches/python-robotframework-source-date-epoch.patch \ %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch \ diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index bba9461d44..901222476a 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -698,8 +698,7 @@ useful for C++.") (sha256 (base32 "0nkam61rsn7y3wik3vw46wk5q2cjfh2iph57hl9m39rc8jijb7dv")) - (patches (search-patches - "python2-pygobject-2-gi-info-type-error-domain.patch")))) + (patches (search-patches "python2-pygobject-2-deprecation.patch")))) (build-system gnu-build-system) (native-inputs `(("which" ,which) diff --git a/gnu/packages/patches/python2-pygobject-2-deprecation.patch b/gnu/packages/patches/python2-pygobject-2-deprecation.patch new file mode 100644 index 0000000000..6a08e56351 --- /dev/null +++ b/gnu/packages/patches/python2-pygobject-2-deprecation.patch @@ -0,0 +1,39 @@ +From e5df32ffbf37481dbb6a70c4d4e7b7b9778c5549 Mon Sep 17 00:00:00 2001 +From: "John (J5) Palmieri" +Date: Sat, 13 Aug 2011 04:13:28 -0400 +Subject: remove references to deprecated GI_INFO_TYPE_ERROR_DOMAIN + + +diff --git a/gi/pygi-info.c b/gi/pygi-info.c +index 8729e25..007b609 100644 +--- a/gi/pygi-info.c ++++ b/gi/pygi-info.c +@@ -165,9 +165,6 @@ _pygi_info_new (GIBaseInfo *info) + case GI_INFO_TYPE_CONSTANT: + type = &PyGIConstantInfo_Type; + break; +- case GI_INFO_TYPE_ERROR_DOMAIN: +- type = &PyGIErrorDomainInfo_Type; +- break; + case GI_INFO_TYPE_UNION: + type = &PyGIUnionInfo_Type; + break; +@@ -484,7 +481,6 @@ _pygi_g_type_info_size (GITypeInfo *type_info) + case GI_INFO_TYPE_INVALID: + case GI_INFO_TYPE_FUNCTION: + case GI_INFO_TYPE_CONSTANT: +- case GI_INFO_TYPE_ERROR_DOMAIN: + case GI_INFO_TYPE_VALUE: + case GI_INFO_TYPE_SIGNAL: + case GI_INFO_TYPE_PROPERTY: +@@ -863,7 +859,6 @@ pygi_g_struct_info_is_simple (GIStructInfo *struct_info) + case GI_INFO_TYPE_INVALID: + case GI_INFO_TYPE_FUNCTION: + case GI_INFO_TYPE_CONSTANT: +- case GI_INFO_TYPE_ERROR_DOMAIN: + case GI_INFO_TYPE_VALUE: + case GI_INFO_TYPE_SIGNAL: + case GI_INFO_TYPE_PROPERTY: +-- +cgit v0.10.1 + diff --git a/gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch b/gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch deleted file mode 100644 index 6a08e56351..0000000000 --- a/gnu/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch +++ /dev/null @@ -1,39 +0,0 @@ -From e5df32ffbf37481dbb6a70c4d4e7b7b9778c5549 Mon Sep 17 00:00:00 2001 -From: "John (J5) Palmieri" -Date: Sat, 13 Aug 2011 04:13:28 -0400 -Subject: remove references to deprecated GI_INFO_TYPE_ERROR_DOMAIN - - -diff --git a/gi/pygi-info.c b/gi/pygi-info.c -index 8729e25..007b609 100644 ---- a/gi/pygi-info.c -+++ b/gi/pygi-info.c -@@ -165,9 +165,6 @@ _pygi_info_new (GIBaseInfo *info) - case GI_INFO_TYPE_CONSTANT: - type = &PyGIConstantInfo_Type; - break; -- case GI_INFO_TYPE_ERROR_DOMAIN: -- type = &PyGIErrorDomainInfo_Type; -- break; - case GI_INFO_TYPE_UNION: - type = &PyGIUnionInfo_Type; - break; -@@ -484,7 +481,6 @@ _pygi_g_type_info_size (GITypeInfo *type_info) - case GI_INFO_TYPE_INVALID: - case GI_INFO_TYPE_FUNCTION: - case GI_INFO_TYPE_CONSTANT: -- case GI_INFO_TYPE_ERROR_DOMAIN: - case GI_INFO_TYPE_VALUE: - case GI_INFO_TYPE_SIGNAL: - case GI_INFO_TYPE_PROPERTY: -@@ -863,7 +859,6 @@ pygi_g_struct_info_is_simple (GIStructInfo *struct_info) - case GI_INFO_TYPE_INVALID: - case GI_INFO_TYPE_FUNCTION: - case GI_INFO_TYPE_CONSTANT: -- case GI_INFO_TYPE_ERROR_DOMAIN: - case GI_INFO_TYPE_VALUE: - case GI_INFO_TYPE_SIGNAL: - case GI_INFO_TYPE_PROPERTY: --- -cgit v0.10.1 - -- cgit v1.2.3 From 8515ea12d283632e7d0103286e679542d896058b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Nov 2020 17:49:14 +0100 Subject: gnu: audiofile: Shorten patch file names. At least 'audiofile-division-by-zero-BlockCodec-runPull.patch' could end up not being included in a tarball. * gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch: Rename to... * gnu/packages/patches/audiofile-check-number-of-coefficients.patch: ... this. * gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch: Rename to... * gnu/packages/patches/audiofile-division-by-zero.patch: ....this. * gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch: Rename to... * gnu/packages/patches/audiofile-function-signature.patch: ... this. * gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch: Rename to.... * gnu/packages/patches/audiofile-multiply-overflow.patch: ... this. * gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch: Rename to... * gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch: ... this. * gnu/packages/audio.scm (audiofile)[source]: Adjust accordingly. * gnu/local.mk (dist_patch_DATA): Likewise. --- gnu/local.mk | 12 +-- gnu/packages/audio.scm | 10 +- ...udiofile-Check-the-number-of-coefficients.patch | 30 ------ ...audiofile-Fix-multiply-overflow-sfconvert.patch | 66 ------------ ...diofile-Fix-overflow-in-MSADPCM-decodeSam.patch | 116 --------------------- .../audiofile-check-number-of-coefficients.patch | 30 ++++++ ...ofile-division-by-zero-BlockCodec-runPull.patch | 21 ---- .../patches/audiofile-division-by-zero.patch | 21 ++++ .../patches/audiofile-function-signature.patch | 35 +++++++ .../patches/audiofile-multiply-overflow.patch | 66 ++++++++++++ .../patches/audiofile-overflow-in-MSADPCM.patch | 116 +++++++++++++++++++++ ...iofile-signature-of-multiplyCheckOverflow.patch | 35 ------- 12 files changed, 279 insertions(+), 279 deletions(-) delete mode 100644 gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch delete mode 100644 gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch delete mode 100644 gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch create mode 100644 gnu/packages/patches/audiofile-check-number-of-coefficients.patch delete mode 100644 gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch create mode 100644 gnu/packages/patches/audiofile-division-by-zero.patch create mode 100644 gnu/packages/patches/audiofile-function-signature.patch create mode 100644 gnu/packages/patches/audiofile-multiply-overflow.patch create mode 100644 gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch delete mode 100644 gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index 9a8d6dd4d9..d5a13cbdbd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -800,14 +800,14 @@ dist_patch_DATA = \ %D%/packages/patches/audiofile-CVE-2015-7747.patch \ %D%/packages/patches/audiofile-CVE-2018-13440.patch \ %D%/packages/patches/audiofile-CVE-2018-17095.patch \ - %D%/packages/patches/audiofile-Check-the-number-of-coefficients.patch \ + %D%/packages/patches/audiofile-check-number-of-coefficients.patch \ %D%/packages/patches/audiofile-Fail-on-error-in-parseFormat.patch \ %D%/packages/patches/audiofile-Fix-index-overflow-in-IMA.cpp.patch \ - %D%/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch \ - %D%/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch \ - %D%/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch \ - %D%/packages/patches/audiofile-hurd.patch \ - %D%/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch \ + %D%/packages/patches/audiofile-multiply-overflow.patch \ + %D%/packages/patches/audiofile-overflow-in-MSADPCM.patch \ + %D%/packages/patches/audiofile-division-by-zero.patch \ + %D%/packages/patches/audiofile-hurd.patch \ + %D%/packages/patches/audiofile-function-signature.patch \ %D%/packages/patches/automake-skip-amhello-tests.patch \ %D%/packages/patches/avahi-localstatedir.patch \ %D%/packages/patches/avogadro-boost148.patch \ diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 6479398cb5..6733c8d212 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -862,16 +862,16 @@ tools.") "audiofile-Fix-index-overflow-in-IMA.cpp.patch" ;; CVE-2017-6827, CVE-2017-6828, CVE-2017-6832, CVE-2017-6835, ;; CVE-2017-6837: - "audiofile-Check-the-number-of-coefficients.patch" + "audiofile-check-number-of-coefficients.patch" ;; CVE-2017-6839: - "audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch" + "audiofile-overflow-in-MSADPCM.patch" ;; CVE-2017-6830, CVE-2017-6834, CVE-2017-6836, CVE-2017-6838: - "audiofile-Fix-multiply-overflow-sfconvert.patch" - "audiofile-signature-of-multiplyCheckOverflow.patch" + "audiofile-multiply-overflow.patch" + "audiofile-function-signature.patch" ;; CVE-2017-6831: "audiofile-Fail-on-error-in-parseFormat.patch" ;; CVE-2017-6833: - "audiofile-division-by-zero-BlockCodec-runPull.patch" + "audiofile-division-by-zero.patch" "audiofile-CVE-2018-13440.patch" "audiofile-CVE-2018-17095.patch")))) (properties `((lint-hidden-cve . ("CVE-2017-6829" diff --git a/gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch b/gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch deleted file mode 100644 index f9427cbe61..0000000000 --- a/gnu/packages/patches/audiofile-Check-the-number-of-coefficients.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Antonio Larrosa -Date: Mon, 6 Mar 2017 12:51:22 +0100 -Subject: Always check the number of coefficients - -When building the library with NDEBUG, asserts are eliminated -so it's better to always check that the number of coefficients -is inside the array range. - -This fixes the 00191-audiofile-indexoob issue in #41 ---- - libaudiofile/WAVE.cpp | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp -index 9dd8511..0fc48e8 100644 ---- a/libaudiofile/WAVE.cpp -+++ b/libaudiofile/WAVE.cpp -@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size) - - /* numCoefficients should be at least 7. */ - assert(numCoefficients >= 7 && numCoefficients <= 255); -+ if (numCoefficients < 7 || numCoefficients > 255) -+ { -+ _af_error(AF_BAD_HEADER, -+ "Bad number of coefficients"); -+ return AF_FAIL; -+ } - - m_msadpcmNumCoefficients = numCoefficients; - diff --git a/gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch b/gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch deleted file mode 100644 index 0f17140d6b..0000000000 --- a/gnu/packages/patches/audiofile-Fix-multiply-overflow-sfconvert.patch +++ /dev/null @@ -1,66 +0,0 @@ -From: Antonio Larrosa -Date: Mon, 6 Mar 2017 13:54:52 +0100 -Subject: Check for multiplication overflow in sfconvert - -Checks that a multiplication doesn't overflow when -calculating the buffer size, and if it overflows, -reduce the buffer size instead of failing. - -This fixes the 00192-audiofile-signintoverflow-sfconvert case -in #41 ---- - sfcommands/sfconvert.c | 34 ++++++++++++++++++++++++++++++++-- - 1 file changed, 32 insertions(+), 2 deletions(-) - -diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c -index 80a1bc4..970a3e4 100644 ---- a/sfcommands/sfconvert.c -+++ b/sfcommands/sfconvert.c -@@ -45,6 +45,33 @@ void printusage (void); - void usageerror (void); - bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid); - -+int firstBitSet(int x) -+{ -+ int position=0; -+ while (x!=0) -+ { -+ x>>=1; -+ ++position; -+ } -+ return position; -+} -+ -+#ifndef __has_builtin -+#define __has_builtin(x) 0 -+#endif -+ -+int multiplyCheckOverflow(int a, int b, int *result) -+{ -+#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) -+ return __builtin_mul_overflow(a, b, result); -+#else -+ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits -+ return true; -+ *result = a * b; -+ return false; -+#endif -+} -+ - int main (int argc, char **argv) - { - if (argc == 2) -@@ -323,8 +350,11 @@ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid) - { - int frameSize = afGetVirtualFrameSize(infile, trackid, 1); - -- const int kBufferFrameCount = 65536; -- void *buffer = malloc(kBufferFrameCount * frameSize); -+ int kBufferFrameCount = 65536; -+ int bufferSize; -+ while (multiplyCheckOverflow(kBufferFrameCount, frameSize, &bufferSize)) -+ kBufferFrameCount /= 2; -+ void *buffer = malloc(bufferSize); - - AFframecount totalFrames = afGetFrameCount(infile, AF_DEFAULT_TRACK); - AFframecount totalFramesWritten = 0; diff --git a/gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch b/gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch deleted file mode 100644 index 2be930b924..0000000000 --- a/gnu/packages/patches/audiofile-Fix-overflow-in-MSADPCM-decodeSam.patch +++ /dev/null @@ -1,116 +0,0 @@ -From: Antonio Larrosa -Date: Mon, 6 Mar 2017 13:43:53 +0100 -Subject: Check for multiplication overflow in MSADPCM decodeSample - -Check for multiplication overflow (using __builtin_mul_overflow -if available) in MSADPCM.cpp decodeSample and return an empty -decoded block if an error occurs. - -This fixes the 00193-audiofile-signintoverflow-MSADPCM case of #41 ---- - libaudiofile/modules/BlockCodec.cpp | 5 ++-- - libaudiofile/modules/MSADPCM.cpp | 47 +++++++++++++++++++++++++++++++++---- - 2 files changed, 46 insertions(+), 6 deletions(-) - -diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp -index 45925e8..4731be1 100644 ---- a/libaudiofile/modules/BlockCodec.cpp -+++ b/libaudiofile/modules/BlockCodec.cpp -@@ -52,8 +52,9 @@ void BlockCodec::runPull() - // Decompress into m_outChunk. - for (int i=0; i(m_inChunk->buffer) + i * m_bytesPerPacket, -- static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount); -+ if (decodeBlock(static_cast(m_inChunk->buffer) + i * m_bytesPerPacket, -+ static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0) -+ break; - - framesRead += m_framesPerPacket; - } -diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp -index 8ea3c85..ef9c38c 100644 ---- a/libaudiofile/modules/MSADPCM.cpp -+++ b/libaudiofile/modules/MSADPCM.cpp -@@ -101,24 +101,60 @@ static const int16_t adaptationTable[] = - 768, 614, 512, 409, 307, 230, 230, 230 - }; - -+int firstBitSet(int x) -+{ -+ int position=0; -+ while (x!=0) -+ { -+ x>>=1; -+ ++position; -+ } -+ return position; -+} -+ -+#ifndef __has_builtin -+#define __has_builtin(x) 0 -+#endif -+ -+int multiplyCheckOverflow(int a, int b, int *result) -+{ -+#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) -+ return __builtin_mul_overflow(a, b, result); -+#else -+ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits -+ return true; -+ *result = a * b; -+ return false; -+#endif -+} -+ -+ - // Compute a linear PCM value from the given differential coded value. - static int16_t decodeSample(ms_adpcm_state &state, -- uint8_t code, const int16_t *coefficient) -+ uint8_t code, const int16_t *coefficient, bool *ok=NULL) - { - int linearSample = (state.sample1 * coefficient[0] + - state.sample2 * coefficient[1]) >> 8; -+ int delta; - - linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta; - - linearSample = clamp(linearSample, MIN_INT16, MAX_INT16); - -- int delta = (state.delta * adaptationTable[code]) >> 8; -+ if (multiplyCheckOverflow(state.delta, adaptationTable[code], &delta)) -+ { -+ if (ok) *ok=false; -+ _af_error(AF_BAD_COMPRESSION, "Error decoding sample"); -+ return 0; -+ } -+ delta >>= 8; - if (delta < 16) - delta = 16; - - state.delta = delta; - state.sample2 = state.sample1; - state.sample1 = linearSample; -+ if (ok) *ok=true; - - return static_cast(linearSample); - } -@@ -212,13 +248,16 @@ int MSADPCM::decodeBlock(const uint8_t *encoded, int16_t *decoded) - { - uint8_t code; - int16_t newSample; -+ bool ok; - - code = *encoded >> 4; -- newSample = decodeSample(*state[0], code, coefficient[0]); -+ newSample = decodeSample(*state[0], code, coefficient[0], &ok); -+ if (!ok) return 0; - *decoded++ = newSample; - - code = *encoded & 0x0f; -- newSample = decodeSample(*state[1], code, coefficient[1]); -+ newSample = decodeSample(*state[1], code, coefficient[1], &ok); -+ if (!ok) return 0; - *decoded++ = newSample; - - encoded++; diff --git a/gnu/packages/patches/audiofile-check-number-of-coefficients.patch b/gnu/packages/patches/audiofile-check-number-of-coefficients.patch new file mode 100644 index 0000000000..f9427cbe61 --- /dev/null +++ b/gnu/packages/patches/audiofile-check-number-of-coefficients.patch @@ -0,0 +1,30 @@ +From: Antonio Larrosa +Date: Mon, 6 Mar 2017 12:51:22 +0100 +Subject: Always check the number of coefficients + +When building the library with NDEBUG, asserts are eliminated +so it's better to always check that the number of coefficients +is inside the array range. + +This fixes the 00191-audiofile-indexoob issue in #41 +--- + libaudiofile/WAVE.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libaudiofile/WAVE.cpp b/libaudiofile/WAVE.cpp +index 9dd8511..0fc48e8 100644 +--- a/libaudiofile/WAVE.cpp ++++ b/libaudiofile/WAVE.cpp +@@ -281,6 +281,12 @@ status WAVEFile::parseFormat(const Tag &id, uint32_t size) + + /* numCoefficients should be at least 7. */ + assert(numCoefficients >= 7 && numCoefficients <= 255); ++ if (numCoefficients < 7 || numCoefficients > 255) ++ { ++ _af_error(AF_BAD_HEADER, ++ "Bad number of coefficients"); ++ return AF_FAIL; ++ } + + m_msadpcmNumCoefficients = numCoefficients; + diff --git a/gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch b/gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch deleted file mode 100644 index e001133916..0000000000 --- a/gnu/packages/patches/audiofile-division-by-zero-BlockCodec-runPull.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Antonio Larrosa -Date: Thu, 9 Mar 2017 10:21:18 +0100 -Subject: Check for division by zero in BlockCodec::runPull - ---- - libaudiofile/modules/BlockCodec.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp -index 4731be1..eb2fb4d 100644 ---- a/libaudiofile/modules/BlockCodec.cpp -+++ b/libaudiofile/modules/BlockCodec.cpp -@@ -47,7 +47,7 @@ void BlockCodec::runPull() - - // Read the compressed data. - ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount); -- int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0; -+ int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0; - - // Decompress into m_outChunk. - for (int i=0; i +Date: Thu, 9 Mar 2017 10:21:18 +0100 +Subject: Check for division by zero in BlockCodec::runPull + +--- + libaudiofile/modules/BlockCodec.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp +index 4731be1..eb2fb4d 100644 +--- a/libaudiofile/modules/BlockCodec.cpp ++++ b/libaudiofile/modules/BlockCodec.cpp +@@ -47,7 +47,7 @@ void BlockCodec::runPull() + + // Read the compressed data. + ssize_t bytesRead = read(m_inChunk->buffer, m_bytesPerPacket * blockCount); +- int blocksRead = bytesRead >= 0 ? bytesRead / m_bytesPerPacket : 0; ++ int blocksRead = (bytesRead >= 0 && m_bytesPerPacket > 0) ? bytesRead / m_bytesPerPacket : 0; + + // Decompress into m_outChunk. + for (int i=0; i +Date: Fri, 10 Mar 2017 15:40:02 +0100 +Subject: Fix signature of multiplyCheckOverflow. It returns a bool, not an int + +--- + libaudiofile/modules/MSADPCM.cpp | 2 +- + sfcommands/sfconvert.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp +index ef9c38c..d8c9553 100644 +--- a/libaudiofile/modules/MSADPCM.cpp ++++ b/libaudiofile/modules/MSADPCM.cpp +@@ -116,7 +116,7 @@ int firstBitSet(int x) + #define __has_builtin(x) 0 + #endif + +-int multiplyCheckOverflow(int a, int b, int *result) ++bool multiplyCheckOverflow(int a, int b, int *result) + { + #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) + return __builtin_mul_overflow(a, b, result); +diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c +index 970a3e4..367f7a5 100644 +--- a/sfcommands/sfconvert.c ++++ b/sfcommands/sfconvert.c +@@ -60,7 +60,7 @@ int firstBitSet(int x) + #define __has_builtin(x) 0 + #endif + +-int multiplyCheckOverflow(int a, int b, int *result) ++bool multiplyCheckOverflow(int a, int b, int *result) + { + #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) + return __builtin_mul_overflow(a, b, result); diff --git a/gnu/packages/patches/audiofile-multiply-overflow.patch b/gnu/packages/patches/audiofile-multiply-overflow.patch new file mode 100644 index 0000000000..0f17140d6b --- /dev/null +++ b/gnu/packages/patches/audiofile-multiply-overflow.patch @@ -0,0 +1,66 @@ +From: Antonio Larrosa +Date: Mon, 6 Mar 2017 13:54:52 +0100 +Subject: Check for multiplication overflow in sfconvert + +Checks that a multiplication doesn't overflow when +calculating the buffer size, and if it overflows, +reduce the buffer size instead of failing. + +This fixes the 00192-audiofile-signintoverflow-sfconvert case +in #41 +--- + sfcommands/sfconvert.c | 34 ++++++++++++++++++++++++++++++++-- + 1 file changed, 32 insertions(+), 2 deletions(-) + +diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c +index 80a1bc4..970a3e4 100644 +--- a/sfcommands/sfconvert.c ++++ b/sfcommands/sfconvert.c +@@ -45,6 +45,33 @@ void printusage (void); + void usageerror (void); + bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid); + ++int firstBitSet(int x) ++{ ++ int position=0; ++ while (x!=0) ++ { ++ x>>=1; ++ ++position; ++ } ++ return position; ++} ++ ++#ifndef __has_builtin ++#define __has_builtin(x) 0 ++#endif ++ ++int multiplyCheckOverflow(int a, int b, int *result) ++{ ++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) ++ return __builtin_mul_overflow(a, b, result); ++#else ++ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits ++ return true; ++ *result = a * b; ++ return false; ++#endif ++} ++ + int main (int argc, char **argv) + { + if (argc == 2) +@@ -323,8 +350,11 @@ bool copyaudiodata (AFfilehandle infile, AFfilehandle outfile, int trackid) + { + int frameSize = afGetVirtualFrameSize(infile, trackid, 1); + +- const int kBufferFrameCount = 65536; +- void *buffer = malloc(kBufferFrameCount * frameSize); ++ int kBufferFrameCount = 65536; ++ int bufferSize; ++ while (multiplyCheckOverflow(kBufferFrameCount, frameSize, &bufferSize)) ++ kBufferFrameCount /= 2; ++ void *buffer = malloc(bufferSize); + + AFframecount totalFrames = afGetFrameCount(infile, AF_DEFAULT_TRACK); + AFframecount totalFramesWritten = 0; diff --git a/gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch b/gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch new file mode 100644 index 0000000000..2be930b924 --- /dev/null +++ b/gnu/packages/patches/audiofile-overflow-in-MSADPCM.patch @@ -0,0 +1,116 @@ +From: Antonio Larrosa +Date: Mon, 6 Mar 2017 13:43:53 +0100 +Subject: Check for multiplication overflow in MSADPCM decodeSample + +Check for multiplication overflow (using __builtin_mul_overflow +if available) in MSADPCM.cpp decodeSample and return an empty +decoded block if an error occurs. + +This fixes the 00193-audiofile-signintoverflow-MSADPCM case of #41 +--- + libaudiofile/modules/BlockCodec.cpp | 5 ++-- + libaudiofile/modules/MSADPCM.cpp | 47 +++++++++++++++++++++++++++++++++---- + 2 files changed, 46 insertions(+), 6 deletions(-) + +diff --git a/libaudiofile/modules/BlockCodec.cpp b/libaudiofile/modules/BlockCodec.cpp +index 45925e8..4731be1 100644 +--- a/libaudiofile/modules/BlockCodec.cpp ++++ b/libaudiofile/modules/BlockCodec.cpp +@@ -52,8 +52,9 @@ void BlockCodec::runPull() + // Decompress into m_outChunk. + for (int i=0; i(m_inChunk->buffer) + i * m_bytesPerPacket, +- static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount); ++ if (decodeBlock(static_cast(m_inChunk->buffer) + i * m_bytesPerPacket, ++ static_cast(m_outChunk->buffer) + i * m_framesPerPacket * m_track->f.channelCount)==0) ++ break; + + framesRead += m_framesPerPacket; + } +diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp +index 8ea3c85..ef9c38c 100644 +--- a/libaudiofile/modules/MSADPCM.cpp ++++ b/libaudiofile/modules/MSADPCM.cpp +@@ -101,24 +101,60 @@ static const int16_t adaptationTable[] = + 768, 614, 512, 409, 307, 230, 230, 230 + }; + ++int firstBitSet(int x) ++{ ++ int position=0; ++ while (x!=0) ++ { ++ x>>=1; ++ ++position; ++ } ++ return position; ++} ++ ++#ifndef __has_builtin ++#define __has_builtin(x) 0 ++#endif ++ ++int multiplyCheckOverflow(int a, int b, int *result) ++{ ++#if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) ++ return __builtin_mul_overflow(a, b, result); ++#else ++ if (firstBitSet(a)+firstBitSet(b)>31) // int is signed, so we can't use 32 bits ++ return true; ++ *result = a * b; ++ return false; ++#endif ++} ++ ++ + // Compute a linear PCM value from the given differential coded value. + static int16_t decodeSample(ms_adpcm_state &state, +- uint8_t code, const int16_t *coefficient) ++ uint8_t code, const int16_t *coefficient, bool *ok=NULL) + { + int linearSample = (state.sample1 * coefficient[0] + + state.sample2 * coefficient[1]) >> 8; ++ int delta; + + linearSample += ((code & 0x08) ? (code - 0x10) : code) * state.delta; + + linearSample = clamp(linearSample, MIN_INT16, MAX_INT16); + +- int delta = (state.delta * adaptationTable[code]) >> 8; ++ if (multiplyCheckOverflow(state.delta, adaptationTable[code], &delta)) ++ { ++ if (ok) *ok=false; ++ _af_error(AF_BAD_COMPRESSION, "Error decoding sample"); ++ return 0; ++ } ++ delta >>= 8; + if (delta < 16) + delta = 16; + + state.delta = delta; + state.sample2 = state.sample1; + state.sample1 = linearSample; ++ if (ok) *ok=true; + + return static_cast(linearSample); + } +@@ -212,13 +248,16 @@ int MSADPCM::decodeBlock(const uint8_t *encoded, int16_t *decoded) + { + uint8_t code; + int16_t newSample; ++ bool ok; + + code = *encoded >> 4; +- newSample = decodeSample(*state[0], code, coefficient[0]); ++ newSample = decodeSample(*state[0], code, coefficient[0], &ok); ++ if (!ok) return 0; + *decoded++ = newSample; + + code = *encoded & 0x0f; +- newSample = decodeSample(*state[1], code, coefficient[1]); ++ newSample = decodeSample(*state[1], code, coefficient[1], &ok); ++ if (!ok) return 0; + *decoded++ = newSample; + + encoded++; diff --git a/gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch b/gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch deleted file mode 100644 index 35627d3869..0000000000 --- a/gnu/packages/patches/audiofile-signature-of-multiplyCheckOverflow.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Antonio Larrosa -Date: Fri, 10 Mar 2017 15:40:02 +0100 -Subject: Fix signature of multiplyCheckOverflow. It returns a bool, not an int - ---- - libaudiofile/modules/MSADPCM.cpp | 2 +- - sfcommands/sfconvert.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libaudiofile/modules/MSADPCM.cpp b/libaudiofile/modules/MSADPCM.cpp -index ef9c38c..d8c9553 100644 ---- a/libaudiofile/modules/MSADPCM.cpp -+++ b/libaudiofile/modules/MSADPCM.cpp -@@ -116,7 +116,7 @@ int firstBitSet(int x) - #define __has_builtin(x) 0 - #endif - --int multiplyCheckOverflow(int a, int b, int *result) -+bool multiplyCheckOverflow(int a, int b, int *result) - { - #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) - return __builtin_mul_overflow(a, b, result); -diff --git a/sfcommands/sfconvert.c b/sfcommands/sfconvert.c -index 970a3e4..367f7a5 100644 ---- a/sfcommands/sfconvert.c -+++ b/sfcommands/sfconvert.c -@@ -60,7 +60,7 @@ int firstBitSet(int x) - #define __has_builtin(x) 0 - #endif - --int multiplyCheckOverflow(int a, int b, int *result) -+bool multiplyCheckOverflow(int a, int b, int *result) - { - #if (defined __GNUC__ && __GNUC__ >= 5) || ( __clang__ && __has_builtin(__builtin_mul_overflow)) - return __builtin_mul_overflow(a, b, result); -- cgit v1.2.3 From 000e7a0abc747ab6eb4fc23e80e4e9fbe8e75781 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Nov 2020 21:49:15 +0100 Subject: vm: expression->derivation-in-linux-vm: Run in a UTF-8 locale. * gnu/system/vm.scm (expression->derivation-in-linux-vm): Add calls to 'setenv' and 'setlocale'. --- gnu/system/vm.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnu') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index c9580f6e7f..07a59a3cd2 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -224,6 +224,12 @@ substitutable." (use-modules (guix build utils) (gnu build vm)) + ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded + ;; by 'estimated-partition-size' below. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + (let* ((native-inputs '#+(list qemu (canonical-package coreutils))) (linux (string-append -- cgit v1.2.3