Hi Edouard, Felix. Thank you for your responses!
Both of your replies were helpful. The fact that all the magic is in
fact in the build /phases/ and not exactly in the build
/system/ definitely helped me understand a lot. The code references also
helped too, and helped me to actually grok the gnu-build-system for the
first time.
If I am reading everything correctly now, gnu-build-system kind of has
two purposes: one to abstract the typical configure/build/install
Makefile-based GNU build system, and two to store logic that is general
to all guix-build-systems but actually specific to guix and have nothing
to do with the build system per se. In this latter group I am thinking
of things like patch-source-shebangs and patch-usr-bin-file. So it seems
like most (all?) build systems use the gnu-build-system in defining
themselves because they want to make use of the "guix-build-system
conventions".
Then, just to complete the thought, each build phase is just a procedure
which takes an arbitrary list of arguments, but supports (possibly by
ignoring them) at least #:source, #:inputs, #:outputs, since these are
declared by gnu-build. And gnu-build even allows the #:phases argument
to be injected, which makes me feel even more that this is a
general-purpose "build whatever you want", not "build a GNU project".
It seems then like my use case (check out the docker source and run
hack/make.sh) is very similar to the gerbil-build-system use case. I
have actually managed to crib that example so that I am getting errors
actually with the build script now, rather than in my own environment
(which is an improvement). The boilerplate still makes me sad but I can
put that aside for now.
I am still finding it quite tricky to debug builds, but this is now
getting onto a new topic. I can see a backtrace of the failed build, but
this is not really enough information. I can't see any way to inspect
the failed build directory to see e.g. *why* a particular file is missing.
I will post back if I succeed in actually building something. Best wishes,
Dan