Re: Porting to mips64el

2013-02-19 Thread Nikita Karetnikov
>> What do you mean by "host code"?

> I mean code that runs in your ‘guix-build’ process, as opposed to
> builder code running in the chroot (search the manual for “strata”.)

I've read the manual.  But it's still not clear.

For example: How can I tell which expression is run by a Guile process
launched by the daemon?

Build succeeded; I'm attaching the patch.  (Andreas, could you test it?)
Is it OK to push?

From 92f945333f8fa31c855e75ea59d274d457656cfe Mon Sep 17 00:00:00 2001
From: Nikita Karetnikov 
Date: Tue, 19 Feb 2013 09:37:11 +
Subject: [PATCH] gnu: Set 'ARCH' to 'mips'.

* gnu/packages/linux.scm (system->linux-architecture): New procedure.
  (linux-libre-headers): Adjust accordingly.
---
 gnu/packages/linux.scm | 22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 58cddc0..e88c6ae 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -31,18 +31,22 @@
   #:use-module (guix download)
   #:use-module (guix build-system gnu))
 
+(define (system->linux-architecture arch)
+  (let ((arch (car (string-split arch #\-
+(cond ((string=? arch "i686") "i386")
+  ((string-prefix? "mips" arch) "mips")
+  (else arch
+
 (define-public linux-libre-headers
   (let* ((version* "3.3.8")
  (build-phase
-  '(lambda* (#:key system #:allow-other-keys)
- (let ((arch (car (string-split system #\-
-   (setenv "ARCH"
-   (cond ((string=? arch "i686") "i386")
- (else arch)))
-   (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
+  (lambda (arch)
+`(lambda _
+   (setenv "ARCH" ,(system->linux-architecture arch))
+   (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
 
- (and (zero? (system* "make" "defconfig"))
-  (zero? (system* "make" "mrproper" "headers_check")
+   (and (zero? (system* "make" "defconfig"))
+(zero? (system* "make" "mrproper" "headers_check"))
  (install-phase
   `(lambda* (#:key outputs #:allow-other-keys)
  (let ((out (assoc-ref outputs "out")))
@@ -73,7 +77,7 @@
   (guix build utils)
   (srfi srfi-1))
#:phases (alist-replace
- 'build ,build-phase
+ 'build ,(build-phase (%current-system))
  (alist-replace
   'install ,install-phase
   (alist-delete 'configure %standard-phases)))
-- 
1.8.0.2



pgpKhbakLr0_A.pgp
Description: PGP signature


Re: Porting to mips64el

2013-02-19 Thread Ludovic Courtès
Nikita Karetnikov  skribis:

>>> What do you mean by "host code"?
>
>> I mean code that runs in your ‘guix-build’ process, as opposed to
>> builder code running in the chroot (search the manual for “strata”.)
>
> I've read the manual.  But it's still not clear.
>
> For example: How can I tell which expression is run by a Guile process
> launched by the daemon?

Basically, anything that ends up as part of the expression passed to
‘build-expression->derivation’ runs in the builder.  In practice, most
of the arguments to ‘gnu-build-system’ are in this category.

I guess I (or anyone else who feels confident) should write doc for
‘gnu-build-system’, and that would help clarify things.

> Build succeeded; I'm attaching the patch.  (Andreas, could you test it?)
> Is it OK to push?

Looks good to me, feel free to push to the ‘mips64el’ branch.

Thanks!

Ludo’.



Re: Porting to mips64el

2013-02-19 Thread Nikita Karetnikov
> Nixos on my machine uses the abi n32 (long and void* have 32 bits, long long
> 64). I would like to switch to abi 64 (long with 64 bits); we might be the
> first distribution supporting this mode.

I think that the above contradicts the following.

> In the debian distribution also installed on the machine,
> there is a separate lib64 directory, and it is enough to pass the flag "-mabi=
> 64" to gcc.

Is it supported in Debian?

Also, what about compatibility?  Are there any downsides?

"But an ABI can be chosen explicitly to make GMP compatible with other
libraries, or particular application requirements." [1]

I'll give it a try if you provide detailed instructions.

[1] http://gmplib.org/manual/ABI-and-ISA.html


pgpsFAh9VqpWq.pgp
Description: PGP signature


Re: mips64el: guild problem

2013-02-19 Thread Andreas Enge
Am Montag, 18. Februar 2013 schrieb Ludovic Courtès:
> This “GOOF” cookie indicates the Guile Object Object(!) Format.  Here,
> it says little endian with 8-byte pointers.  That corresponds to this
> GNU triplet:
> However, my guess is that Guile was compiled with the N32 ABI, so it
> expects 4-byte words.  But Guile’s system/base/target.scm makes this
> wrong assumption that “mips64” means 8-byte pointers:

That sounds like the good diagnostic. Should guile not explicitly test the 
size of the types, using the C sizeof or equivalent? From the triplet, one 
cannot deduce the ABI.

> For now, you can work around it by removing the --target argument from
> Makefile.am.
> 
> Can you confirm?

Compiling worked so far. Now there is the hash mismatch in 
http://alpha.gnu.org/gnu/guix/bootstrap/mips64el-
linux/20130105/guile-2.0.7.tar.xz . Nikita, could you push your 
modification with the correct hash, or should I make the suitable 
modifications on my side?

Andreas


Re: mips64el: guild problem

2013-02-19 Thread Nikita Karetnikov
> Compiling worked so far. Now there is the hash mismatch in 
> http://alpha.gnu.org
> /gnu/guix/bootstrap/mips64el-linux/20130105/guile-2.0.7.tar.xz . Nikita, could
> you push your modification with the correct hash, or should I make the 
> suitable
> modifications on my side?

 You should adjust 'build-aux/download.scm' [1]:

(define %url-base
  ;; "http://alpha.gnu.org/gnu/guix/bootstrap";

  ;; Alternately:
  "http://www.fdn.fr/~lcourtes/software/guix/packages";
  )

[1] https://lists.gnu.org/archive/html/bug-guix/2013-02/msg00102.html


pgpf3MSzppLxL.pgp
Description: PGP signature


Re: mips64el: guild problem

2013-02-19 Thread Ludovic Courtès
Andreas Enge  skribis:

> Am Montag, 18. Februar 2013 schrieb Ludovic Courtès:
>> This “GOOF” cookie indicates the Guile Object Object(!) Format.  Here,
>> it says little endian with 8-byte pointers.  That corresponds to this
>> GNU triplet:
>> However, my guess is that Guile was compiled with the N32 ABI, so it
>> expects 4-byte words.  But Guile’s system/base/target.scm makes this
>> wrong assumption that “mips64” means 8-byte pointers:
>
> That sounds like the good diagnostic. Should guile not explicitly test the 
> size of the types, using the C sizeof or equivalent? From the triplet, one 
> cannot deduce the ABI.

Right, unless using triplet extensions as done on ARM and in Debian,
 (I think it’s the way to go.)

> Compiling worked so far. Now there is the hash mismatch in 
> http://alpha.gnu.org/gnu/guix/bootstrap/mips64el-
> linux/20130105/guile-2.0.7.tar.xz .

It’s just that build-aux/download.scm got a 404 while trying to download
it, because it’s not on gnu.org.

Until it’s on gnu.org, the fix is to manually download it from
.

Thanks,
Ludo’.



Re: Porting to mips64el

2013-02-19 Thread Andreas Enge
Am Dienstag, 19. Februar 2013 schrieb Nikita Karetnikov:
> > Nixos on my machine uses the abi n32 (long and void* have 32 bits,
> > long long 64). I would like to switch to abi 64 (long with 64 bits);
> > we might be the first distribution supporting this mode.
> 
> I think that the above contradicts the following.
> 
> > In the debian distribution also installed on the machine,
> > there is a separate lib64 directory, and it is enough to pass the flag
> > "-mabi= 64" to gcc.
> 
> Is it supported in Debian?

Yes, you can compile programs in 64 bit mode. But if you do nothing 
special, they end up being 32 bits. And all packages (except for a few gcc 
libraries and zlib) are 32 bits. My suggestion is to have the full 
distribution in 64 bit abi.

> Also, what about compatibility?  Are there any downsides?

Libraries compiled with one abi are incompatible with libraries compiled 
with another abi. But that would not matter since our system would be 
consistent. Pointers take more space.

> I'll give it a try if you provide detailed instructions.

Good question, I do not know myself yet how to achieve the goal! Maybe it 
would be enough to provide "CFLAGS=-mabi64" in the bootstrap process; or 
'CFLAGS="-march=mips64 -mabi64"'. Or maybe we need to create new bootstrap 
binaries with these flags.

Andreas


Re: A logo

2013-02-19 Thread Nikita Karetnikov
> So, let’s leave a few days for comments, and then dub it the Official
> Logo.

I'm attaching a tarball.  Note that Document Metadata
(File -> Document Metadata in Inkscape) says that the logo is under a
proprietary license (I guess it's a bug because I can't save the
license), but it's not true.

Permission is granted to copy, distribute and/or modify this work
under the terms of:

* the GNU General Public License as published by the Free Software
  Foundation; either version 3 of the License, or (at your option) any
  later version.  A copy of the license is included in the file
  'COPYING.GPL';

* or the GNU Free Documentation License, Version 1.3 or any later version
  published by the Free Software Foundation; with no Invariant Sections,
  no Front-Cover Texts and no Back-Cover Texts.  A copy of the license
  is included in the file 'COPYING.FDL'.



guix-logo.tar.xz
Description: archive/tar


pgpc8tFF6a7m0.pgp
Description: PGP signature


Re: A logo

2013-02-19 Thread Andreas Enge
Very nice!

Andreas



Re: Porting to mips64el

2013-02-19 Thread Ludovic Courtès
FWIW, there’s a discussion of MIPS ABIs at
 and related
pages.

Andreas Enge  skribis:

> Good question, I do not know myself yet how to achieve the goal! Maybe it 
> would be enough to provide "CFLAGS=-mabi64" in the bootstrap process; or 
> 'CFLAGS="-march=mips64 -mabi64"'. Or maybe we need to create new bootstrap 
> binaries with these flags.

The bootstrap binaries don’t matter much, I think.  What does matter is
to get ‘gcc-boot0’ (a fake cross-compiler) to target the right ABI by
default.  I’m not sure how to do that, though.

Ludo’.



Re: Porting to mips64el

2013-02-19 Thread Andreas Enge
Am Dienstag, 19. Februar 2013 schrieb Ludovic Courtès:
> The bootstrap binaries don’t matter much, I think.  What does matter is
> to get ‘gcc-boot0’ (a fake cross-compiler) to target the right ABI by
> default.  I’m not sure how to do that, though.

I think it might be enough to add the following configure flags:
   --with-arch=mips64 -with-abi=64
I will give it a try.

Before downloading tarballs, the following frightening warning messages are 
shown:

@ build-started /nix/store/lpws7l6w3za1i8c0s4aij94jh8k9vk9p-module-import-
compiled.drv /nix/store/5yx0igcz2ng9wnik260gapxaqzsn3p6l-module-import-
compiled mips64el-linux 
/usr/local/guix/var/log/nix/drvs/lpws7l6w3za1i8c0s4aij94jh8k9vk9p-module-
import-compiled.drv.bz2
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:110:17: warning: possibly unbound variable 
`make-session'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:110:17: warning: possibly unbound variable 
`connection-end/client'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:111:4: warning: possibly unbound variable 
`set-session-transport-fd!'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:112:4: warning: possibly unbound variable 
`set-session-default-priority!'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:113:4: warning: possibly unbound variable 
`set-session-credentials!'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:113:38: warning: possibly unbound variable 
`make-certificate-credentials'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:119:4: warning: possibly unbound variable 
`handshake'
;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
import/guix/build/download.scm:120:4: warning: possibly unbound variable 
`session-record-port'
@ build-succeeded /nix/store/lpws7l6w3za1i8c0s4aij94jh8k9vk9p-module-
import-compiled.drv /nix/store/5yx0igcz2ng9wnik260gapxaqzsn3p6l-module-
import-compiled

After that things seem to proceed normally.

Andreas



Re: Porting to mips64el

2013-02-19 Thread Nikita Karetnikov
> I will give it a try.

Thanks.

> Before downloading tarballs, the following frightening warning messages are 
> shown:

'guix/build/download.scm':

;; Autoload GnuTLS so that this module can be used even when GnuTLS is
;; not available.  At compile time, this yields "possibly unbound
;; variable" warnings, but these are OK: we know that the variables will
;; be bound if we need them, because (guix download) adds GnuTLS as an
;; input in that case.


pgpUpq_TlPmvz.pgp
Description: PGP signature


Re: A logo

2013-02-19 Thread Ludovic Courtès
Nikita Karetnikov  skribis:

> I'm attaching a tarball.  Note that Document Metadata
> (File -> Document Metadata in Inkscape) says that the logo is under a
> proprietary license (I guess it's a bug because I can't save the
> license), but it's not true.

Nice, thanks!

I’ve put the logo on the web page:

  http://www.gnu.org/software/guix/
  http://www.gnu.org/software/guix/graphics/

It doesn’t blend well on the main page.  I guess a bit of CSS would help
(notably to leave more space around it), but I’m not sure how to do it,
nor how that would interact gnu.org’s original CSS.

Help welcome!  Note that if you have commit access to the source code
repo, you also have access to the web page repo (CVS), and you’re
welcome to use it.  See  for
details.

Thanks again, Nikita!

Ludo’.


pgp4PW6l9TCnr.pgp
Description: PGP signature


Re: Porting to mips64el

2013-02-19 Thread Ludovic Courtès
Andreas Enge  skribis:

> Am Dienstag, 19. Februar 2013 schrieb Ludovic Courtès:
>> The bootstrap binaries don’t matter much, I think.  What does matter is
>> to get ‘gcc-boot0’ (a fake cross-compiler) to target the right ABI by
>> default.  I’m not sure how to do that, though.
>
> I think it might be enough to add the following configure flags:
>--with-arch=mips64 -with-abi=64
> I will give it a try.

Oh right, it’s mentioned in the manual (info "(gccinstall) Configuration").

> Before downloading tarballs, the following frightening warning messages are 
> shown:
>
> @ build-started /nix/store/lpws7l6w3za1i8c0s4aij94jh8k9vk9p-module-import-
> compiled.drv /nix/store/5yx0igcz2ng9wnik260gapxaqzsn3p6l-module-import-
> compiled mips64el-linux 
> /usr/local/guix/var/log/nix/drvs/lpws7l6w3za1i8c0s4aij94jh8k9vk9p-module-
> import-compiled.drv.bz2
> ;;; /nix/store/7rz9j519bif6y62sh4wj3mij8jalpw5i-module-
> import/guix/build/download.scm:110:17: warning: possibly unbound variable 
> `make-session'

These relate to GnuTLS, and it’s normal, see
.
Basically (guix build download) can be dynamically linked against
GnuTLS, at run time, but it works fine without it too.

Thanks,
Ludo’.



Re: A logo

2013-02-19 Thread Cyril Roelandt

On 02/19/2013 10:22 PM, Ludovic Courtès wrote:

Nikita Karetnikov  skribis:


I'm attaching a tarball.  Note that Document Metadata
(File ->  Document Metadata in Inkscape) says that the logo is under a
proprietary license (I guess it's a bug because I can't save the
license), but it's not true.


Nice, thanks!

I’ve put the logo on the web page:

   http://www.gnu.org/software/guix/
   http://www.gnu.org/software/guix/graphics/

It doesn’t blend well on the main page.  I guess a bit of CSS would help
(notably to leave more space around it), but I’m not sure how to do it,
nor how that would interact gnu.org’s original CSS.



To leave some space around the logo, I'd write:



But my CSS is a bit rusty. Plus, purists would want that to be in the 
CSS file :)


Cyril.



Nix submodule updated

2013-02-19 Thread Ludovic Courtès
Hi,

Commit 15b673e updates the Nix sub-module.  Make sure the run
./bootstrap after pulling.

The main visible difference is that log files are now stored in
sub-directories:

  https://github.com/NixOS/nix/commit/536c85ea49c16a2ecd5a1ba169975b296cd6158c

Ludo’.



Re: A logo

2013-02-19 Thread Nikita Karetnikov
"A copy of the license is included in the file 'COPYING.GPL'; [...] A
copy of the license is included in the file 'COPYING.FDL'." [1]

I think these lines can be removed from the page.

> I guess a bit of CSS would help (notably to leave more space around it),
> but I’m not sure how to do it, nor how that would interact gnu.org’s
> original CSS.

Yep, the logo needs more space.  Also, will it be better to center it?

Can we ask the GNU webmasters?

[1] https://www.gnu.org/software/guix/graphics/


pgpYzZ3ecJMXI.pgp
Description: PGP signature


Re: A logo

2013-02-19 Thread Ludovic Courtès
Cyril Roelandt  skribis:

> To leave some space around the logo, I'd write:
>
> 

Oh, good.  I’ve tried something along these lines.

Ludo’.



Re: A logo

2013-02-19 Thread Ludovic Courtès
Nikita Karetnikov  skribis:

> "A copy of the license is included in the file 'COPYING.GPL'; [...] A
> copy of the license is included in the file 'COPYING.FDL'." [1]
>
> I think these lines can be removed from the page.

Oops, fixed now.

>> I guess a bit of CSS would help (notably to leave more space around it),
>> but I’m not sure how to do it, nor how that would interact gnu.org’s
>> original CSS.
>
> Yep, the logo needs more space.  Also, will it be better to center it?

I wouldn’t center it.  However, it may be nice to allow text to flow on
its right.

> Can we ask the GNU webmasters?

I think there’s one lurking here.  Jason?  :-)

Ludo’.



Re: Toward 0.2

2013-02-19 Thread Nikita Karetnikov
>  wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"

How can I get the output of a package?  There is 'package-outputs':

scheme@(guile-user)> ,use (gnu packages wget) (guix packages)
scheme@(guile-user)> (package-outputs wget)
$1 = ("out")

But how can I get the value (like in '#:phases')?

>   #!/bin/sh
>   export PATH="/nix/store/...-gawk/bin:$PATH"
>   exec ./.guile-snarf-real "$@"

Should it be saved as 'guile-snarf'?  And I have to use rename(2),
right?

What should I use to handle prefixes (e.g., a keyword, a simple
argument)?  Should they be case insensitive?


pgpHbveR3k30j.pgp
Description: PGP signature


Problem with texinfo 5.0 package

2013-02-19 Thread Mark H Weaver
Hi Ludovic,

Regarding commit a24b75d8e1753da629ecf945f4022eee4c340aed:

The built texinfo 5.0 packages contain a few uses of 'perl' that are not
pointing to a specific version in /nix/store:

./bin/pod2texi:1:#!/nix/store/777jas1fcgc38hmvq6lq1sa9k67f10kl-coreutils-8.20/bin/env
 perl
./bin/texi2dvi:1437:  perl -pe 's<\\documentclass(?:\[.*\])?{.*}>
./bin/texi2dvi:1544:  perl -pi -e 's/[ \t]+$//g' "$out_base"*;;
./bin/texi2any:1:#!/nix/store/777jas1fcgc38hmvq6lq1sa9k67f10kl-coreutils-8.20/bin/env
 perl 

Regards,
  Mark