Ludovic Courtès (2015-08-18 17:15 +0300) wrote: > Alex Kost <alez...@gmail.com> skribis: > >> * guix/scripts/build.scm (build-package): New procedure. > > [...] > >> +(define (build-package package . build-options) >> + "Build PACKAGE using BUILD-OPTIONS." >> + (with-store store >> + (let* ((drv (run-with-store store >> + (package->derivation package))) >> + (drvs (list drv))) >> + (apply set-build-options store build-options) >> + (show-what-to-build store drvs) >> + (build-derivations store drvs) >> + (show-derivation-outputs drv)))) > > I think this doesn’t fit here because it isn’t actually used by ‘guix > build’. Maybe keep it in emacs/ for now?
If you mean "guix-main.scm", I don't think it's the right place either, as all this guix-devel stuff does not depend on Guix REPL (or on any code from "guix-main.scm" in general). Besides, "guix-main.scm" doesn't provide a module. What about making some additional module?: (guix devel) or something. Other similar code may be put there in future. For example, you are editing a package definition and you may want to download the current origin source. It will probably also require some specific scheme code, which may be added to that module. > Also, it’s best to call ‘set-build-options’ before anything else, to > make sure all the options are taken into account. OK > Bonus points for making it all monadic-style: > > (mbegin %store-monad > (set-build-options* opts) > (mlet* %store-monad ((drv (package->derivation)) > (drvs (list drv))) > (mbegin %store-monad > (show-what-to-build* drvs) > (built-derivations drvs) > (return (show-derivation-outputs drv))))) > > and (define set-build-options* (store-lift set-build-options)) in > (guix store). > > WDYT? OK, I'll look at it. I suppose adding 'set-build-options*' to (guix store) should be done in a separate commit, right? -- Alex