mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system/pyproject: Handle wheel not found exception.
The current error is very uninformative, use a proper exception to give more information when this happens: `In procedure map: Wrong type argument: #f` After this patch: `In procedure raise-exception: ERROR: 1. &no-wheels-found` * guix/build/pyproject-build-system.scm (&no-wheels-found): Add exception. (install): Handle exception. Change-Id: Ie72d3b50dfededb2d598162672cdb4321c42b632 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
parent
977caf32ef
commit
2d45de1bc4
1 changed files with 11 additions and 3 deletions
|
@ -87,6 +87,9 @@
|
||||||
;; Raised, when no wheel has been built by the build system.
|
;; Raised, when no wheel has been built by the build system.
|
||||||
(define-condition-type &no-wheels-built &python-build-error no-wheels-built?)
|
(define-condition-type &no-wheels-built &python-build-error no-wheels-built?)
|
||||||
|
|
||||||
|
;; Raised, when no installation candidate wheel has been found.
|
||||||
|
(define-condition-type &no-wheels-found &python-build-error no-wheels-found?)
|
||||||
|
|
||||||
(define* (build #:key outputs build-backend backend-path configure-flags #:allow-other-keys)
|
(define* (build #:key outputs build-backend backend-path configure-flags #:allow-other-keys)
|
||||||
"Build a given Python package."
|
"Build a given Python package."
|
||||||
|
|
||||||
|
@ -251,10 +254,15 @@ builder.build_wheel(sys.argv[3], config_settings=config_settings)"
|
||||||
|
|
||||||
(let* ((wheel-output (assoc-ref outputs "wheel"))
|
(let* ((wheel-output (assoc-ref outputs "wheel"))
|
||||||
(wheel-dir (if wheel-output wheel-output "dist"))
|
(wheel-dir (if wheel-output wheel-output "dist"))
|
||||||
(wheels (map (cut string-append wheel-dir "/" <>)
|
(wheels-found (or (scandir wheel-dir
|
||||||
(scandir wheel-dir
|
(cut string-suffix? ".whl" <>))
|
||||||
(cut string-suffix? ".whl" <>)))))
|
'()))
|
||||||
|
(wheels (map (cut string-append wheel-dir "/" <>) wheels-found)))
|
||||||
(cond
|
(cond
|
||||||
|
;; This can happen if the 'build phase has been changed or when using
|
||||||
|
;; the install phase using an alternative build-system.
|
||||||
|
((null? wheels-found)
|
||||||
|
(raise (condition (&no-wheels-found))))
|
||||||
((> (length wheels) 1)
|
((> (length wheels) 1)
|
||||||
;; This code does not support multiple wheels yet, because their
|
;; This code does not support multiple wheels yet, because their
|
||||||
;; outputs would have to be merged properly.
|
;; outputs would have to be merged properly.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue