diff options
author | Marius Bakke <marius@gnu.org> | 2022-08-11 23:36:10 +0200 |
---|---|---|
committer | Marius Bakke <marius@gnu.org> | 2022-08-11 23:36:10 +0200 |
commit | 77eb3008e350c069e0ae8df6a91bf0ebdcfc2ac0 (patch) | |
tree | b899e65aa79099be3f4b27dfcd565bb143681211 /guix/scripts/build.scm | |
parent | f7e8be231806a904e6817e8ab3404b32f2511db2 (diff) | |
parent | b50eaa67642ebc25e9c896f2e700c08610e0a5da (diff) |
Merge branch 'staging' into core-updates
Diffstat (limited to 'guix/scripts/build.scm')
-rw-r--r-- | guix/scripts/build.scm | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 75bbb701ae..06d9ad1f0c 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -373,8 +373,19 @@ use '--no-offload' instead~%"))) (first (member arg (targets)))))) (if t (apply values (alist-cons 'target t result) rest) - (leave (G_ "'~a' is not a supported target~%") - arg))))))) + (let ((closest (string-closest arg (targets) + #:threshold 5))) + (report-error + (G_ "'~a' is not a supported cross-compilation target~%") + arg) + (if closest + (display-hint + (format #f (G_ "Did you mean @code{~a}? +Try @option{--list-targets} to view available targets.~%") + closest)) + (display-hint (G_ "\ +Try @option{--list-targets} to view available targets.~%"))) + (exit 1)))))))) (define %standard-native-build-options ;; Build options related to native builds. @@ -389,8 +400,18 @@ use '--no-offload' instead~%"))) (first (member arg (systems)))))) (if s (apply values (alist-cons 'system s result) rest) - (leave (G_ "'~a' is not a supported system~%") - arg))))))) + (let ((closest (string-closest arg (systems) + #:threshold 5))) + (report-error (G_ "'~a' is not a supported system~%") + arg) + (if closest + (display-hint + (format #f (G_ "Did you mean @code{~a}? +Try @option{--list-systems} to view available system types.~%") + closest)) + (display-hint (G_ "\ +Try @option{--list-systems} to view available system types.~%"))) + (exit 1)))))))) ;;; |