Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Giacomo Leidi
@paulbutgold@mastodon.bida.im  ·  activity timestamp 2 months ago

@dlakelan @abcdw @charliemac it may be that you need to override the #:select keyword argument, like in this case: https://codeberg.org/fishinthecalculator/gocix-mirror/src/branch/main/modules/oci/services/containers.scm#L700

You should pass it a function like:

(use-modules (ice-9 match))

(define-public (staged-module-name? name)
"Return true if NAME (a list of symbols) denotes a Guix or staged module."
(match name
(('guix _ ...) #t)
(('gnu _ ...) #t)
(('staged _ ...) #t)
(_ #f)))

This is what I'm doing in gocix: https://codeberg.org/fishinthecalculator/gocix-mirror/src/branch/main/modules/oci/self.scm#L9 .

  • Copy link
  • Flag this post
  • Block
Daniel Lakeland
@dlakelan@mastodon.sdf.org replied  ·  activity timestamp 2 months ago
@paulbutgold
Ooh I need to remember this match syntax.

I can't work out what this #:select does, it doesn't seem to be documented in with-imported-modules docs.
@abcdw @charliemac

  • Copy link
  • Flag this comment
  • Block
Giacomo Leidi
@paulbutgold@mastodon.bida.im replied  ·  activity timestamp 2 months ago
@dlakelan @abcdw @charliemac It's not documented as far as I know, I am also not sure why. Because of reasons I'm not aware of, with-imported-modules only allows importing from the #guix or gnu namespaces (so only modules starting with guix or gnu, such as (gnu build dbus) ) . The function I shared overrides this behavior allowing also to import from modules in the oci namespace, so modules such as (oci build oci-containers) .

If you have the staged code under a (staged ... ...) namespace you can allow it to be imported by passing the function I shared in the #:select argument

  • Copy link
  • Flag this comment
  • Block
Daniel Lakeland
@dlakelan@mastodon.sdf.org replied  ·  activity timestamp 2 months ago
@paulbutgold
Wait, what? Are you sure about that?

Andrew was helping me debug this stuff last night and he certainly seemed to be getting gexp to run with locally defined functions. I'll try some stuff out and give the results later today. This might be a very important point and I will file a bug with the results if it works like you say. Either this is a software bug or a documentation bug if it works like that.
@abcdw @charliemac

  • Copy link
  • Flag this comment
  • Block
Giacomo Leidi
@paulbutgold@mastodon.bida.im replied  ·  activity timestamp 2 months ago
@dlakelan @abcdw @charliemac I am sure as it took a lot of time and frustration to get it working in #gocix . but I was slightly incorrect in my statement, it is not with-imported-modules which has the #:select argument, it is source-module-clousure which has it. this would have been evident by reading the links I provided before or looking at guix' source code: https://codeberg.org/guix/guix/src/branch/master/guix/modules.scm#L165 and https://codeberg.org/guix/guix/src/branch/master/guix/modules.scm#L116 . maybe you can send a patch to the manual fixing this?
  • Copy link
  • Flag this comment
  • Block
Daniel Lakeland
@dlakelan@mastodon.sdf.org replied  ·  activity timestamp 2 months ago
@paulbutgold
Yes I did read it yesterday, but didn't have it in my head and am on my phone. Hard to check.

The closure function... I see. So I'm guessing there you have to put in all your own modules, and the point of the closure is to suck up all the modules from the system that are additionally required. If your own project has a lot of hierarchical dependencies I agree it could be frustrating to figure them out manually. Weird that closure works like that.
@abcdw @charliemac

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.1 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login