guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 02/11] gnu: cross-build: i686-w64-mingw32: new cross target.


From: Andy Wingo
Subject: Re: [PATCH 02/11] gnu: cross-build: i686-w64-mingw32: new cross target.
Date: Tue, 17 May 2016 09:43:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Sat 14 May 2016 22:27, Jan Nieuwenhuizen <address@hidden> writes:

> Andy Wingo writes:
>
> Something I wanted to ask and I guess now why don't we let functions
> like pair?, null?, string-prefix? not return the thing itself?

So many possible answers, none of them great ;) For example, why have #t
as a value at all -- I don't know :)

But more directly: pair? only returns a boolean because the standard
convention is that a function with a ? on the end returns a boolean.  A
counter example is `assoc': it returns a pair or #f, and has no trailing
`?'.

As to why have predicates -- well the idea is that a predicate doesn't
do lookup and doesnt' retrieve a value, it just partitions its domain.
You don't need to return the value because you already have the value --
you passed it as the argument.  Also consider boolean? -- what should
(boolean? #f) return?  Anyway that's how predicates are understood by
most other Scheme programmers.

> diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
>  (define* (cross-gcc target
>                      #:optional (xbinutils (cross-binutils target)) libc)
>    "Return a cross-compiler for TARGET, where TARGET is a GNU triplet.  Use
> @@ -223,7 +309,10 @@ GCC that does not target a libc; otherwise, target that 
> libc."
>                 (append
>                  (origin-patches (package-source %xgcc))
>                  (cons (search-patch "gcc-cross-environment-variables.patch")
> -                      (cross-gcc-patches target))))))
> +                      (cross-gcc-patches target))))
> +              (modules '((guix build utils)))
> +              (snippet
> +               (cross-gcc-snippet target))))
>  
>      ;; For simplicity, use a single output.  Otherwise libgcc_s & co. are not
>      ;; found by default, etc.
> @@ -245,6 +334,7 @@ GCC that does not target a libc; otherwise, target that 
> libc."
>                               #:target target
>                               #:binutils xbinutils))
>         ("binutils-cross" ,xbinutils)
> +       ("gcc" ,gcc)
>  
>         ;; Call it differently so that the builder can check whether the 
> "libc"
>         ;; input is #f.

Why did you add GCC here?  Why was it not needed before?

Other than this nit, LGTM.

Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]