Nikita Karetnikov <nik...@karetnikov.org> skribis: > 1. ‘guix prefetch’ tries to configure and build some packages instead of > just downloading them. I tried the following on a machine with the > empty store: > > a. Ran ‘guix prefetch hello’. Some packages were downloaded and > built (I gathered those are needed to download the other packages, > so I didn’t write down the names. If I recall correctly, Guile > was in that list.)
Yes, by default ‘guile-final’ is used to build derivations (including download derivations), so that needs to be built before anything else can be done. (And that involves building gcc, libc, etc. first.) > b. Invoked ‘guix build hello’ without network access. The command > succeeded. No questions here. > > c. Called ‘guix prefetch emacs’. These packages were configured and > built: pkg-config, libunistring, ncurses, libatomic_ops, patch, > tar, xz, gzip, zlib, which, gc, perl, m4, readline, libffi, > texinfo, libtool, gmp, libtasn1, nettle, guile, gnutls. > > Are these essential, or is there an error in ‘guix prefetch’? > According to the build logs, the install prefix of gmp is > ‘/gnu/store/hpaz49xz76p4qmpjc9r33hni1w781y66-gmp-5.1.3’, which > doesn’t appear in the lists provided by ‘guix prefetch hello’ and > ‘guix prefetch emacs’. I’m not sure why it’s the case. Perhaps these were just the prerequisites for ‘guile-final’ no? > 2. I think it would be nice to output the location of a tarball after > running ‘guix prefetch’, but I’m not sure how to get the relevant > derivation. For ‘hello’, it’s neither > > (package-source-derivation store (package-source hello)) > > nor > > (package-derivation store hello) > > because the derivation listed in the initial output of ‘guix prefetch > hello’ differs. Of course, it’s possible to filter the list > produced by > > (build-derivations > store > (map (lambda (drv) > ;; (format #t " ~a~%" (derivation-file-name drv)) > (format #t " ~a~%" drv) > drv) > (derivations-to-prefetch > store > (package-derivation store package))))) > > But it’s error-prone, so I’d rather avoid that. I don’t understand. You can do: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (derivation->output-path (package-source-derivation s (package-source hello))) $4 = "/gnu/store/070fnjll8hb3q2l4373bbahh2i1n2qhg-hello-2.9.tar.gz" --8<---------------cut here---------------end--------------->8--- Isn’t it what you want? > 3. I’m planning to add ‘--dry-run’, which will simply print the list of > needed derivations. I think this should use ‘show-what-to-build’, as in ‘guix build’ and other commands, so that it would also show what other derivations need to be built, such as those for ‘guile-final’. > What options would you like to see implemented? Probably all of ‘%standard-build-options’ from (guix scripts build) can be made available? Thanks for the nice work! Ludo’.