Hi! I tried both ways - the second works, but the first doesn't. That's what I have in the file - if I didn't miss something, it is the same as your example:
#:imported-modules (,@(source-module-closure '((gnu packages jami) ,@%gnu-build-system-modules))) #:modules ((gnu packages jami) ,@(@@ (guix build-system gnu) %default-modules)) And I get an ugly backtrace (could this be a bug or am I doing something wrong?): The following derivations will be built: /gnu/store/xf6b58rlki7sb3k9fj2dxkm4ljiypdc0-pjproject-jami-2.9.drv /gnu/store/aaqaz52fhjb86g233ar4ynnyjvrv7xa7-module-import-compiled.drv building /gnu/store/aaqaz52fhjb86g233ar4ynnyjvrv7xa7-module-import-compiled.drv... Backtrace: In ice-9/eval.scm: 721:20 19 (primitive-eval _) In ice-9/psyntax.scm: 1262:36 18 (expand-top-sequence _ _ _ #f _ _ _) 1209:24 17 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?) 285:10 16 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) ?) In ice-9/eval.scm: 293:34 15 (_ #<module (#{ g172}#) 7ffff488f5a0>) In ice-9/boot-9.scm: 2874:4 14 (define-module* _ #:filename _ #:pure _ #:version _ # _ ?) 2887:24 13 (_) 222:29 12 (map1 _) 222:29 11 (map1 _) 222:29 10 (map1 _) 222:29 9 (map1 _) 222:29 8 (map1 _) 222:29 7 (map1 (((guix monads)) ((guix records)) ((guix #)) (#) ?)) 222:29 6 (map1 (((guix records)) ((guix base16)) ((guix #)) (#) ?)) 222:29 5 (map1 (((guix base16)) ((guix base32)) ((gcrypt #)) # ?)) 222:29 4 (map1 (((guix base32)) ((gcrypt hash)) ((guix #)) (#) ?)) 222:17 3 (map1 (((gcrypt hash)) ((guix profiling)) ((rnrs #)) # ?)) 2803:6 2 (resolve-interface _ #:select _ #:hide _ #:prefix _ # _ ?) In unknown file: 1 (scm-error misc-error #f "~A ~S" ("no code for modu?" ?) ?) In ice-9/boot-9.scm: 752:25 0 (dispatch-exception _ _ _) ice-9/boot-9.scm:752:25: In procedure dispatch-exception: no code for module (gcrypt hash) builder for `/gnu/store/aaqaz52fhjb86g233ar4ynnyjvrv7xa7-module-import-compiled.drv' failed with exit code 1 Any ideas? > Hope that helps, thanks for the work on Jami y'all! No problem. Dnia 2019-12-10, o godz. 09:59:40 Caleb Ristvedt <caleb.ristv...@cune.org> napisaĆ(a): > #:modules and #:imported-modules are distinct arguments. #:modules is > the modules that your builder is going to use (as in "they go in a > (use-modules ...) form"), while #:imported-modules is the modules > that need to be available > in the build environment. It's complaining at build-time that it > can't find that > module to use, because you haven't told it to include that module in > the build > environment. #:imported-modules should give a superset of what > #:modules gives, > especially if a module in use is going to have indirect > requirements. Thankfully, wrangling together those indirect > requirements is already implemented in (guix modules) as > source-module-closure. > > Thus, you could conceptually do > > > (arguments > `(#:imported-modules (,@(source-module-closure > '((gnu packages jami) > ,@%gnu-build-system-modules))) > #:modules ((gnu packages jami) > ,@(@@ (guix build-system gnu) %default-modules)))) > > And in theory it would work. Note, though, that this would pull in the > entire > module dependency graph of (gnu packages jami), and this may include > things that > source-module-closure would have a hard time detecting and aren't > really needed. Ideally this procedure would be generalized and put in > (guix build <something>), but I can understand if that's not > possible. Note also that you > could simply splice in the definition of your procedure into the > builder manually, like so: > > (define my-procedure-code '(lambda (a b c) ...)) > > (arguments > `(#:phases (let ((my-procedure ,my-procedure-code)) (modify-phases > ...)))) > > Hope that helps, thanks for the work on Jami y'all! Jan Wielkiewicz