Hi Guix!

Each build-system sets its own imported-modules and modules, but in the
case where we would want to generalize a function which takes a
build-system in its arguments, there doesn't seem to be a way to access
the imported-modules and modules from this build-system. (I have a
specific use-case in mind for extending/modifying arbitrary
build-systems, related to 68315).

I would like to make that metadata available at the build-system
level. This would require setting procedure properties on builder
functions, in every build-system, like so:

(set-procedure-properties!
 gnu-build
 `((imported-modules . ,%default-gnu-imported-modules)
   (modules . ,%default-gnu-modules)))

This would allow things like that:

(let* ((lower (build-system-lower target-build-system))
       (imported-modules (procedure-property lower 'imported-modules))
       (modules (procedure-property lower 'modules)))
  (values (whatever-proc lower args)
          imported-modules
          modules))

Where target-build-system could be any build-system. I guess changing
properties doesn't change derivations, so this would not lead to a world
rebuild.

Would you accept such a patch upstream ? (It's not hard to write so I
prefer to agree the idea upon it first).

--
Best regards,
Nicolas Graves

Reply via email to