bug-guix
[Top][All Lists]
Advanced

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

Re: 'python-build-system'


From: Ludovic Courtès
Subject: Re: 'python-build-system'
Date: Sun, 28 Apr 2013 22:52:40 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.3 (gnu/linux)

Nikita Karetnikov <address@hidden> skribis:

> 'bazaar.scm' is for testing.  The following warnings appear during the
> installation:
>
> GNU gettext msgfmt utility not found!

Just add gettext as an input.

> patch-shebang: ./tools/packaging/lp-upload-release: warning: no binary for 
> interpreter `zsh' found in $PATH
>
> patch-shebang: ./tools/weavemerge.sh: warning: no binary for interpreter 
> `zsh' found in $PATH
>
> Can we replace 'zsh' with 'bash'?  I guess there may be some
> compatibility problems.

Yes, definitely.  But that’s not a problem: these scripts are most
likely unused during the build process and afterward.

> Also, I should mention that I don't understand some parts of the build
> system.  I'm not sure how to check them.  Is there a Scheme level
> 'strace'-like tool?  If not, I'll send more specific questions later.

Well, there’s ‘pk’ and ‘format’, to add debugging statements here and
there.  There’s also the debugger.

> From aa73cd5d8e5e48d24460c9d6bcebfc92b3311d4c Mon Sep 17 00:00:00 2001
> From: Nikita Karetnikov <address@hidden>
> Date: Sun, 28 Apr 2013 16:08:23 +0000
> Subject: [PATCH] utils: Adjust 'wrap-program'.
>
> * guix/build/utils.scm (wrap-program): Assume that 'prog' is an
>   absolute filename.  Adjust 'prog-real' and 'prog-tmp' accordingly.
>   Also, change 'prog-tmp' to honor command line arguments.

What was wrong with the previous approach?  I don’t like the “assume
it’s an absolute file name” bit, because we don’t know whether the
assumption holds.

>  guix/build/utils.scm |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/guix/build/utils.scm b/guix/build/utils.scm
> index 356dd46..fe6978b 100644
> --- a/guix/build/utils.scm
> +++ b/guix/build/utils.scm
> @@ -680,8 +680,8 @@ contents:
>  This is useful for scripts that expect particular programs to be in $PATH, 
> for
>  programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, 
> or
>  modules in $GUILE_LOAD_PATH, etc."
> -  (let ((prog-real (string-append "." prog "-real"))
> -        (prog-tmp  (string-append "." prog "-tmp")))
> +  (let ((prog-real (string-append (dirname prog) "/." (basename prog) 
> "-real"))
> +        (prog-tmp  (string-append (dirname prog) "/." (basename prog) 
> "-tmp")))
>      (define (export-variable lst)
>        ;; Return a string that exports an environment variable.
>        (match lst
> @@ -709,11 +709,11 @@ modules in $GUILE_LOAD_PATH, etc."
>      (with-output-to-file prog-tmp
>        (lambda ()
>          (format #t
> -                "#!~a~%~a~%exec ~a~%"
> +                "#!~a~%~a~%exec ~a address@hidden"

Oops, indeed.  You need double quotes around address@hidden

>                  (which "bash")
>                  (string-join (map export-variable vars)
>                               "\n")
> -                (canonicalize-path prog-real))))
> +                prog-real)))
>  
>      (chmod prog-tmp #o755)
>      (rename-file prog-tmp prog)))
> +  (define builder
> +    `(begin
> +       (use-modules ,@modules)
> +       (python-build #:name ,name
> +                     #:source ,(if (and source (derivation-path? source))
> +                                   (derivation-path->output-path source)
> +                                   source)
> +                     #:configure-flags ,configure-flags
> +                     #:system ,system
> +                     #:test-target "test"
> +                     #:tests? ,tests?
> +                     #:outputs %outputs
> +                     #:python-version ,python-version
> +                     #:search-paths ',(map search-path-specification->sexp
> +                                           (append search-paths
> +                                                   (standard-search-paths)))

You also need to keep (package-native-search-paths python).  See commit
35ac56b6, which fixed that for Perl & co.

Otherwise looks good.

Thanks!

Ludo’.



reply via email to

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