summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2022-03-14 09:39:33 +0100
committerLudovic Courtès <ludo@gnu.org>2022-03-14 23:32:30 +0100
commit3b80e79f219be5357ccd7d4540ef0688184aa28c (patch)
tree37978258f81f412b90e51d35912444399dc51c27
parent15bb35d0c42e6f61c3ffc8e5e6e2d9b2d00a8902 (diff)
downloadguix-patches-3b80e79f219be5357ccd7d4540ef0688184aa28c.tar
guix-patches-3b80e79f219be5357ccd7d4540ef0688184aa28c.tar.gz
transformations: '--tune' prints supported micro-architectures upon error.
* guix/transformations.scm (build-system-with-tuning-compiler): Add &fix-hint condition when asked for an unsupported micro-architecture.
-rw-r--r--guix/transformations.scm28
1 files changed, 24 insertions, 4 deletions
diff --git a/guix/transformations.scm b/guix/transformations.scm
index 0976f0d824..a0045e5b27 100644
--- a/guix/transformations.scm
+++ b/guix/transformations.scm
@@ -46,6 +46,7 @@
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-35)
#:use-module (srfi srfi-37)
#:use-module (ice-9 match)
#:use-module (ice-9 vlist)
@@ -526,10 +527,29 @@ system that builds code for MICRO-ARCHITECTURE; otherwise raise an error."
micro-architecture)))
(unless (member micro-architecture
(or (assoc-ref lst architecture) '()))
- (raise (formatted-message
- (G_ "compiler ~a does not support micro-architecture ~a")
- (package-full-name compiler)
- micro-architecture))))
+ (raise
+ (make-compound-condition
+ (formatted-message
+ (G_ "compiler ~a does not support micro-architecture ~a")
+ (package-full-name compiler)
+ micro-architecture)
+ (condition
+ (&fix-hint
+ (hint (match (assoc-ref lst architecture)
+ (#f (format #f (G_ "Compiler ~a does not support
+micro-architectures of ~a.")
+ (package-full-name compiler "@@")
+ architecture))
+ (lst
+ (format #f (G_ "Compiler ~a supports the following ~a
+micro-architectures:
+
+@quotation
+~a
+@end quotation")
+ (package-full-name compiler "@@")
+ architecture
+ (string-join lst ", ")))))))))))
(bag
(inherit lowered)