On Mon, Jan 11, 2021 at 01:36:38PM +0100, Ludovic Courtès wrote: > Hello! > > Efraim Flashner skribis: > > > * build-aux/guix.scm: New file. > > Could you (1) add a copyright header, and (2) add this file to > ‘EXTRA_DIST’ in ‘Makefile.am’? Sure > > +(define (keep-file? file stat) > > + (not (any (lambda (my-string) > > + (string-contains file my-string)) > > + (list ".git" ".dir-locals.el" "build-aux")))) > > FWIW, I’m never quite sure what to do here. In Guile-zstd, I wrote > something that works even from a tarball (not a Git checkout), but it’s > a bit verbose: > > https://notabug.org/guile-zstd/guile-zstd/src/master/guix.scm Looking at that list I feel like I'm missing bits. If we go down the rabiit hole of figuring out all the different files which could possibly be included in the list I feel like we should keep it as a fancy macro somewhere. It'd almost be easier to copy the entire directory somewhere, run 'git clean -dfx' and then use that. Or to parse .gitignore or make clean. > > +(define (build-from-git base) > > + (package > > + (inherit base) > > + (version (git-version (package-version base) "HEAD" %git-commit)) > > + (source (local-file %source-dir > > + #:recursive? #t > > + #:select? keep-file?)) > > […] > > > +(list (build-from-git (specification->package "shepherd")) > > + (build-from-git (specification->package "guile2.2-shepherd")) > > + ;; This version FTBFS due to an import of '(ice-9 threads)' in modules/shepherd.scm > > + ;(build-from-git (specification->package "guile2.0-shepherd")) > > + ) > > Should it be a manifest instead, so that ‘guix build -f’ works? Returning a list also seems to work (ins)efraim@3900XT ~/workspace/shepherd$ guix build -f build-aux/guix.scm -n substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% substitute: updating substitutes from 'https://bayfront.guix.gnu.org'... 100.0% The following derivations would be built: /gnu/store/g2ql360i3s02mg42l4ys27lsghpx5xqq-shepherd-0.8.1-HEAD.b482009.drv /gnu/store/ajlqc21qqmi3fp5j30jq7vc0i1qn701y-guile2.2-shepherd-0.8.1-HEAD.b482009.drv /gnu/store/nbq7yw0zzmrwvykcld3fsbgmh39fapym-guile2.0-shepherd-0.8.1.drv > The downside of returning several packages is that ‘guix environment -l > guix.scm’ won’t work. Technically it works, but it's not as useful as just getting the inputs you actually want. (ins)efraim@3900XT ~/workspace/shepherd$ guix environment -l build-aux/guix.scm (ins)efraim@3900XT ~/workspace/shepherd [env]$ which -a guile /gnu/store/xlsi9fmi4blrpwn4xy8cvfq86zhag878-profile/bin/guile /home/efraim/.guix-profile/bin/guile /run/current-system/profile/bin/guile (ins)efraim@3900XT ~/workspace/shepherd [env]$ /gnu/store/xlsi9fmi4blrpwn4xy8cvfq86zhag878-profile/bin/guile --version guile (GNU Guile) 3.0.2 Copyright (C) 2020 Free Software Foundation, Inc. License LGPLv3+: GNU LGPL 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (ins)efraim@3900XT ~/workspace/shepherd$ ls /gnu/store/xlsi9fmi4blrpwn4xy8cvfq86zhag878-profile/lib/guile/ 2.0 2.2 3.0/ > Thanks, > Ludo’. I also got guile2.0-shepherd to build. -- Efraim Flashner אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted