source: trunk/abcl/doc/packaging-abcl.org

Last change on this file was 15710, checked in by Mark Evenson, 11 months ago

doc: proofread ABCL-AIO
(thanks to Alan Ruttenberg)

File size: 3.9 KB
Line 
1#+TITLE: Notes on Packaging ABCL for Distribution
2
3
4* ABCL-AIO
5
6The standard ABCL build process as described in the ~build.xml~ file
7and executed by the Ant build tool results in two archive artifacts:
8~abcl.jar~ and ~abcl-contrib.jar~.  ~abcl.jar~ contains all the Java
9and Common Lisp code necessary that constitute the ANSI conforming
10implementation runtime, plus the latest stable ASDF. The
11~abcl-contrib.jar~ (aka "contrib") artifact contains additional Common
12Lisp-only code that extends the implementation in useful manners.  At
13some point in the future,
14
15We create two separate jar artifacts in order to:
16
171. Place an upper bound of size and complexity of ~abcl.jar~
18   regardless of what we package in ~abcl-contrib.jar~.  Having a
19   restricted core ANSI implementation plus ASDF enables us to:
20
21   1.1. More easily bootstrap ABCL when porting to JVM runtimes other
22        than the OpenJDK (Davlik, CLR, 
)
23
24   1.2. Subsequently use ASDF to package ABCL extension components.
25   
262. Clearly mark which parts of the code-base are covered under
27   GPLv2+classpath from those that may have other licensing terms.  By
28   making the loading of the "abcl-contrib" a dynamic, user-initiated,
29   operation, we maintain our license compliance.  Providing, but not
30   shipping, ABCL-AIO, defers possible infringement to the User who
31   redistributes the resulting jar artifact.
32
33Users often want to simply package both artifacts in a single jar for
34deployment convenience.  abcl-1.5.0 introduced the build machinery to
35create such an "all-in-one" artifact via the [[https://github.com/armedbear/abcl/blob/master/build.xml#L517][~abcl-aio.jar~]] target.
36Upon invoking the ~abcl-aio.jar~ target
37#+begin_src shell
38ant -f build.xml abcl-aio.jar
39#+end_src
40the resulting artifact contains both the core implementation and the
41ABCL contrib which may be run as usual via
42#+begin_src shell
43java -jar dist/abcl-aio.jar
44#+end_src
45
46* ASDF-JAR contrib
47
48The ASDF-JAR contrib provides a mechanism for package ASDF systems and
49their recursive dependencies in a jar archive. 
50
51An example of using this to package the CL-PPCRE system from
52Quicklisp:
53#+begin_src lisp
54;;
55(require :abcl-contrib)
56(require :quicklisp-abcl)
57(ql:quickload :cl-ppcre)
58
59(require :asdf-jar)
60(asdf-jar:package :cl-ppcre)
61#+end_src
62
63results in a jar archive at something like
64~#P"/var/tmp/cl-ppcre-all-2.1.1.jar"~.
65
66This jar archive may be loaded in a version of the implementation via
67
68#+begin_src lisp
69(require :abcl-contrib)
70(require :asdf-jar)
71(setf *load-verbose* t) ;; so we can verify where the load is coming from
72(asdf-jar:add-to-asdf #P"/var/tmp/cl-ppcre-all-2.1.1.jar")
73(asdf:load-system :cl-ppcre)
74#+end_src
75
76=asdf-jar= uses all items declared in the ASDF definitions so it won't
77work well for:
78
791. An ASDF system which depends on artifacts that are not declared as
80   existing on the file-system via an explicit reference within the
81   ASDF source reference mechanism.
82
832. Libraries such as CFFI which depend on items to be have been make
84   available via an operating system packaging mechanism.
85
86* Implementation Status
87
88Ideally, we would like allow the AIO mechanism to include additional
89ASDF systems in the single jar artifact. 
90
91Currently one can hack this together by:
92
931.  Manually extracting the ~abcl-aio.jar~ artifact to a file-system.
94
952.  Placing the necessary ASDF systems in the resulting "contrib"
96    directory.
97
983.  Recreating the single archive from the file-system contents.
99
100* TODO Future directions
101
102Obviously, we could provide more convenience in packaging ABCL
103applications as single archives .  Rather than mucking around in the
104Ant build system, I would rather that we add the necessary machinery
105=ABCL-BUILD= contrib as it will make customization much easier for
106those who know Common Lisp.
107
108Patches towards easier use are gratefully solicited.
109
110
111* Colophon
112  #+begin_example
113  Mark <evenson.not.org@gmail.com>
114  Created: <2019-11-25 Mon>
115  Revised: <2023-06-12 Mon 09:09>
116  #+end_example
117
118 
119
Note: See TracBrowser for help on using the repository browser.