From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] distro: Add util-linux. Date: Sun, 02 Dec 2012 23:56:56 +0100 Message-ID: <87r4n8jc5j.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:46938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfIT7-0001SQ-JT for bug-guix@gnu.org; Sun, 02 Dec 2012 17:57:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfIT5-00079O-UI for bug-guix@gnu.org; Sun, 02 Dec 2012 17:57:01 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:55153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfIT5-00079J-JT for bug-guix@gnu.org; Sun, 02 Dec 2012 17:56:59 -0500 In-Reply-To: (Nikita Karetnikov's message of "Sun, 2 Dec 2012 07:43:45 +0300") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Nikita, Nikita Karetnikov skribis: > There are some issues: > > 1. './pre-inst-env guix-build -K util-linux' raises the following > warning: > > kdupexe: warning: no binary for interpreter `@PERL@' found in $PATH A bug in util-linux=E2=80=99s build system. I worked around it like this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/distro/packages/util-linux.scm b/distro/packages/util-linux.scm index ad6b03b..bc91839 100644 --- a/distro/packages/util-linux.scm +++ b/distro/packages/util-linux.scm @@ -19,6 +19,7 @@ (define-module (distro packages util-linux) #:use-module (distro packages compression) #:use-module (distro packages ncurses) + #:use-module (distro packages perl) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu)) @@ -37,9 +38,19 @@ (base32 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir")))) (build-system gnu-build-system) - (arguments `(#:configure-flags '("--disable-use-tty-group"))) + (arguments + `(#:configure-flags '("--disable-use-tty-group") + #:phases (alist-cons-after + 'install 'patch-chkdupexe + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/bin/chkdupexe") + ;; Allow `patch-shebang' to do its work. + (("@PERL@") "/bin/perl")))) + %standard-phases))) (inputs `(("zlib" ,zlib) - ("ncurses" ,ncurses))) + ("ncurses" ,ncurses) + ("perl" ,perl))) (home-page "https://www.kernel.org/pub/linux/utils/util-linux/") (synopsis "util-linux is a random collection of utilities for the Linux kernel") --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The #:phases thing inserts a phase right after the =E2=80=9Cmake install=E2= =80=9D phase. That new phase modifies the installed =E2=80=98chkdupexe=E2=80=99 to replac= e @PERL@ by /bin/perl. The =E2=80=98patch-shebang=E2=80=99 phase happens just after, a= nd it automatically replaces /bin/perl by /nix/store/...-perl/bin/perl. Could you send an updated patch with this fix, and which adds util-linux to =E2=80=98linux.scm=E2=80=99 instead? The idea is to have all Linux-rela= ted tools in there. > 2. I'm not sure that this formatting > > (uri (string-append "mirror://kernel.org/linux/utils/" > name "/v" version "/" > name "-" version ".2" ".tar.xz")) > > is valid for the following mirrors: > > (kernel.org > "http://www.all.kernel.org/pub/" > "http://ramses.wh2.tu-dresden.de/pub/mirrors/kernel.org/" > "http://linux-kernel.uio.no/pub/" > "http://kernel.osuosl.org/pub/" > "ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/") > > As far as I can tell, it only works for kernel.org. How to check this? The =E2=80=98mirror://kernel.org/=E2=80=99 prefix expands to the above mirr= or URLs. See =E2=80=98url-fetch=E2=80=99 in (guix build download) for details. > 3. 'util-linux' uses a lot of licenses. According to > 'README.licensing', it uses GPLv3+, GPLv2+, GPLv2, LGPLv2+, BSD with > advertising, and Public Domain. GPLv2+ is the default license for code > without an explicitly defined license. > > I've found a file that uses the Expat license > (i.e. 'util-linux-2.21.2/config/install-sh') and some files with > suspicious licenses. =E2=80=98install-sh=E2=80=99 comes from Automake. > Examples: > > 'util-linux-2.21.2/disk-utils/mkfs.bfs.8': > > .\" Copyright 1999 Andries E. Brouwer (aeb@cwi.nl) > .\" May be freely distributed. > > What does "free" mean in this context? > > 'util-linux-2.21.2/disk-utils/mkfs.minix.c': > > * (C) 1991 Linus Torvalds. This file may be redistributed as per > * the Linux copyright. > > And what does the above mean? I think it means that these people had no clue but that they intended to make it GPLv2. Another funny one is =E2=80=98chkdupexe=E2=80=99: # Copyright 1993 Nicolai Langfeldt. janl@math.uio.no # Distribute under gnu copyleft (included in perl package)=20 > These examples show that we can't rely on 'README.licensing'. I guess > that we can use regexps to match against the licenses that are listed > in 'README.licensing' and check the rest manually. > > What would you use? For this kind of questions, I=E2=80=99d first check the list at , and then ask for advice on the gnu-linux-libre list (see ), which is where people knowledgeable in this area are. Now, my guess is that util-linux is OK, just hacked up with lack of rigor. ;-) > 4. It's necessary to do the following to force Guix to rebuild a > package: > > nix-store --delete /nix/store/*-util-linux-2.21.tar.xz > nix-store --delete /nix/store/*-util-linux-2.21 > ./pre-inst-env guix-build -K util-linux > > Is this a bug? No, it=E2=80=99s a feature! :-) Nix and Guix work on the assumption that builds are deterministic. This allows them to cache successful build results (and even build failures, but this is not enabled by default.) In fact, in the example above, you can build util-linux as many times as you want, and you=E2=80=99ll most likely always get the same result, bit-by= -bit. In the event where a build process is non-deterministic, deleting the results as shown above will allow you to restart the build, and maybe notice that you get a different result. That is rare enough in practice, and usually a sign of a bug in the package=E2=80=99s build system. Thanks, Ludo=E2=80=99. --=-=-=--