unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Treating patches as part of ‘origin’
@ 2013-09-15 21:05 Ludovic Courtès
  2013-09-15 23:05 ` Alex Sassmannshausen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-09-15 21:05 UTC (permalink / raw)
  To: guix-devel

Hello!

We had an interesting discussion on the gnu-linux-libre list [0], where
we identified an issue wrt. honoring the free system distribution
guidelines (FSDG).

The problem boils down to the fact that ‘guix build --source’ returns
the unmodified upstream tarball.  This is a problem because that may not
correspond to what we’re effectively building, when there are patches;
also, we may be delivering non-FSDG-compliant software source to the user.

To address that, I think we should move patch handling from the build
system to the ‘origin’ objects.  That is, we would write:

  (package
    ...
    (source (origin
              (uri ...)
              (sha256 ...)      ; hash of the upstream tarball
              (patches (map search-path (list "foo.patch" ...)))))
    ...)

As a bonus, this would make patches work regardless of the package’s
build system; we would get rid get rid of the #:patches arguments to
‘gnu-build-system’.

I think the effect of having a non-null ‘patches’ list should be to
fetch the upstream tarball, apply the patches, and re-pack the tarball.
That way, patching would be completely transparent to build systems
(they would always get a tarball, regardless of whether it has been
patched) and to the user (‘guix build --source’ would always return a
tarball.)  The only downside is the CPU cost of re-making the tarball,
which could be annoying when working on a package, but I think it’s
reasonably low for most packages.

From an FSDG perspective, that means that we should do things like
removing non-free software (as in netpbm) and software that does not
comply (like TeX Live’s ‘getnonfreefonts’) preferably in the form of a
patch, rather than as a ‘substitute*’ statement or similar.

What do people think?

I’ll go ahead and implement that in ‘core-updates’ if there are no
objections.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-09-15 21:05 Treating patches as part of ‘origin’ Ludovic Courtès
@ 2013-09-15 23:05 ` Alex Sassmannshausen
  2013-09-16 10:31   ` Ludovic Courtès
  2013-09-18  7:35 ` Andreas Enge
  2013-10-08 22:18 ` Ludovic Courtès
  2 siblings, 1 reply; 8+ messages in thread
From: Alex Sassmannshausen @ 2013-09-15 23:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi,

>>>>> Ludovic Courtès <ludo@gnu.org> writes:

    > What do people think?

For what it's worth, I think it sounds like an elegant solution to the
problem outlined.

The 'bonus' sounds valuable to me too, simplifying the implementation of
new build systems. 

    > I’ll go ahead and implement that in ‘core-updates’ if there are no
    > objections.

Presumably this would mean retrospectively fixing all current packages?

Best wishes,

Alex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-09-15 23:05 ` Alex Sassmannshausen
@ 2013-09-16 10:31   ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-09-16 10:31 UTC (permalink / raw)
  To: Alex Sassmannshausen; +Cc: guix-devel

Alex Sassmannshausen <alex.sassmannshausen@gmail.com> skribis:

>     > I’ll go ahead and implement that in ‘core-updates’ if there are no
>     > objections.
>
> Presumably this would mean retrospectively fixing all current packages?

Yes, but that’s a mechanic change: moving the list of patches from the
#:patches option and the ‘inputs’ field to the ‘patches’ field.

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-09-15 21:05 Treating patches as part of ‘origin’ Ludovic Courtès
  2013-09-15 23:05 ` Alex Sassmannshausen
@ 2013-09-18  7:35 ` Andreas Enge
  2013-09-18 21:36   ` Ludovic Courtès
  2013-10-08 22:18 ` Ludovic Courtès
  2 siblings, 1 reply; 8+ messages in thread
From: Andreas Enge @ 2013-09-18  7:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

On Sun, Sep 15, 2013 at 11:05:25PM +0200, Ludovic Courtès wrote:
> comply (like TeX Live’s ‘getnonfreefonts’)

Just as a comment, this is, as far as I can tell, not contained in the
regular texlive distribution. I cannot locate it on my system.

Andreas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-09-18  7:35 ` Andreas Enge
@ 2013-09-18 21:36   ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-09-18 21:36 UTC (permalink / raw)
  To: Andreas Enge; +Cc: guix-devel

Andreas Enge <andreas@enge.fr> skribis:

> On Sun, Sep 15, 2013 at 11:05:25PM +0200, Ludovic Courtès wrote:
>> comply (like TeX Live’s ‘getnonfreefonts’)
>
> Just as a comment, this is, as far as I can tell, not contained in the
> regular texlive distribution. I cannot locate it on my system.

It used to be the case, but presumably things have changed.  That was
just to illustrate the problem.

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-09-15 21:05 Treating patches as part of ‘origin’ Ludovic Courtès
  2013-09-15 23:05 ` Alex Sassmannshausen
  2013-09-18  7:35 ` Andreas Enge
@ 2013-10-08 22:18 ` Ludovic Courtès
  2013-10-09 21:39   ` Ludovic Courtès
  2013-10-10 21:19   ` Ludovic Courtès
  2 siblings, 2 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-10-08 22:18 UTC (permalink / raw)
  To: guix-devel

ludo@gnu.org (Ludovic Courtès) skribis:

> To address that, I think we should move patch handling from the build
> system to the ‘origin’ objects.  That is, we would write:
>
>   (package
>     ...
>     (source (origin
>               (uri ...)
>               (sha256 ...)      ; hash of the upstream tarball
>               (patches (map search-path (list "foo.patch" ...)))))
>     ...)
>
> As a bonus, this would make patches work regardless of the package’s
> build system; we would get rid get rid of the #:patches arguments to
> ‘gnu-build-system’.
>
> I think the effect of having a non-null ‘patches’ list should be to
> fetch the upstream tarball, apply the patches, and re-pack the tarball.
> That way, patching would be completely transparent to build systems
> (they would always get a tarball, regardless of whether it has been
> patched) and to the user (‘guix build --source’ would always return a
> tarball.)  The only downside is the CPU cost of re-making the tarball,
> which could be annoying when working on a package, but I think it’s
> reasonably low for most packages.

Done in commits ac10e0e and 01eafd3.  The latter triggers a number of
rebuilds, which is unfortunate given that Hydra is currently down for
maintenance/upgrade.  The former changes the Scheme ABI, so make sure to
run ‘make clean && make’!

So the official way to introduce patches is now the form shown above.

There’s still work in that area: in ‘core-updates’, I’ll remove the
‘patch’ phase and #:patches argument from ‘gnu-build-system’ & co., and
update the core packages that still use #:patches.

Comments & bug reports welcome!

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-10-08 22:18 ` Ludovic Courtès
@ 2013-10-09 21:39   ` Ludovic Courtès
  2013-10-10 21:19   ` Ludovic Courtès
  1 sibling, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-10-09 21:39 UTC (permalink / raw)
  To: guix-devel

As a bonus, we can now easily show the patches of each package on
<http://www.gnu.org/software/guix/package-list.html> (commit d4f1ce4).
(Go for instance to ‘guile-static-stripped-tarball’ and click on “Expand”.)

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Treating patches as part of ‘origin’
  2013-10-08 22:18 ` Ludovic Courtès
  2013-10-09 21:39   ` Ludovic Courtès
@ 2013-10-10 21:19   ` Ludovic Courtès
  1 sibling, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2013-10-10 21:19 UTC (permalink / raw)
  To: guix-devel

ludo@gnu.org (Ludovic Courtès) skribis:

> There’s still work in that area: in ‘core-updates’, I’ll remove the
> ‘patch’ phase and #:patches argument from ‘gnu-build-system’ & co., and
> update the core packages that still use #:patches.

I’ve reopened the ‘core-updates’ branch and made those changes, so
#:patches is no more!

Ludo’.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-10 21:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15 21:05 Treating patches as part of ‘origin’ Ludovic Courtès
2013-09-15 23:05 ` Alex Sassmannshausen
2013-09-16 10:31   ` Ludovic Courtès
2013-09-18  7:35 ` Andreas Enge
2013-09-18 21:36   ` Ludovic Courtès
2013-10-08 22:18 ` Ludovic Courtès
2013-10-09 21:39   ` Ludovic Courtès
2013-10-10 21:19   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).