*.[1-9].in: Delete apparently pointless definitions of `\*,'.
[runlisp] / dump-runlisp-image.1.in
CommitLineData
10427eb2
MW
1.\" -*-nroff-*-
2.\"
3.\" Manual for `dump-runlisp-image'
4.\"
5.\" (c) 2020 Mark Wooding
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
10.\" This file is part of Runlisp, a tool for invoking Common Lisp scripts.
11.\"
12.\" Runlisp is free software: you can redistribute it and/or modify it
13.\" under the terms of the GNU General Public License as published by the
14.\" Free Software Foundation; either version 3 of the License, or (at your
15.\" option) any later version.
16.\"
17.\" Runlisp is distributed in the hope that it will be useful, but WITHOUT
18.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20.\" for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with Runlisp. If not, see <https://www.gnu.org/licenses/>.
24.
25.ie t \{\
26. ds o \(bu
27. if \n(.g \{\
28. fam P
29. ev an-1
30. fam P
31. ev
32. \}
33.\}
34.el \{\
35. ds o o
36.\}
37.
38.de hP
39.IP
40\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
41..
10427eb2
MW
42.
43.\"--------------------------------------------------------------------------
44.TH dump-runlisp-image 1 "12 August 2020" "Mark Wooding"
45.SH NAME
46dump-runlisp-image \- dump Lisp images for faster script execution
47.
48.\"--------------------------------------------------------------------------
49.SH SYNOPSIS
50.
51.B dump-runlisp-image
52.RB [ \-RUafinqrv ]
53.RB [ +RUfinr ]
54.RB [ \-O
55.IR output ]
56.br
8ed4c352 57 \c
10427eb2
MW
58.RB [ \-c
59.IR conf ]
60.RB [ \-o
61.RI [ sect \c
62.BR : ] \c
63.IB var = \c
64.IR value ]
65.RB [ \-j
66.IR njobs ]
67.RI [ lisp
68\&...]
69.
70.\"--------------------------------------------------------------------------
71.SH DESCRIPTION
72.
73The
74.B dump-runlisp-image
c7af83cd 75program builds and manages custom images for use by
10427eb2
MW
76.BR runlisp (1).
77For many Lisp implementation,
78a custom image,
79with ASDF already loaded,
80can start scripts much more quickly
81than the `vanilla' images installed by default.
82The downside is that custom images may be rather large.
c7af83cd
MW
83.PP
84There are actually
85.I two
86filenames for each Lisp image:
87the well-known one that
88.BR runlisp (1)
89uses to run scripts is a symbolic link to the other,
90the actual image file,
91whose name contains an ugly hexadecimal lump
92which identifies the versions of the Lisp code dumped in the image file.
93The
94.B dump-runlisp-image
95program uses this hash to determine whether
96the current image is up-to-date or needs replacing.
10427eb2
MW
97.
98.SS "Options"
99The following options are accepted on the command line.
100.
101.TP
102.BR "\-h" ", " "\-\-help"
103Write a synopsis of
104.BR dump-runlisp-image 's
105command-line syntax
106and a description of the command-line options
107to standard output
108and immediately exit with status 0.
109.
110.TP
111.BR "\-V" ", " "\-\-version"
112Write
113.BR dump-runlisp-image 's
114version number
115to standard output
116and immediately exit with status 0.
117.
118.TP
10427eb2
MW
119.BI "\-O" "\fR, " "\-\-output=" output
120If
121.I output
122names a directory,
123then write images to that directory
124with their default names as specified in the configuration file.
125Otherwise,
126exactly one Lisp implementation must be explicitly named,
127the
128.RB ` \-R '
129and
130.RB `\-U '
131options must not be set,
132and
133the image is written to a file named
134.IR output .
135By default,
136images are written to the directory in which
137.BR runlisp (1)
138will look in when checking for custom images:
139run
bf52b6ca 140.B query-runlisp-config \-x@image-dir
10427eb2
MW
141to see the default setting.
142.
143.TP
c88b892c
MW
144.BR "\-R" ", " "\-\-remove-other"
145After processing the selected Lisp implementations,
146delete all of the image files corresponding to other Lisps
147defined in the configuration.
148Negate with
149.B +R
150or
151.BR \-\-no-remove-other .
152.
153.TP
154.BR "\-U" ", " "\-\-remove-unknown"
155After processing the selected Lisp implementations,
156delete all of the files in the image directory which
157.I aren't
158image files of a configured Lisp implementation.
159Negate with
160.B +U
161or
162.BR \-\-no-remove-unknown .
163.
164.TP
10427eb2
MW
165.BR "\-a" ", " "\-\-all-configured"
166Select all configured Lisp implementations.
167You must either list Lisp implementations explicitly on the command line
168or set the
169.RB ` \- a'
170option,
171but not both.
172.
173.TP
174.BI "\-c" "\fR, " "\-\-config-file=" conf
175Read configuration from
176.IR conf .
177If
178.I conf
179is a directory, then all of the files within
180whose names end with
181.RB ` .conf ',
182are loaded, in ascending lexicographical order;
183otherwise,
184.I conf
185is opened as a file.
af677646 186All of the files are expected to be as described in
10427eb2
MW
187.BR runlisp.conf (5).
188.
189.TP
190.BR "\-f" ", " "\-\-force"
191Create fresh Lisp images
192even if a file with the appropriate name
193already exists.
194Negate with
195.B +f
196or
197.BR \-\-no-force .
198.
199.TP
200.BR "\-i" ", " "\-\-check-installed"
201Only select those Lisp implementations
202which are actually installed
203(and can be found).
204To count as `installed',
205the program named by
206.B command
207must exist and be executable in one of the directories listed in the
208.B PATH
209environment variable,
210as must the command named in the first word of the
211.B dump-image
212command line.
213Note that a Lisp implementation which fails this check
214is not counted as `selected' for the purposes of the
215.RB ` \-R '
216option above.
217For example, the command
218.B "dump-runlisp-image \-Rai"
219will dump images for Lisps which have been installed since the last run,
220and delete images for Lisps which have been uninstalled since then.
221Negate with
222.B +i
223or
224.BR \-\-no-check-installed .
225.
226.TP
227.BI "\-j" "\fR, " "\-\-jobs=" njobs
228Dump image for up to
229.I njobs
230Lisp implementations in parallel.
231The default is to run the jobs sequentially.
232.
233.TP
bf52b6ca 234.BR "\-n" ", " "\-\-dry-run"
10427eb2
MW
235Don't actually run any commands to dump images.
236This may be helpful for the curious,
237in conjunction with
238.RB ` \-v '
239to increase the verbosity.
240Negate with
241.B +n
242or
243.BR "\-\-no-dry-run" .
244.
245.TP
497e5a4a
MW
246.BI "\-o" "\fR, " "\-\-set-option=\fR[" sect "\fR]\fB:" var = value
247Assign
248.I value
249to the variable
250.I var
251in configuration section
252.IR sect ,
253or
254.B @CONFIG
255if no section is specified.
256The value is unexpandable,
257and overrides any similarly named setting
258from the configuration file(s).
259.
260.TP
10427eb2
MW
261.BR "\-q" ", " "\-\-quiet"
262Don't print warning messages.
263This option may be repeated:
264each use reduces verbosity by one step,
265counteracting one
266.RB ` \-v '
267option.
268The default verbosity level is 1,
269which prints only warning measages.
270.
271.TP
272.BR "\-r" ", " "\-\-remove-image"
273Delete image files for the selected Lisp implementations,
274rather than dumping them.
275Negate with
276.B +r
277or
278.BR \-\-no-remove-image .
279.
280.TP
281.BR "\-v" ", " "\-\-verbose"
282Be more verbose about the process of creating images.
283Lisp implementations can be rather noisy:
284by default,
285.B dump-runlisp-image
286runs silently unless something goes wrong,
287in which case it prints the failed Lisp command line
288and its output.
289If you set
290.B \-v
291then
292.B dump-runlisp-image
293will show Lisp implementation's noise immediately,
294without waiting to see whether it succeeds or fails.
295.
296.SS "Operation"
297The
298.B dump-runlisp-image
299program first determines a collection of
300.I selected
301Lisp implementations.
302If the
303.RB ` \-a '
304option is not set,
305then the selected Lisps are those named on the command line.
306If
307.RB ` \-a '
308is set,
309and the configuration contains a setting for
310.B dump
311in the
312.B @CONFIG
313section,
314then its (expanded) value is taken to be
315a list of Lisp implementation names
316separated by commas and/or one or more whitespace characters,
317and these named Lisp implementations are selected;
318if there is no
319.B dump
320setting, then
321.I all
322configured Lisp implementations which claim support for custom images
323\(en i.e., configuration sections with settings for
324.B run-script
325and
326.B image-file
327\(en are selected, and the
328.RB ` \-i '
329option is forced on.
330If the
331.RB ` \-i '
332option is set,
333then only those Lisp implementations which are actually installed
334are selected.
335.PP
c7af83cd
MW
336If necessary
337(see below),
338.B dump-runlisp-image
339invokes each selected Lisp in order to determine a
340.IR "version hash" .
341For each selected Lisp system,
342it constructs a command line,
343in the manner of
344.BR runlisp (1),
345to evaluate the expression resulting from expanding the
346.B lisp-version
347setting in the Lisp system's configuration section.
348It hashes the result,
349using a collision-resistant hash function
350(currently SHA256),
351to produce a string of hexadecimal digits which represents
352the versions of the various pieces of Lisp code which
353.I should
354be in the dumped image.
355The standard setting for
356.B lisp-version
357includes the Lisp implementation version string
358and the version of ASDF currently installed.
359(This step is skipped
360if it's not necessary to determine the Lisp system versions.
361In practice, this happens when the
362.RB ` \-r ',
363.RB ` \-R '
364and
365.RB ` \-U '
366options are all set.)
367.PP
10427eb2 368Having established the selected Lisps,
c7af83cd 369and their version hashes,
10427eb2
MW
370.B dump-runlisp-image
371proceeds to act on them:
372in the absence of the
373.RB ` \-r '
374option,
375it attempts to dump a custom image
376for each selected Lisp implementation,
377unless an image file already exists
378or the
379.RB ` \-f '
380option is set.
381(Note that
382.RB ` \-f '
383is an optimization of image dumping,
384and does not affect selection.)
385On the other hand, if
386.RB ` \-r '
387is set,
388then the custom image files of the selected Lisp implementations
389are deleted.
390.PP
391Next, if the
392.RB ` \-R '
393option is set,
394then all the images for Lisp implementations
395which are defined in the configuration
396but were
397.I not
398selected
399are deleted.
400.PP
401Finally, if the
402.RB ` \-U '
403option is set,
404then all files in the image directory
405which aren't recognized as being
406the custom image of some Lisp implementation
407are deleted.
408.PP
409If all of these operations are successfully performed
410then
411.B dump-runlisp-image
412exits with status 0;
413if there was a problem with the command line,
414or if any jobs fail,
415then it exits with status 127.
416.
417.\"--------------------------------------------------------------------------
418.
419.SH SEE ALSO
420.BR query-runlisp-config (1),
421.BR runlisp (1),
422.BR runlisp.conf (5).
423.
424.SH AUTHOR
425Mark Wooding, <mdw@distorted.org.uk>
426.
427.\"----- That's all, folks --------------------------------------------------