diff mbox series

[bug#36477,v3,30/48] packages: Set outputs field as thunked.

Message ID 20190902153333.11190-31-m.othacehe@gmail.com
State Accepted
Headers show
Series Add --target support to guix system | expand

Commit Message

Mathieu Othacehe Sept. 2, 2019, 3:33 p.m. UTC
This allows for instance to use %current-target-system to enable/disable some
outputs in a package.

* guix/packages.scm (<package>): Set outputs field as thunked,
(package->bag): adapt make-bag call accordingly.
---
 guix/packages.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ludovic Courtès Sept. 4, 2019, 12:48 p.m. UTC | #1
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> This allows for instance to use %current-target-system to enable/disable some
> outputs in a package.
>
> * guix/packages.scm (<package>): Set outputs field as thunked,
> (package->bag): adapt make-bag call accordingly.

For which package did you have a needed for that?

Thunked fields add some overhead (CPU and memory), so I’d rather avoid
it until we have a strong need.

Thanks,
Ludo’.
Mathieu Othacehe Sept. 4, 2019, 4:01 p.m. UTC | #2
Hey Ludo,

Thanks for you reviews :).

> For which package did you have a needed for that?

That's for libnl which has python2 and python3 outputs for python
extensions. However, we do not currently support cross compilation of
python extensions.

Adding cross compilation of Python extension would be the right thing to
do but it's really hard. Nix is also struggling on that, see:
https://github.com/NixOS/nixpkgs/issues/53320.

So I don't have anything better to propose. WDYT?

Thanks,

Mathieu
Ludovic Courtès Sept. 5, 2019, 8:41 a.m. UTC | #3
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

>> For which package did you have a needed for that?
>
> That's for libnl which has python2 and python3 outputs for python
> extensions. However, we do not currently support cross compilation of
> python extensions.
>
> Adding cross compilation of Python extension would be the right thing to
> do but it's really hard. Nix is also struggling on that, see:
> https://github.com/NixOS/nixpkgs/issues/53320.
>
> So I don't have anything better to propose. WDYT?

In (gnu packages …) there are no users of the “python2” and “python3”
outputs of libnl.  What about making separate ‘libnl-python’ packages?
Marius, WDYT?

Ludo’.
diff mbox series

Patch

diff --git a/guix/packages.scm b/guix/packages.scm
index ac965acd2f..6889dbf116 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -266,7 +266,7 @@  name of its URI."
                  (default '()) (thunked))
 
   (outputs package-outputs                ; list of strings
-           (default '("out")))
+           (default '("out")) (thunked))
 
                                                   ; lists of
                                                   ; <search-path-specification>,
@@ -1046,7 +1046,7 @@  and return it."
                              #:source source
                              #:inputs (append (inputs self)
                                               (propagated-inputs self))
-                             #:outputs outputs
+                             #:outputs (outputs self)
                              #:native-inputs (native-inputs self)
                              #:arguments (args self))
                    (raise (if target