guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 01/13] build-system: Add asdf-build-system.


From: 宋文武
Subject: Re: [PATCH v2 01/13] build-system: Add asdf-build-system.
Date: Wed, 05 Oct 2016 12:55:51 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi!  I have spent more time wondering on this patch and ASDF, so here
are some questions, opinions and ideas (roughly).

Andy Patterson <address@hidden> writes:

> * guix/build-system/asdf.scm: New file.
> * guix/build/asdf-build-system.scm: New file.
> * guix/build/lisp-utils.scm: New file.
> * Makefile.am: Add them.

Should be: Makefile.am (MODULES): Add them.

> * doc/guix.texi: Add section on 'asdf-build-system/source'.

Well, it dosen't create a new info section, I think this can be:

* doc/guix.texi (Build Systems): Document 'asdf-build-system'.

> ---
>  Makefile.am                      |   3 +
>  doc/guix.texi                    |  60 ++++++
>  guix/build-system/asdf.scm       | 385 +++++++++++++++++++++++++++++++++++++
>  guix/build/asdf-build-system.scm | 400 
> +++++++++++++++++++++++++++++++++++++++
>  guix/build/lisp-utils.scm        | 240 +++++++++++++++++++++++
>  5 files changed, 1088 insertions(+)
>  create mode 100644 guix/build-system/asdf.scm
>  create mode 100644 guix/build/asdf-build-system.scm
>  create mode 100644 guix/build/lisp-utils.scm
>
> diff --git a/Makefile.am b/Makefile.am
> index 43a33c8..a23e5fd 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -63,6 +63,7 @@ MODULES =                                   \
>    guix/build-system/ant.scm                  \
>    guix/build-system/cmake.scm                        \
>    guix/build-system/emacs.scm                        \
> +  guix/build-system/asdf.scm                 \
>    guix/build-system/glib-or-gtk.scm          \
>    guix/build-system/gnu.scm                  \
>    guix/build-system/haskell.scm                      \
> @@ -84,6 +85,7 @@ MODULES =                                   \
>    guix/build/download.scm                    \
>    guix/build/cmake-build-system.scm          \
>    guix/build/emacs-build-system.scm          \
> +  guix/build/asdf-build-system.scm           \
>    guix/build/git.scm                         \
>    guix/build/hg.scm                          \
>    guix/build/glib-or-gtk-build-system.scm    \
> @@ -106,6 +108,7 @@ MODULES =                                 \
>    guix/build/syscalls.scm                       \
>    guix/build/gremlin.scm                     \
>    guix/build/emacs-utils.scm                 \
> +  guix/build/lisp-utils.scm                  \
>    guix/build/graft.scm                               \
>    guix/build/bournish.scm                    \
>    guix/build/qt-utils.scm                    \
> diff --git a/doc/guix.texi b/doc/guix.texi
> index f5bbb92..53db367 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -2965,6 +2965,66 @@ that should be run during the @code{build} phase.  By 
> default the
>
>  @end defvr
>
> address@hidden {Scheme Variable} asdf-build-system/source
> address@hidden {Scheme Variable} asdf-build-system/sbcl
> address@hidden {Scheme Variable} asdf-build-system/ecl
> +
> +These variables, exported by @code{(guix build-system sbcl)}, implement

Typo, sbcl -> asdf.

> +build procedures for Common Lisp packages using the
> address@hidden://common-lisp.net/project/asdf/, ``ASDF''} system.

How about expand it a bit to: @url{..., ``ASDF''}, a system definition
facility for Common Lisp programs and libraries.

> +
> +The @code{asdf-build-system/source} system installs the packages in
> +source form, and can be loaded using any common lisp implementation, via
> +ASDF.  The others, such as @code{asdf-build-system/sbcl}, install binary
> +systems in the format which a particular implementation understands.
> +These build systems can also be used to produce executable programs, or
> +lisp images which contain a set of packages pre-loaded.
> +
> +The build system uses conventions to determine the roles of inputs in
> +the build system.

… uses naming conventions …  What’s the “roles of inputs” for?

> For binary packages, the package itself as well as
> +its dependencies should begin their name with the lisp implementation,
> +such as @code{sbcl-} for @code{asdf-build-system/sbcl}.  If dependencies
> +are used only for tests, it is convenient to use a different prefix in
> +order to avoid having a run-time dependency on such systems.

> + For example,
> +
> address@hidden
> +(define-public sbcl-bordeaux-threads
> +  (package
> +    ...
> +    (native-inputs `(("tests:cl-fiveam" ,sbcl-fiveam)))
> +    ...))
> address@hidden example

This is a bit confusing, so every input starts with ‘sbcl-’ will be
propagated?  I wonder why not just use ‘propgated-inputs’ for that.

> +
> +Additionally, the corresponding source package should be labelled using
> +the same convention as python packages (see @ref{Python Modules}), using
> +the @code{cl-} prefix.
> +
> +One package should be defined for each ASDF system.

This is for binary packages right?  (It’s obviously not convenient for
source packages which usually have an extra system for test only.)
++ I seems wrong here, new ideas below ‘package-with-build-system’. ++

For binary packages, this will be perfect if they’re 1-to-1 mapped to
a CL system, but then their names are inconsistent with the ’cl-’
ones, whose names are from projects instead of the systems they
contain.

Consider the ‘cl-autowrap’ (https://github.com/rpav/cl-autowrap)
project.  It has 3 systems: ‘cl-autowrap’, ‘cl-autowrap-test’ and
‘cl-plus-c’.  IIUC, follow this one package per system way, we will
package it as:

- cl-autowrap, contains the 3 systems in source form.
- sbcl-autowrap (or maybe sbcl-cl-autowrap?).
- sbcl-plus-c (or ‘sbcl-cl-plus-c?).
- sbcl-autowrap-test (for testing).

It’s hard to know that ‘cl-autowrap’ has ‘cl-plus-c’ in it…

> +
> +The package outputs control whether or not executable programs and
> +images are built alongside the package's usual output, using the
> address@hidden and @code{image} outputs, respectively.
> +
> +Packages can also be built which combine other packages into an
> +executable program or image only, without building another system.
> +Specifying one of the @code{#:binary?} or @code{#:image?} parameters
> +will produce this behaviour.
> +
> +When building an executable program, the @code{#:entry-program}
> +parameter, which should be a list of Common Lisp expressions, must be
> +used to specify what program should be run.  In this program,
> address@hidden will be bound to the command-line arguments passed.
> +
> +The @code{#:image-dependencies} parameter can be used to add packages to
> +the pre-loaded systems included in the executable program or image.
> address@hidden:compile-dependencies} specifies a list of additional systems
> +which should be loaded before a system is compiled.  If the package
> +depends on special systems exported by the implementation itself, the
> address@hidden:special-dependencies} parameter should be used to specify them.

I’d like to make the build action of ‘program’ or ‘image’ more
explicit instead of coding them in the build system.  eg:

--8<---------------cut here---------------start------------->8---
(define-public sbcl-stumpwm
  (package
    …
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'install 'install-program
           (lambda* (#:key outputs #:allow-other-keys)
             ((let* ((bin  (assoc-ref outputs "bin"))
                     (prog (string-append bin "/bin/stumpwm")))
                (asdf:build-program prog
                  #:entry-program '((stumpwm:stumpwm))
                  #:special-dependencies '("sb-posix")))))))
        …))))
--8<---------------cut here---------------end--------------->8---

I think this way show what #:entry-program and other parameters are used
for more clearly, as they have nothing to do with other phases (compile
the system and install a bundle asd file).  Most CL packages are
libraries, so I feel that having phases (generate-binary and
generate-image) which do nothing most times is overkill :-)

What’s the ‘compile-dependencies’ used for?  I think when compile a
system, ASDF will load all its depends (from the :depends-on) first.
Sometimes we need load extra systems manually?

> […]
> diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
> new file mode 100644
> index 0000000..eb8b7d9
> --- /dev/null
> +++ b/guix/build-system/asdf.scm
> @@ -0,0 +1,385 @@
> […]
> +
> +(define* (package-with-build-system from-build-system to-build-system
> +                                    from-prefix to-prefix
> +                                    #:key variant-property
> +                                    phases-transformer)
> +  "Return a precedure which takes a package PKG which uses FROM-BUILD-SYSTEM,
> +and returns one using TO-BUILD-SYSTEM. If PKG was prefixed by FROM-PREFIX, 
> the
> +resulting package will be prefixed by TO-PREFIX. Inputs of PKG are 
> recursively
> +transformed using the same rule.

Oops, so we should use one package per system for source packages too,
otherwise there is no obvious way to transform between them (I’d like it
be one way, just ‘cl-package->sbcl-package’) and binary packages.  If
that’s true, for the ‘cl-autowrap’ project, its source packages should
be ‘cl-autowrap’, ’cl-plus-c’, and ‘cl-autowrap-test’.  And I don’t
think we should copy the whole project source for each of them.  So, how
about:

- For a CL project, define a (non-public) project package, which just
  unpacks the source to its ‘$out’.

- For each system the project contains, define a ‘cl-SYSTEM-NAME-W/O-CL’
  package, which takes the project package as ‘source’ and symlink the
  system’s asd file to its ‘$out/share/common-lisp/systems’.

- Then for each ‘cl-’ package, we can transform it to a binary package,
  which should compile and install a bundle asd file for one system.

> +The result's #:phases argument will be
> +modified by PHASES-TRANSFORMER, a list which evaluates on the build side to a
> +procedure of one argument.

A symbol?

> +
> +VARIANT-PROPERTY can be added to a package's properties to indicate that the
> +corresponding package promise should be used as the result of this
> +transformation. This allows the result to differ from what the transformation
> +would otherwise produce.
> +
> +If TO-BUILD-SYSTEM is asdf-build-system/source, the resulting package will be
> +set up using CL source package conventions."
> +  (define target-is-source? (eq? 'asdf/source
> +                                 (build-system-name to-build-system)))
> +
> +  (define (transform-package-name name)
> +    (if (string-prefix? from-prefix name)
> +        (let ((new-name (string-drop name (string-length from-prefix))))
> +          (if (string-prefix? to-prefix new-name)
> +              new-name
> +              (string-append to-prefix new-name)))
> +        name))
> +
> +  (define (has-from-build-system? pkg)
> +    (eq? (build-system-name from-build-system)
> +         (build-system-name (package-build-system pkg))))
> +
> +  (define transform
> +    (memoize
> +     (lambda (pkg)
> +       (define rewrite
> +         (match-lambda
> +           ((name content . rest)
> +            (let* ((is-package? (package? content))
> +                   (new-content (if is-package? (transform content) content))
> +                   (new-name (if (and is-package?
> +                                      (string-prefix? from-prefix name))
> +                                 (package-name new-content)
> +                                 name)))
> +              `(,new-name ,new-content ,@rest)))))
> +
> +       ;; Special considerations for source packages: CL inputs become
> +       ;; propagated, and un-handled arguments are removed. Native inputs are
> +       ;; removed as are extraneous outputs.
> +       (define new-propagated-inputs
> +         (if target-is-source?
> +             (map rewrite
> +                  (filter (match-lambda
> +                            ((_ input . _)
> +                             (has-from-build-system? input)))
> +                          (package-inputs pkg)))
> +             '()))
> +
> +       (define new-inputs
> +         (if target-is-source?
> +             (map rewrite
> +                  (filter (match-lambda
> +                            ((_ input . _)
> +                             (not (has-from-build-system? input))))
> +                          (package-inputs pkg)))
> +             (map rewrite (package-inputs pkg))))

To make a binary package from a source package, my plan looks like:

- remove all inputs not start with ‘cl-’.  Ideally, we can do all the
  things (eg: patch the file names of ffi libraries to absolute paths)
  in source packages to make them ready to use for CLs.  All a binary
  package needs are CL systems and an CL compiler.
  
- rewrite ‘cl-’ inputs to ‘sbcl-’ inputs recursively.

- source package becomes the ‘source’ of the binary package, if in-tree
  build is needed (I hope not very often), we can follow the asd file
  link to copy its real source.

> +
> +       (define base-arguments
> +         (if target-is-source?
> +             (strip-keyword-arguments
> +              '(#:tests? #:special-dependencies #:entry-program
> +                #:image-dependencies #:compile-dependencies #:image?
> +                #:binary? #:test-only-systems #:lisp)
> +              (package-arguments pkg))
> +             (package-arguments pkg)))

If we don’t allow ‘sbcl-package->cl-package’, arguments don’t need to be
stripped.

> +
> +       (cond
> +        ((and variant-property
> +              (assoc-ref (package-properties pkg) variant-property))
> +         => force)
> +
> +        ((has-from-build-system? pkg)
> +         (package
> +           (inherit pkg)
> +           (location (package-location pkg))
> +           (name (transform-package-name (package-name pkg)))
> +           (build-system to-build-system)
> +           (arguments
> +            (substitute-keyword-arguments base-arguments
> +              ((#:phases phases) (list phases-transformer phases))))
> +           (inputs new-inputs)
> +           (propagated-inputs new-propagated-inputs)
> +           (native-inputs (if target-is-source?
> +                              '()
> +                              (map rewrite (package-native-inputs pkg))))
> +           (outputs (if target-is-source?
> +                        '("out")
> +                        (package-outputs pkg)))))
> +        (else pkg)))))
> +
> +  transform)
> +
> +(define (strip-variant-as-necessary variant pkg)
> +  (define properties (package-properties pkg))
> +  (if (assoc variant properties)
> +      (package
> +        (inherit pkg)
> +        (properties (alist-delete variant properties)))
> +      pkg))
> +
> +(define (lower lisp-implementation)
> +  (lambda* (name
> +            #:key source inputs outputs native-inputs system target
> +            (lisp (default-lisp (string->symbol lisp-implementation)))
> +            #:allow-other-keys
> +            #:rest arguments)
> +    "Return a bag for NAME"
> +    (define private-keywords
> +      '(#:target #:inputs #:native-inputs #:lisp))
> +
> +    (and (not target)
> +         (bag
> +           (name name)
> +           (system system)
> +           (host-inputs `(,@(if source
> +                                `(("source" ,source))
> +                                '())
> +                          ,@inputs
> +                          ,@(standard-packages)))
> +           (build-inputs `((,lisp-implementation ,lisp)
> +                           ,@native-inputs))
> +           (outputs outputs)
> +           (build (asdf-build lisp-implementation))
> +           (arguments (strip-keyword-arguments private-keywords 
> arguments))))))
> +
> +(define (asdf-build lisp-implementation)
> +  (lambda* (store name inputs
> +                  #:key source outputs
> +                  (tests? #t)
> +                  (special-dependencies ''())
> +                  (entry-program #f)
> +                  (image-dependencies ''())
> +                  (compile-dependencies ''())
> +                  (image? #f)
> +                  (binary? #f)
> +                  (test-only-systems ''())
> +                  (lisp lisp-implementation)
> +                  (phases '(@ (guix build asdf-build-system)
> +                              %standard-phases))
> +                  (search-paths '())
> +                  (system (%current-system))
> +                  (guile #f)
> +                  (imported-modules %asdf-build-system-modules)
> +                  (modules %asdf-build-modules))
> +
> +    (define builder
> +      `(begin
> +         (use-modules ,@modules)
> +         (asdf-build #:name ,name
> +                     #:source ,(match (assoc-ref inputs "source")
> +                                 (((? derivation? source))
> +                                  (derivation->output-path source))
> +                                 ((source) source)
> +                                 (source source))
> +                     #:lisp ,lisp
> +                     #:special-dependencies ,special-dependencies
> +                     #:compile-dependencies ,compile-dependencies
> +                     #:test-only-systems ,test-only-systems

++ quetions below ‘patch-asd-files’. ++

> +                     #:entry-program ,entry-program
> +                     #:image-dependencies ,image-dependencies
> +                     #:image? ,image?
> +                     #:binary? ,binary?


Those will be removed if we build ‘program’ or ’image’ explicitly.  In
that case, IIUC, we should add variant properties to the source package
if we add phases (by inherit) to the binary package and want the
transform get the same (not get the same one is fine too, which only
lacks the optional programs or binaries) package.


> +                     #:system ,system
> +                     #:tests? ,tests?
> +                     #:phases ,phases
> +                     #:outputs %outputs
> +                     #:search-paths ',(map search-path-specification->sexp
> +                                           search-paths)
> +                     #:inputs %build-inputs)))
> +
> +    (define guile-for-build
> +      (match guile
> +        ((? package?)
> +         (package-derivation store guile system #:graft? #f))
> +        (#f
> +         (let* ((distro (resolve-interface '(gnu packages commencement)))
> +                (guile (module-ref distro 'guile-final)))
> +           (package-derivation store guile system #:graft? #f)))))
> +
> +    (build-expression->derivation store name builder
> +                                  #:inputs inputs
> +                                  #:system system
> +                                  #:modules imported-modules
> +                                  #:outputs outputs
> +                                  #:guile-for-build guile-for-build)))
> +
> +(define asdf-build-system/sbcl
> +  (build-system
> +    (name 'asdf/sbcl)
> +    (description "The build system for asdf binary packages using sbcl")
> +    (lower (lower "sbcl"))))
> +
> +(define asdf-build-system/ecl
> +  (build-system
> +    (name 'asdf/ecl)
> +    (description "The build system for asdf binary packages using ecl")
> +    (lower (lower "ecl"))))
> +
> +(define asdf-build-system/source
> +  (build-system
> +    (name 'asdf/source)
> +    (description "The build system for asdf source packages")
> +    (lower lower/source)))
> +
> +(define source-package->sbcl-package
> +  (let* ((property 'sbcl-variant)
> +         (transformer
> +          (package-with-build-system asdf-build-system/source
> +                                     asdf-build-system/sbcl
> +                                     "cl-"
> +                                     "sbcl-"
> +                                     #:variant-property property
> +                                     #:phases-transformer
> +                                     'source-phases->sbcl-phases)))

The ‘source-phases->sbcl-phases’ proceduce seems missing, is it ‘(const
%standard-phases)’?

> +    (lambda (pkg)
> +      (transformer
> +       (strip-variant-as-necessary property pkg)))))
> +
> +(define sbcl-package->cl-source-package
> +  (let* ((property 'cl-source-variant)
> +         (transformer
> +          (package-with-build-system asdf-build-system/sbcl
> +                                     asdf-build-system/source
> +                                     "sbcl-"
> +                                     "cl-"
> +                                     #:variant-property property
> +                                     #:phases-transformer
> +                                     '(const %standard-phases/source))))
> +    (lambda (pkg)
> +      (transformer
> +       (strip-variant-as-necessary property pkg)))))
> +
> +(define sbcl-package->ecl-package
> +  (let* ((property 'ecl-variant)
> +         (transformer
> +          (package-with-build-system asdf-build-system/sbcl
> +                                     asdf-build-system/ecl
> +                                     "sbcl-"
> +                                     "ecl-"
> +                                     #:variant-property property
> +                                     #:phases-transformer
> +                                     'identity)))
> +    (lambda (pkg)
> +      (transformer
> +       (strip-variant-as-necessary property pkg)))))
> +
> +;;; asdf.scm ends here


> […]
> +(define* (patch-asd-files #:key outputs
> +                          inputs
> +                          lisp
> +                          special-dependencies
> +                          image?
> +                          binary?
> +                          test-only-systems
> +                          #:allow-other-keys)
> +  "Patch any asd files created by the compilation process so that they
> +can find their dependencies. Exclude any TEST-ONLY-SYSTEMS which were only
> +included to run tests. Add any SPECIAL-DEPENDENCIES which the LISP
> +implementation itself provides."
> +  (unless (or image? binary?)
> +    (let* ((out (assoc-ref outputs "out"))
> +           (name (remove-lisp-from-name (output-path->package-name out) 
> lisp))
> +           (registry (lset-difference
> +                      (lambda (input system)
> +                        (match input
> +                          ((name . path) (string=? name system))))
> +                      (lisp-dependencies lisp inputs)
> +                      test-only-systems))
> +           (lisp-systems (map first registry)))
> +
> +      (for-each
> +       (lambda (asd-file)
> +         (patch-asd-file asd-file registry lisp
> +                         (append lisp-systems special-dependencies)))
> +       (find-files out "\\.asd$"))))
> +  #t)

Doesn’t ‘special-dependencies’ always available, do we need load them
explicitly?

I think it’s strange that ‘deliver-asd-op’ make a asd file without all
its original depends, if the original are valid, maybe we can copy them
back?

> […]
> +(define* (generate-binary #:key outputs
> +                          inputs
> +                          image-dependencies
> +                          entry-program
> +                          lisp
> +                          binary?
> +                          #:allow-other-keys)
> +  "Generate a binary program for the system, either in \"bin\" if the package
> +also contains a library system, or in \"out\" otherwise."
> +  (define output (if binary? "out" "bin"))
> +  (generate-executable #:outputs outputs
> +                       #:inputs inputs
> +                       #:image-dependencies image-dependencies
> +                       #:entry-program entry-program
> +                       #:lisp lisp
> +                       #:output output
> +                       #:needs-own-system? (not binary?)
> +                       #:type "program")
> +  (and=>
> +   (assoc-ref outputs output)
> +   (lambda (bin)
> +     (let* ((full-name (outputs->name outputs))
> +            (name (if binary? full-name
> +                      (remove-lisp-from-name full-name lisp)))
> +            (bin-directory (string-append bin "/bin")))
> +       (with-directory-excursion bin-directory
> +         (rename-file (string-append name "-exec")
> +                      name)))))
> +  #t)
> +
> +(define* (generate-image #:key outputs
> +                         inputs
> +                         image-dependencies
> +                         lisp
> +                         image?
> +                         #:allow-other-keys)
> +  "Generate an image for the system, possibly standalone, either in \"image\"
> +if the package also contains a library system, or in \"out\" otherwise."
> +  (define output (if image? "out" "image"))
> +  (generate-executable #:outputs outputs
> +                       #:inputs inputs
> +                       #:image-dependencies image-dependencies
> +                       #:entry-program '(nil)
> +                       #:lisp lisp
> +                       #:output output
> +                       #:needs-own-system? (not image?)
> +                       #:type "image")
> +  (and=>
> +   (assoc-ref outputs output)
> +   (lambda (image)
> +     (let* ((full-name (outputs->name outputs))
> +            (name (if image? full-name
> +                      (remove-lisp-from-name full-name lisp)))
> +            (bin-directory (string-append image "/bin")))
> +       (with-directory-excursion bin-directory
> +         (rename-file (string-append name "-exec--all-systems.image")
> +                      (string-append name ".image"))))))
> +  #t)
> +
> +(define* (generate-executable #:key outputs
> +                              image-dependencies
> +                              entry-program
> +                              lisp
> +                              output
> +                              inputs
> +                              type
> +                              needs-own-system?
> +                              #:allow-other-keys)
> +  "Generate an executable by using asdf's TYPE-op, containing whithin the
> +image all IMAGE-DEPNDENCIES, and running ENTRY-PROGRAM in the case of an
> +executable."
> +  (and=>
> +   (assoc-ref outputs output)
> +   (lambda (out)
> +     (let* ((bin-directory (string-append out "/bin"))
> +            (full-name (outputs->name outputs))
> +            (name (if needs-own-system?
> +                      (remove-lisp-from-name full-name lisp)
> +                      full-name)))
> +       (mkdir-p out)
> +       (with-directory-excursion out
> +         (generate-executable-wrapper-system name
> +                                             image-dependencies
> +                                             needs-own-system?)
> +         (generate-executable-entry-point name entry-program))
> +
> +       (setenv "CL_SOURCE_REGISTRY"
> +               (replace-escaped-macros
> +                (format
> +                 #f "~S"
> +                 (wrap-source-registry
> +                  `(,(source-registry (assoc-ref outputs "out"))
> +                    ,(source-registry out))))))
> +
> +       (setenv "ASDF_OUTPUT_TRANSLATIONS"
> +               (replace-escaped-macros
> +                (format
> +                 #f "~S"
> +                 (wrap-output-translations
> +                  `(((,out :**/ :*.*.*)
> +                     (,bin-directory :**/ :*.*.*)))))))
> +
> +       (parameterize ((%lisp (string-append
> +                              (assoc-ref inputs lisp) "/bin/" lisp)))
> +         (generate-executable-for-system type name lisp))
> +
> +       (delete-file (string-append out "/" name "-exec.asd"))
> +       (delete-file (string-append out "/" name "-exec.lisp"))))))
> +

Yeah, I’d like to merge those into lisp-utils.scm, and become something
like ‘wrap-program’.


Also, the output-translations way sometime produces unnecessary
files, eg: in ecl-fiveam:

--8<---------------cut here---------------start------------->8---
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib/ecl
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib/ecl/src
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib/ecl/src/fiveam.fasb
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib/ecl/src/fiveam.asd
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib/ecl/src/fiveam.a
/gnu/store/jy5525lyx0lk20h02g6ik5q4qfkjcnz6-ecl-fiveam-1.2/lib/ecl/t
--8<---------------cut here---------------end--------------->8---

I think we only want ’lib/ecl/fiveam.*’.

I have tried ‘asdf/action:output-files’, hoping that will allow install
only the files we want, but it doesn’t seem give all the output files.

Run this with ECL:

--8<---------------cut here---------------start------------->8---
(require :asdf)

(let* ((asdf/output-translations:*output-translations*
        '(((t #P"/tmp/build/**/*.*"))))
       (files
        (asdf/action:output-files
         'asdf:compile-bundle-op (asdf:find-system :cl-json))))
  (asdf:operate 'asdf:compile-bundle-op :cl-json)
  (format t "~S" files))

(quit)
--8<---------------cut here---------------end--------------->8---

The ‘fasb’ file is returned, but the ‘a’ file is missing.
What the ECL lib (‘a’) files used for?


Despite my opinions and ideas, please let me know if this patch is
considered ready, so we can merge it and improve later.

Thanks!



reply via email to

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