* help with a confusing error: url-fetch, hash, invalid keyword #vu8
@ 2019-11-18 15:28 Robert Vollmert
2019-11-18 20:40 ` John Soo
0 siblings, 1 reply; 4+ messages in thread
From: Robert Vollmert @ 2019-11-18 15:28 UTC (permalink / raw)
To: guix-devel
Hi,
I’m in writing up some notes on my Guix packaging work earlier this year, and
am running into an unexpected problem that I’m lost with. A concrete example:
$ guix import hackage ormolu > ormolu.scm
add missing imports at the top of ormolu.scm:
(use-modules (guix packages))
(use-modules (guix build download))
(use-modules (guix build-system haskell))
(use-modules (guix licenses))
(use-modules (gnu packages haskell-xyz))
(use-modules (gnu packages haskell-check))
$ guix build -f ormolu.scm
Backtrace:
In guix/ui.scm:
415:6 19 (_)
In guix/scripts/build.scm:
879:5 18 (_)
In srfi/srfi-1.scm:
679:15 17 (append-map _ _ . _)
592:17 16 (map1 ("x86_64-linux"))
679:15 15 (append-map _ _ . _)
592:17 14 (map1 (#<package ghc-ormolu@0.0.1.0 /home/rob/blog-tes…>))
In guix/scripts/build.scm:
840:18 13 (_ _)
In guix/packages.scm:
936:16 12 (cache! #<weak-table 447/883> #<package ghc-ormolu@0.0…> …)
1255:22 11 (thunk)
1188:25 10 (bag->derivation #<store-connection 256.99 1b95ae0> #<…> …)
In srfi/srfi-1.scm:
592:29 9 (map1 _)
592:29 8 (map1 (("ghc-hspec" #<package ghc-hspec@2.5.5 gnu/…>) …))
592:29 7 (map1 (("ghc-path" #<package ghc-path@0.6.1 gnu/pa…>) …))
592:29 6 (map1 (("ghc-path-io" #<package ghc-path-io@1.3.3 …>) …))
592:17 5 (map1 (("source" #<origin "https://hackage.haskell…>) …))
In ice-9/boot-9.scm:
829:9 4 (catch srfi-34 #<procedure 4628b10 at guix/packages.sc…> …)
In guix/packages.scm:
1003:18 3 (_)
In guix/store.scm:
1803:24 2 (run-with-store #<store-connection 256.99 1b95ae0> _ # _ …)
1673:13 1 (_ _)
In guix/build/download.scm:
741:0 0 (url-fetch _ _ #:timeout _ #:verify-certificate? _ # _ # …)
guix/build/download.scm:741:0: In procedure url-fetch:
Invalid keyword: #vu8(96 84 134 13 223 219 170 200 61 134 246 111 6 115 201 118 102 154 109 187 101 185 64 146 131 54 199 173 34 76 149 220)
This is with my guix install from roughly July, which has some modifications,
so it’s not impossible that that’s involved, but I don’t see any relevant changes.
And generally the install still works fine, including building some local
custom packages that don’t do anything differently that’s obvious to me.
I suspect I made some simple mistake with imports or my guix package invocation —
hoping someone can provide a hint?
The full contents of ormolu.scm:
(use-modules (guix packages))
(use-modules (guix build download))
(use-modules (guix build-system haskell))
(use-modules (guix licenses))
(use-modules (gnu packages haskell-xyz))
(use-modules (gnu packages haskell-check))
(package
(name "ghc-ormolu")
(version "0.0.1.0")
(source
(origin
(method url-fetch)
(uri (string-append
"https://hackage.haskell.org/package/ormolu/ormolu-"
version
".tar.gz"))
(sha256
(base32
"1p4m9hiavirnhf941fb5pdnrlrknr5rhcvznhqywianvvw6qcm30"))))
(build-system haskell-build-system)
(inputs
`(("ghc-dlist" ,ghc-dlist)
("ghc-exceptions" ,ghc-exceptions)
("ghc-paths" ,ghc-paths)
("ghc-syb" ,ghc-syb)
("ghc-gitrev" ,ghc-gitrev)
("ghc-optparse-applicative"
,ghc-optparse-applicative)))
(native-inputs
`(("ghc-hspec" ,ghc-hspec)
("ghc-path" ,ghc-path)
("ghc-path-io" ,ghc-path-io)))
(home-page "https://github.com/tweag/ormolu")
(synopsis "A formatter for Haskell source code")
(description
"A formatter for Haskell source code.")
(license bsd-3))
Cheers
Robert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: help with a confusing error: url-fetch, hash, invalid keyword #vu8
2019-11-18 15:28 help with a confusing error: url-fetch, hash, invalid keyword #vu8 Robert Vollmert
@ 2019-11-18 20:40 ` John Soo
2019-11-18 21:06 ` Robert Vollmert
0 siblings, 1 reply; 4+ messages in thread
From: John Soo @ 2019-11-18 20:40 UTC (permalink / raw)
To: Robert Vollmert; +Cc: guix-devel
Hi Robert,
Interesting. Looks alright to me. Also I did just package ormolu myself and everything worked alright. One thing to try is using `guix repl` to reproduce the error. Can you open one up and see what happens?
- John
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: help with a confusing error: url-fetch, hash, invalid keyword #vu8
2019-11-18 20:40 ` John Soo
@ 2019-11-18 21:06 ` Robert Vollmert
2019-11-18 21:13 ` John Soo
0 siblings, 1 reply; 4+ messages in thread
From: Robert Vollmert @ 2019-11-18 21:06 UTC (permalink / raw)
To: John Soo; +Cc: guix-devel
On 18. Nov 2019, at 21:40, John Soo <jsoo1@asu.edu> wrote:
>
> Hi Robert,
>
> Interesting. Looks alright to me. Also I did just package ormolu myself and everything worked alright. One thing to try is using `guix repl` to reproduce the error. Can you open one up and see what happens?
Actually that helped, thanks! Here’s what I did (mostly so I don’t need to figure that out again):
1. made a proper module out of the file ormolu.scm
2. ran `guix repl` in the directory with ormolu.scm
scheme@(guix-user)> ,load /path/to/ormolu.scm
scheme@(guix-user)> ghc-ormolu
$1 = #<package ghc-ormolu@0.0.1.0 /home/rob/blog-test/ormolu.scm:9 300ba50>
scheme@(guix-user)> (package-source ghc-ormolu)
$2 = #<origin "https://hackage.haskell.org/package/ormolu/ormolu-0.0.1.0.tar.gz" mbkimdo73ovmqpmg6zxqm46joztju3n3mw4ubeudg3d22ismsxoa () 318b420>
scheme@(guix-user)> (origin-sha256 (package-source ghc-ormolu))
$3 = #vu8(96 84 134 13 223 219 170 200 61 134 246 111 6 115 201 118 102 154 109 187 101 185 64 146 131 54 199 173 34 76 149 220)
scheme@(guix-user)> ,use (gnu packages haskell)
scheme@(guix-user)> (package-source ghc)
$4 = #<origin "https://www.haskell.org/ghc/dist/8.4.3/ghc-8.4.3-src.tar.xz" vzd27wuylayn5careqzflkrxitp3sid4xgak65bzgkmlfnrbmdla () 2f20420>
scheme@(guix-user)> (origin-sha256 (package-source ghc))
$5 = #vu8(174 71 175 218 152 88 48 222 136 17 36 50 85 170 55 68 223 185 32 124 185 128 175 116 57 50 152 178 182 33 96 214)
So far so good, they look similar.
scheme@(guix-user)> (origin-method (package-source ghc))
$6 = #<procedure url-fetch (url hash-algo hash #:optional name #:key system guile)>
scheme@(guix-user)> (origin-method (package-source ghc-ormolu))
$7 = #<procedure url-fetch (url file #:key timeout verify-certificate? mirrors content-addressed-mirrors hashes print-build-trace?)>
Aha! It turns out the error was in importing (guix build download) as opposed to (guix download).
I’d added that import due to the “helpful”
$ guix build -f ormolu.scm
ice-9/eval.scm:223:20: In procedure proc:
error: url-fetch: unbound variable
hint: Did you forget `(use-modules (guix build download))'?
Sigh.
Anyway, fixed for now, thank you!
Cheers
Rob
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: help with a confusing error: url-fetch, hash, invalid keyword #vu8
2019-11-18 21:06 ` Robert Vollmert
@ 2019-11-18 21:13 ` John Soo
0 siblings, 0 replies; 4+ messages in thread
From: John Soo @ 2019-11-18 21:13 UTC (permalink / raw)
To: Robert Vollmert; +Cc: guix-devel
Hi Robert,
Excellent! Glad that helped :D.
- John
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-18 21:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-18 15:28 help with a confusing error: url-fetch, hash, invalid keyword #vu8 Robert Vollmert
2019-11-18 20:40 ` John Soo
2019-11-18 21:06 ` Robert Vollmert
2019-11-18 21:13 ` John Soo
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).