unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#43817] [PATCH 0/1] guix: build: hg: Add 'guard' to handle error.
@ 2020-10-05 16:35 zimoun
  2020-10-05 16:36 ` [bug#43817] [PATCH 1/1] " zimoun
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: zimoun @ 2020-10-05 16:35 UTC (permalink / raw)
  To: 43817; +Cc: zimoun

Dear,

This patch allows to gently report failure with 'hg clone'.

For example, let consider the package using 'hg-fetch':

--8<---------------cut here---------------start------------->8---
(define-module (hello)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (guix hg-download))

(define-public hi-hg
  (package
    (inherit hello)
    (name "hi-hg")
    (source (origin
              (method hg-fetch)
              (uri (hg-reference
                    (url "https://example.org/hg")
                    (changeset "314a11282586")))
              (sha256
               (base32
                "1yb0rsrbjg2bwyhfk677crhw0k7ijm6slaq0qq7cd4lznlz2yvji"))))
    (home-page "https://example.org/hg")))
--8<---------------cut here---------------end--------------->8---

Then, the current behaviour report an (opinionated: ugly!) backtrace:

--8<---------------cut here---------------start------------->8---
$ guix build -L /tmp/foo/ hi-hg
The following derivations will be built:
   /gnu/store/awdr7qhl6hyjgr1m9a40zfnban9ip98x-hi-hg-2.10.drv
   /gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv
building /gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv...
guile: warning: failed to install locale
warning: connection security to example.org is disabled per current settings; communication is susceptible to eavesdropping and tampering
abort: HTTP Error 404: Not Found
Backtrace:
           3 (primitive-load "/gnu/store/rf02zx0dscns2bzzics9i93l1xm?")
In ice-9/eval.scm:
   293:34  2 (_ #<directory (guile-user) 7ffff5bb8f00>)
In guix/build/hg.scm:
     38:2  1 (hg-fetch "https://example.org/hg" "314a11282586" "/gn?" ?)
In guix/build/utils.scm:
    654:6  0 (invoke _ . _)

guix/build/utils.scm:654:6: In procedure invoke:
ERROR:
  1. &invoke-error:
      program: "/gnu/store/0qx1yjfnjn77jag9rmv4z49vfrzk5bgc-mercurial-5.5.1/bin/hg"
      arguments: ("clone" "https://example.org/hg" "--rev" "314a11282586" "--insecure" "/gnu/store/6x6hccx9cqpfrcav79inl43ys6frgvw2-hg-checkout")
      exit-status: 255
      term-signal: #f
      stop-signal: #f
builder for `/gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv' failed with exit code 1
build of /gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv failed
View build log at '/var/log/guix/drvs/bg/dwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv.bz2'.
cannot build derivation `/gnu/store/awdr7qhl6hyjgr1m9a40zfnban9ip98x-hi-hg-2.10.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/awdr7qhl6hyjgr1m9a40zfnban9ip98x-hi-hg-2.10.drv' failed
--8<---------------cut here---------------end--------------->8---

Instead, the proposing patch handles the error and reports:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build -L /tmp/foo/ hi-hg
The following derivations will be built:
   /gnu/store/zam0r6fvyp9qkzp6kf087iifvnhw140n-hi-hg-2.10.drv
   /gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv
building /gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv...
guile: warning: failed to install locale
warning: connection security to example.org is disabled per current settings; communication is susceptible to eavesdropping and tampering
abort: HTTP Error 404: Not Found
hg-fetch: '/gnu/store/0qx1yjfnjn77jag9rmv4z49vfrzk5bgc-mercurial-5.5.1/bin/hg clone https://example.org/hg --rev 314a11282586 --insecure /gnu/store/6x6hccx9cqpfrcav79inl43ys6frgvw2-hg-checkout' failed with exit code 255
Trying content-addressed mirror at berlin.guix.gnu.org...
Trying content-addressed mirror at berlin.guix.gnu.org...
builder for `/gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv' failed to produce output path `/gnu/store/6x6hccx9cqpfrcav79inl43ys6frgvw2-hg-checkout'
build of /gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv failed
View build log at '/var/log/guix/drvs/z4/y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv.bz2'.
cannot build derivation `/gnu/store/zam0r6fvyp9qkzp6kf087iifvnhw140n-hi-hg-2.10.drv': 1 dependencies couldn't be built
guix build: error: build of `/gnu/store/zam0r6fvyp9qkzp6kf087iifvnhw140n-hi-hg-2.10.drv' failed
--8<---------------cut here---------------end--------------->8---

(Note: the code is highly copied from guix/build/git.scm. :-))


All the best,
simon


zimoun (1):
  guix: build: hg: Add 'guard' to handle error.

 guix/build/hg.scm | 50 +++++++++++++++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 17 deletions(-)


base-commit: 2b73e50c31a61b5dcef35a1e4b9484d9dbcb0fbc
-- 
2.28.0





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-07 17:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 16:35 [bug#43817] [PATCH 0/1] guix: build: hg: Add 'guard' to handle error zimoun
2020-10-05 16:36 ` [bug#43817] [PATCH 1/1] " zimoun
2020-10-05 16:47 ` [bug#43817] [PATCH 2/2] guix: build: svn: " zimoun
2020-10-05 16:49 ` [bug#43817] [PATCH 0/1] guix: build: hg: " zimoun
2020-10-06  8:26 ` bug#43817: " Mathieu Othacehe
2020-10-07 17:29   ` [bug#43817] " zimoun

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).