[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help me create a janet-build-system
From: |
Leo Prikler |
Subject: |
Re: Help me create a janet-build-system |
Date: |
Sat, 15 May 2021 09:00:39 +0200 |
User-agent: |
Evolution 3.34.2 |
Am Samstag, den 15.05.2021, 01:07 -0400 schrieb Jack Hill:
> Greetings Guix,
>
> I'm working on creating a build system for Janet [0] modules. This is
> my
> first time working with build systems, and while I have a much
> better
> understanding than when I started, I still don't understand it fully.
> I've
> attached my work in progress patches. The first five set the stage
> by
> updating and improving our Janet package. Patch six adds the build
> system,
> and patch seven adds an example package, janet-posix-spawn.
>
> [0] https://janet-lang.org
>
> Trying to build janet-posix-spawn results in:
>
> ```
> jackhill@alperton ~/repos/guix [env]$ ./pre-inst-env guix build
> janet-posix-spawn
> The following derivations will be built:
> /gnu/store/y1xpmfaqswcmiwzpc1bgak18rbw2k4ad-janet-posix-spawn-
> 0.0.1.drv
> /gnu/store/w52ndznq3v42xxv4lfrpdlmwgn8r0f2x-module-import-
> compiled.drv
> building /gnu/store/w52ndznq3v42xxv4lfrpdlmwgn8r0f2x-module-import-
> compiled.drv...
> Backtrace:
> In system/base/compile.scm:
> 43:4 19 (call-with-output-file/atomic _ _ _)
> In ice-9/boot-9.scm:
> 1736:10 18 (with-exception-handler _ _ #:unwind? _ # _)
> In system/base/compile.scm:
> 59:11 17 (_)
> 155:11 16 (_ #<closed: file 7ffff69868c0>)
> 235:18 15 (read-and-compile #<input: guix/build/janet-build-
> syst?> ?)
> 183:32 14 (compile-fold (#<procedure compile-tree-il (x e opts)>)
> ?)
> In ice-9/boot-9.scm:
> 2806:4 13 (save-module-excursion _)
> In language/scheme/compile-tree-il.scm:
> 31:15 12 (_)
> In ice-9/psyntax.scm:
> 1241:36 11 (expand-top-sequence _ _ _ #f _ _ _)
> 1233:19 10 (parse _ (("placeholder" placeholder)) ((top) #(# # ?))
> ?)
> 285:10 9 (parse _ (("placeholder" placeholder)) (()) _ c&e (# #)
> #)
> In ice-9/eval.scm:
> 293:34 8 (_ #<module (#{ g32}#) 7ffff697ac80>)
> In ice-9/boot-9.scm:
> 3380:4 7 (define-module* _ #:filename _ #:pure _ #:version _ # _
> ?)
> 2565:24 6 (call-with-deferred-observers _)
> 3393:24 5 (_)
> 222:29 4 (map1 (((guix build gnu-build-system) #:prefix gnu:) #
> ?))
> 222:29 3 (map1 (((guix build utils)) ((guix utils))))
> 222:17 2 (map1 (((guix utils))))
> 3300:6 1 (resolve-interface (guix utils) #:select _ #:hide _ # _
> ?)
> 1669:16 0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> no code for module (guix utils)
> ```
>
> What have I done wrong?
Your code imports (guix utils), but (guix utils) is not present within
the module closure present at build time.
Did you mean (guix build utils)?
> More generally, I expect there are many ways I could improve the
> build system. What are they?
I know little about jpm, but in my opinion you ought to let the user
customize the flags passed on to jpm at least in the build target --
not so sure about check and install. If janet-build-system allows some
degree of customization, consider also letting the user override the
test-target.
Regards,
Leo