From 0f024554e63a49e20c2a7a67e928073c266bf5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 5 May 2022 23:42:36 +0200 Subject: [PATCH] transformations: Preserve transformation order in package property. Fixes . Reported by SeerLite . * guix/transformations.scm (options->transformation) [package-with-transformation-properties]: Add call to 'reverse'. * tests/transformations.scm ("options->transformation, property order"): New test. --- guix/transformations.scm | 2 +- tests/transformations.scm | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/guix/transformations.scm b/guix/transformations.scm index a0045e5b27..411c4014cb 100644 --- a/guix/transformations.scm +++ b/guix/transformations.scm @@ -959,7 +959,7 @@ (define (package-with-transformation-properties p) . ,(map (match-lambda ((key value _) (cons key value))) - applicable)) + (reverse applicable))) ;preserve order ,@(package-properties p))))) (lambda (obj) diff --git a/tests/transformations.scm b/tests/transformations.scm index 8db85b4305..dbfe523518 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2016-2017, 2019-2022 Ludovic Courtès ;;; Copyright © 2021 Marius Bakke ;;; ;;; This file is part of GNU Guix. @@ -451,6 +451,18 @@ (define (package-name* obj) (string=? (local-file-file input) patch))) inputs)))))))) +(test-equal "options->transformation, property order" + ;; See . + '((with-debug-info . "does-not-exist") + (with-commit . "does-not-exist=aaaaaaa") + (without-tests . "does-not-exist")) + (let* ((t (options->transformation + '((with-debug-info . "does-not-exist") + (with-commit . "does-not-exist=aaaaaaa") + (without-tests . "does-not-exist"))))) + (let ((new (t coreutils))) + (assq-ref (package-properties new) 'transformations)))) + (test-equal "options->transformation, with-latest" "42.0" (mock ((guix upstream) %updaters