author | wenzelm |
Fri, 26 Apr 2024 20:18:15 +0200 | |
changeset 80158 | 059d5e115ae3 |
parent 80157 | 6b9d5cae4579 |
permissions | -rw-r--r-- |
61656 | 1 |
(*:maxLineLen=78:*) |
61575 | 2 |
|
28224 | 3 |
theory Misc |
43564
9864182c6bad
document antiquotations are managed as theory data, with proper name space and entity markup;
wenzelm
parents:
41512
diff
changeset
|
4 |
imports Base |
28224 | 5 |
begin |
6 |
||
58618 | 7 |
chapter \<open>Miscellaneous tools \label{ch:tools}\<close> |
28224 | 8 |
|
58618 | 9 |
text \<open> |
61575 | 10 |
Subsequently we describe various Isabelle related utilities, given in |
11 |
alphabetical order. |
|
58618 | 12 |
\<close> |
28224 | 13 |
|
71579 | 14 |
section \<open>Building Isabelle docker images\<close> |
15 |
||
16 |
text \<open> |
|
17 |
Docker\<^footnote>\<open>\<^url>\<open>https://docs.docker.com\<close>\<close> provides a self-contained environment |
|
18 |
for complex applications called \<^emph>\<open>container\<close>, although it does not fully |
|
19 |
contain the program in a strict sense of the word. This includes basic |
|
20 |
operating system services (usually based on Linux), shared libraries and |
|
21 |
other required packages. Thus Docker is a light-weight alternative to |
|
22 |
regular virtual machines, or a heavy-weight alternative to conventional |
|
23 |
self-contained applications. |
|
24 |
||
25 |
Although Isabelle can be easily run on a variety of OS environments without |
|
26 |
extra containment, Docker images may occasionally be useful when a |
|
27 |
standardized Linux environment is required, even on |
|
28 |
Windows\<^footnote>\<open>\<^url>\<open>https://docs.docker.com/docker-for-windows\<close>\<close> and |
|
29 |
macOS\<^footnote>\<open>\<^url>\<open>https://docs.docker.com/docker-for-mac\<close>\<close>. Further uses are in |
|
30 |
common cloud computing environments, where applications need to be submitted |
|
31 |
as Docker images in the first place. |
|
32 |
||
33 |
\<^medskip> |
|
77567
b975f5aaf6b8
renamed "isabelle build_docker" to "isabelle docker_build" (unrelated to "isabelle build");
wenzelm
parents:
76184
diff
changeset
|
34 |
The @{tool_def docker_build} tool builds docker images from a standard |
71579 | 35 |
Isabelle application archive for Linux: |
36 |
||
37 |
@{verbatim [display] |
|
77567
b975f5aaf6b8
renamed "isabelle build_docker" to "isabelle docker_build" (unrelated to "isabelle build");
wenzelm
parents:
76184
diff
changeset
|
38 |
\<open>Usage: isabelle docker_build [OPTIONS] APP_ARCHIVE |
71579 | 39 |
|
40 |
Options are: |
|
76184 | 41 |
-B NAME base image (default "ubuntu:22.04") |
72525 | 42 |
-E set Isabelle/bin/isabelle as entrypoint |
71579 | 43 |
-P NAME additional Ubuntu package collection ("X11", "latex") |
76178
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
44 |
-W DIR working directory that is accessible to docker, |
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
45 |
potentially via snap (default: ".") |
71579 | 46 |
-l NAME default logic (default ISABELLE_LOGIC="HOL") |
47 |
-n no docker build |
|
48 |
-o FILE output generated Dockerfile |
|
49 |
-p NAME additional Ubuntu package |
|
50 |
-t TAG docker build tag |
|
51 |
-v verbose |
|
52 |
||
53 |
Build Isabelle docker image with default logic image, using a standard |
|
54 |
Isabelle application archive for Linux (local file or remote URL).\<close>} |
|
55 |
||
56 |
Option \<^verbatim>\<open>-E\<close> sets \<^verbatim>\<open>bin/isabelle\<close> of the contained Isabelle distribution as |
|
57 |
the standard entry point of the Docker image. Thus \<^verbatim>\<open>docker run\<close> will |
|
58 |
imitate the \<^verbatim>\<open>isabelle\<close> command-line tool (\secref{sec:isabelle-tool}) of a |
|
59 |
regular local installation, but it lacks proper GUI support: \<^verbatim>\<open>isabelle jedit\<close> |
|
60 |
will not work without further provisions. Note that the default entrypoint |
|
61 |
may be changed later via \<^verbatim>\<open>docker run --entrypoint="..."\<close>. |
|
62 |
||
63 |
Option \<^verbatim>\<open>-t\<close> specifies the Docker image tag: this a symbolic name within the |
|
64 |
local Docker name space, but also relevant for Docker |
|
65 |
Hub\<^footnote>\<open>\<^url>\<open>https://hub.docker.com\<close>\<close>. |
|
66 |
||
67 |
Option \<^verbatim>\<open>-l\<close> specifies the default logic image of the Isabelle distribution |
|
68 |
contained in the Docker environment: it will be produced by \<^verbatim>\<open>isabelle build -b\<close> |
|
69 |
as usual (\secref{sec:tool-build}) and stored within the image. |
|
70 |
||
71 |
\<^medskip> |
|
72 |
Option \<^verbatim>\<open>-B\<close> specifies the Docker image taken as starting point for the |
|
76184 | 73 |
Isabelle installation: it needs to be a suitable version of Ubuntu Linux, |
80157 | 74 |
see also \<^url>\<open>https://hub.docker.com/_/ubuntu\<close>. The default for Isabelle2024 |
80158 | 75 |
is \<^verbatim>\<open>ubuntu:22.04\<close>, but \<^verbatim>\<open>ubuntu:20.04\<close> and \<^verbatim>\<open>ubuntu:24.04\<close> should work as |
76 |
well. Other versions might require experimentation with the package |
|
77 |
selection. |
|
71579 | 78 |
|
79 |
Option \<^verbatim>\<open>-p\<close> includes additional Ubuntu packages, using the terminology |
|
80 |
of \<^verbatim>\<open>apt-get install\<close> within the underlying Linux distribution. |
|
81 |
||
82 |
Option \<^verbatim>\<open>-P\<close> refers to high-level package collections: \<^verbatim>\<open>X11\<close> or \<^verbatim>\<open>latex\<close> as |
|
80158 | 83 |
provided by \<^verbatim>\<open>isabelle docker_build\<close> (assuming Ubuntu 20.04/22.04/24.04 |
84 |
LTS). This imposes extra weight on the resulting Docker images. Note that |
|
85 |
\<^verbatim>\<open>X11\<close> will only provide remote X11 support according to the modest GUI |
|
86 |
quality standards of the late 1990-ies. |
|
71579 | 87 |
|
88 |
\<^medskip> |
|
89 |
Option \<^verbatim>\<open>-n\<close> suppresses the actual \<^verbatim>\<open>docker build\<close> process. Option \<^verbatim>\<open>-o\<close> |
|
90 |
outputs the generated \<^verbatim>\<open>Dockerfile\<close>. Both options together produce a |
|
91 |
Dockerfile only, which might be useful for informative purposes or other |
|
92 |
tools. |
|
93 |
||
94 |
Option \<^verbatim>\<open>-v\<close> disables quiet-mode of the underlying \<^verbatim>\<open>docker build\<close> process. |
|
76178
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
95 |
|
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
96 |
\<^medskip> |
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
97 |
Option \<^verbatim>\<open>-W\<close> specifies an alternative work directory: it needs to be |
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
98 |
accessible to docker, even if this is run via Snap (e.g.\ on Ubuntu 22.04). |
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
99 |
The default ``\<^verbatim>\<open>.\<close>'' usually works, if this is owned by the user: the tool |
1f95e9424341
more robust: snap version of docker cannot access /tmp;
wenzelm
parents:
76136
diff
changeset
|
100 |
will create a fresh directory within it, and remove it afterwards. |
71579 | 101 |
\<close> |
102 |
||
103 |
||
104 |
subsubsection \<open>Examples\<close> |
|
105 |
||
106 |
text \<open> |
|
107 |
Produce a Dockerfile (without image) from a remote Isabelle distribution: |
|
108 |
@{verbatim [display] |
|
77567
b975f5aaf6b8
renamed "isabelle build_docker" to "isabelle docker_build" (unrelated to "isabelle build");
wenzelm
parents:
76184
diff
changeset
|
109 |
\<open> isabelle docker_build -E -n -o Dockerfile |
80157 | 110 |
https://isabelle.in.tum.de/website-Isabelle2024/dist/Isabelle2024_linux.tar.gz\<close>} |
71579 | 111 |
|
112 |
Build a standard Isabelle Docker image from a local Isabelle distribution, |
|
113 |
with \<^verbatim>\<open>bin/isabelle\<close> as executable entry point: |
|
114 |
||
115 |
@{verbatim [display] |
|
80157 | 116 |
\<open> isabelle docker_build -E -t test/isabelle:Isabelle2024 Isabelle2024_linux.tar.gz\<close>} |
71579 | 117 |
|
118 |
Invoke the raw Isabelle/ML process within that image: |
|
119 |
@{verbatim [display] |
|
80157 | 120 |
\<open> docker run test/isabelle:Isabelle2024 process -e "Session.welcome ()"\<close>} |
71579 | 121 |
|
122 |
Invoke a Linux command-line tool within the contained Isabelle system |
|
123 |
environment: |
|
124 |
@{verbatim [display] |
|
80157 | 125 |
\<open> docker run test/isabelle:Isabelle2024 env uname -a\<close>} |
71579 | 126 |
The latter should always report a Linux operating system, even when running |
127 |
on Windows or macOS. |
|
128 |
\<close> |
|
129 |
||
28224 | 130 |
|
73172 | 131 |
section \<open>Managing Isabelle components \label{sec:tool-components}\<close> |
48844 | 132 |
|
58618 | 133 |
text \<open> |
73172 | 134 |
The @{tool_def components} tool manages Isabelle components: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
135 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
136 |
\<open>Usage: isabelle components [OPTIONS] [COMPONENTS ...] |
48844 | 137 |
|
138 |
Options are: |
|
50653
5c85f8b80b95
simplified quick start via "isabelle components -I";
wenzelm
parents:
50132
diff
changeset
|
139 |
-I init user settings |
73172 | 140 |
-R URL component repository (default $ISABELLE_COMPONENT_REPOSITORY) |
53435 | 141 |
-a resolve all missing components |
48844 | 142 |
-l list status |
73172 | 143 |
-u DIR update $ISABELLE_HOME_USER/components: add directory |
144 |
-x DIR update $ISABELLE_HOME_USER/components: remove directory |
|
48844 | 145 |
|
73172 | 146 |
Resolve Isabelle components via download and installation: given COMPONENTS |
147 |
are identified via base name. Further operations manage etc/settings and |
|
148 |
etc/components in $ISABELLE_HOME_USER. |
|
48844 | 149 |
|
73172 | 150 |
ISABELLE_COMPONENT_REPOSITORY="..." |
151 |
ISABELLE_HOME_USER="..." |
|
152 |
\<close>} |
|
48844 | 153 |
|
61575 | 154 |
Components are initialized as described in \secref{sec:components} in a |
155 |
permissive manner, which can mark components as ``missing''. This state is |
|
156 |
amended by letting @{tool "components"} download and unpack components that |
|
63680 | 157 |
are published on the default component repository |
68224 | 158 |
\<^url>\<open>https://isabelle.in.tum.de/components\<close> in particular. |
48844 | 159 |
|
61575 | 160 |
Option \<^verbatim>\<open>-R\<close> specifies an alternative component repository. Note that |
161 |
\<^verbatim>\<open>file:///\<close> URLs can be used for local directories. |
|
48844 | 162 |
|
61575 | 163 |
Option \<^verbatim>\<open>-a\<close> selects all missing components to be resolved. Explicit |
164 |
components may be named as command line-arguments as well. Note that |
|
165 |
components are uniquely identified by their base name, while the |
|
166 |
installation takes place in the location that was specified in the attempt |
|
167 |
to initialize the component before. |
|
48844 | 168 |
|
73172 | 169 |
\<^medskip> |
61575 | 170 |
Option \<^verbatim>\<open>-l\<close> lists the current state of available and missing components |
171 |
with their location (full name) within the file-system. |
|
50653
5c85f8b80b95
simplified quick start via "isabelle components -I";
wenzelm
parents:
50132
diff
changeset
|
172 |
|
73172 | 173 |
\<^medskip> |
61575 | 174 |
Option \<^verbatim>\<open>-I\<close> initializes the user settings file to subscribe to the standard |
175 |
components specified in the Isabelle repository clone --- this does not make |
|
73484 | 176 |
any sense for regular Isabelle releases. An existing file that does not |
177 |
contain a suitable line ``\<^verbatim>\<open>init_components\<close>\<open>\<dots>\<close>\<^verbatim>\<open>components/main\<close>'' needs |
|
178 |
to be edited according to the printed explanation. |
|
73172 | 179 |
|
180 |
\<^medskip> |
|
181 |
Options \<^verbatim>\<open>-u\<close> and \<^verbatim>\<open>-x\<close> operate on user components listed in |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
75116
diff
changeset
|
182 |
\<^path>\<open>$ISABELLE_HOME_USER/etc/components\<close>: this avoids manual editing of |
73172 | 183 |
Isabelle configuration files. |
58618 | 184 |
\<close> |
48844 | 185 |
|
186 |
||
58618 | 187 |
section \<open>Viewing documentation \label{sec:tool-doc}\<close> |
28224 | 188 |
|
58618 | 189 |
text \<open> |
52444
2cfe6656d6d6
slightly improved "isabelle doc" based on Isabelle/Scala;
wenzelm
parents:
52052
diff
changeset
|
190 |
The @{tool_def doc} tool displays Isabelle documentation: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
191 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
192 |
\<open>Usage: isabelle doc [DOC ...] |
28224 | 193 |
|
75116 | 194 |
View Isabelle PDF documentation.\<close>} |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
195 |
|
61575 | 196 |
If called without arguments, it lists all available documents. Each line |
197 |
starts with an identifier, followed by a short description. Any of these |
|
198 |
identifiers may be specified as arguments, in order to display the |
|
72309
564012e31db1
discontinued obsolete DVI document format and related settings/tools;
wenzelm
parents:
71579
diff
changeset
|
199 |
corresponding document. |
28224 | 200 |
|
61406 | 201 |
\<^medskip> |
61575 | 202 |
The @{setting ISABELLE_DOCS} setting specifies the list of directories |
203 |
(separated by colons) to be scanned for documentations. |
|
58618 | 204 |
\<close> |
28224 | 205 |
|
206 |
||
58618 | 207 |
section \<open>Shell commands within the settings environment \label{sec:tool-env}\<close> |
47828 | 208 |
|
61575 | 209 |
text \<open> |
210 |
The @{tool_def env} tool is a direct wrapper for the standard |
|
211 |
\<^verbatim>\<open>/usr/bin/env\<close> command on POSIX systems, running within the Isabelle |
|
212 |
settings environment (\secref{sec:settings}). |
|
47828 | 213 |
|
61575 | 214 |
The command-line arguments are that of the underlying version of \<^verbatim>\<open>env\<close>. For |
215 |
example, the following invokes an instance of the GNU Bash shell within the |
|
216 |
Isabelle environment: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
217 |
@{verbatim [display] \<open>isabelle env bash\<close>} |
58618 | 218 |
\<close> |
47828 | 219 |
|
220 |
||
58618 | 221 |
section \<open>Inspecting the settings environment \label{sec:tool-getenv}\<close> |
28224 | 222 |
|
58618 | 223 |
text \<open>The Isabelle settings environment --- as provided by the |
28224 | 224 |
site-default and user-specific settings files --- can be inspected |
48602 | 225 |
with the @{tool_def getenv} tool: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
226 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
227 |
\<open>Usage: isabelle getenv [OPTIONS] [VARNAMES ...] |
28224 | 228 |
|
229 |
Options are: |
|
230 |
-a display complete environment |
|
231 |
-b print values only (doesn't work for -a) |
|
73581 | 232 |
-d FILE dump complete environment to file (NUL terminated entries) |
28224 | 233 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
234 |
Get value of VARNAMES from the Isabelle settings.\<close>} |
28224 | 235 |
|
61575 | 236 |
With the \<^verbatim>\<open>-a\<close> option, one may inspect the full process environment that |
237 |
Isabelle related programs are run in. This usually contains much more |
|
238 |
variables than are actually Isabelle settings. Normally, output is a list of |
|
239 |
lines of the form \<open>name\<close>\<^verbatim>\<open>=\<close>\<open>value\<close>. The \<^verbatim>\<open>-b\<close> option causes only the values |
|
240 |
to be printed. |
|
31497 | 241 |
|
61575 | 242 |
Option \<^verbatim>\<open>-d\<close> produces a dump of the complete environment to the specified |
73581 | 243 |
file. Entries are terminated by the ASCII NUL character, i.e.\ the string |
244 |
terminator in C. Thus the Isabelle/Scala operation |
|
245 |
\<^scala_method>\<open>isabelle.Isabelle_System.init\<close> can import the settings |
|
246 |
environment robustly, and provide its own |
|
247 |
\<^scala_method>\<open>isabelle.Isabelle_System.getenv\<close> function. |
|
58618 | 248 |
\<close> |
28224 | 249 |
|
250 |
||
58618 | 251 |
subsubsection \<open>Examples\<close> |
28224 | 252 |
|
61575 | 253 |
text \<open> |
254 |
Get the location of @{setting ISABELLE_HOME_USER} where user-specific |
|
255 |
information is stored: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
256 |
@{verbatim [display] \<open>isabelle getenv ISABELLE_HOME_USER\<close>} |
28224 | 257 |
|
61406 | 258 |
\<^medskip> |
61575 | 259 |
Get the value only of the same settings variable, which is particularly |
260 |
useful in shell scripts: |
|
68219 | 261 |
@{verbatim [display] \<open>isabelle getenv -b ISABELLE_HOME_USER\<close>} |
58618 | 262 |
\<close> |
28224 | 263 |
|
264 |
||
71322 | 265 |
section \<open>Mercurial repository setup \label{sec:hg-setup}\<close> |
266 |
||
267 |
text \<open> |
|
268 |
The @{tool_def hg_setup} tool simplifies the setup of Mercurial |
|
71325 | 269 |
repositories, with hosting via Phabricator (\chref{ch:phabricator}) or SSH |
270 |
file server access. |
|
71322 | 271 |
|
272 |
@{verbatim [display] |
|
273 |
\<open>Usage: isabelle hg_setup [OPTIONS] REMOTE LOCAL_DIR |
|
274 |
||
275 |
Options are: |
|
276 |
-n NAME remote repository name (default: base name of LOCAL_DIR) |
|
277 |
-p PATH Mercurial path name (default: "default") |
|
278 |
-r assume that remote repository already exists |
|
279 |
||
280 |
Setup a remote vs. local Mercurial repository: REMOTE either refers to a |
|
281 |
Phabricator server "user@host" or SSH file server "ssh://user@host/path".\<close>} |
|
282 |
||
283 |
The \<^verbatim>\<open>REMOTE\<close> repository specification \<^emph>\<open>excludes\<close> the actual repository |
|
284 |
name: that is given by the base name of \<^verbatim>\<open>LOCAL_DIR\<close>, or via option \<^verbatim>\<open>-n\<close>. |
|
285 |
||
286 |
By default, both sides of the repository are created on demand by default. |
|
287 |
In contrast, option \<^verbatim>\<open>-r\<close> assumes that the remote repository already exists: |
|
288 |
it avoids accidental creation of a persistent repository with unintended |
|
289 |
name. |
|
290 |
||
291 |
The local \<^verbatim>\<open>.hg/hgrc\<close> file is changed to refer to the remote repository, |
|
292 |
usually via the symbolic path name ``\<^verbatim>\<open>default\<close>''; option \<^verbatim>\<open>-p\<close> allows to |
|
75161
95612f330c93
misc tuning based on comments by Heiko Eißfeldt;
wenzelm
parents:
75116
diff
changeset
|
293 |
provide a different name. |
71322 | 294 |
\<close> |
295 |
||
71324 | 296 |
subsubsection \<open>Examples\<close> |
297 |
||
298 |
text \<open> |
|
299 |
Setup the current directory as a repository with Phabricator server hosting: |
|
300 |
@{verbatim [display] \<open> isabelle hg_setup vcs@vcs.example.org .\<close>} |
|
301 |
||
302 |
\<^medskip> |
|
303 |
Setup the current directory as a repository with plain SSH server hosting: |
|
304 |
@{verbatim [display] \<open> isabelle hg_setup ssh://files.example.org/data/repositories .\<close>} |
|
305 |
||
306 |
\<^medskip> |
|
307 |
Both variants require SSH access to the target server, via public key |
|
308 |
without password. |
|
309 |
\<close> |
|
310 |
||
71322 | 311 |
|
75555
197a5b3a1ea2
promote "isabelle sync" to regular user-space tool, with proper documentation;
wenzelm
parents:
75511
diff
changeset
|
312 |
section \<open>Mercurial repository synchronization \label{sec:tool-hg-sync}\<close> |
75476 | 313 |
|
314 |
text \<open> |
|
75479 | 315 |
The @{tool_def hg_sync} tool synchronizes a local Mercurial repository with |
75511 | 316 |
a target directory. |
75476 | 317 |
|
318 |
@{verbatim [display] |
|
319 |
\<open>Usage: isabelle hg_sync [OPTIONS] TARGET |
|
320 |
||
321 |
Options are: |
|
75511 | 322 |
-F RULE add rsync filter RULE |
323 |
(e.g. "protect /foo" to avoid deletion) |
|
75476 | 324 |
-R ROOT explicit repository root directory |
325 |
(default: implicit from current directory) |
|
75493 | 326 |
-T thorough treatment of file content and directory times |
75476 | 327 |
-n no changes: dry-run |
77783
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
328 |
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME) |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
329 |
-p PORT explicit SSH port |
75479 | 330 |
-r REV explicit revision (default: state of working directory) |
77783
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
331 |
-s HOST SSH host name for remote target (default: local) |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
332 |
-u USER explicit SSH user name |
75476 | 333 |
-v verbose |
334 |
||
75479 | 335 |
Synchronize Mercurial repository with TARGET directory, |
77783
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
336 |
which can be local or remote (see options -s -p -u).\<close>} |
75476 | 337 |
|
77783
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
338 |
The \<^verbatim>\<open>TARGET\<close> specifies a directory, which can be local or an a remote SSH |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
339 |
host; the latter requires option \<^verbatim>\<open>-s\<close> for the host name. The content is |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
340 |
written directly into the target, \<^emph>\<open>without\<close> creating a separate |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
341 |
sub-directory. The special sub-directory \<^verbatim>\<open>.hg_sync\<close> within the target |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
342 |
contains meta data from the original Mercurial repository. Repeated |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
343 |
synchronization is guarded by the presence of a \<^verbatim>\<open>.hg_sync\<close> sub-directory: |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
344 |
this sanity check prevents accidental changes (or deletion!) of targets that |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
345 |
were not created by @{tool hg_sync}. |
75476 | 346 |
|
75479 | 347 |
\<^medskip> Option \<^verbatim>\<open>-r\<close> specifies an explicit revision of the repository; the default |
348 |
is the current state of the working directory (which might be uncommitted). |
|
349 |
||
75476 | 350 |
\<^medskip> Option \<^verbatim>\<open>-v\<close> enables verbose mode. Option \<^verbatim>\<open>-n\<close> enables ``dry-run'' mode: |
75511 | 351 |
operations are only simulated; use it with option \<^verbatim>\<open>-v\<close> to actually see |
352 |
results. |
|
75476 | 353 |
|
75489 | 354 |
\<^medskip> Option \<^verbatim>\<open>-F\<close> adds a filter rule to the underlying \<^verbatim>\<open>rsync\<close> command; |
355 |
multiple \<^verbatim>\<open>-F\<close> options may be given to accumulate a list of rules. |
|
75476 | 356 |
|
357 |
\<^medskip> Option \<^verbatim>\<open>-R\<close> specifies an explicit repository root directory. The default |
|
75479 | 358 |
is to derive it from the current directory, searching upwards until a |
359 |
suitable \<^verbatim>\<open>.hg\<close> directory is found. |
|
75487 | 360 |
|
75493 | 361 |
\<^medskip> Option \<^verbatim>\<open>-T\<close> indicates thorough treatment of file content and directory |
362 |
times. The default is to consider files with equal time and size already as |
|
363 |
equal, and to ignore time stamps on directories. |
|
75499 | 364 |
|
77783
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
365 |
\<^medskip> Options \<^verbatim>\<open>-s\<close>, \<^verbatim>\<open>-p\<close>, \<^verbatim>\<open>-u\<close> specify the SSH connection precisely. If no |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
366 |
SSH host name is given, the local file-system is used. An explicit port and |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
367 |
user are only required in special situations. |
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
368 |
|
75499 | 369 |
\<^medskip> Option \<^verbatim>\<open>-p\<close> specifies an explicit port for the SSH connection underlying |
76131
8b695e59db3f
clarified default: do not override port from ssh_config, which could be different from 22;
wenzelm
parents:
76105
diff
changeset
|
370 |
\<^verbatim>\<open>rsync\<close>; the default is taken from the user's \<^path>\<open>ssh_config\<close> file. |
75476 | 371 |
\<close> |
372 |
||
373 |
subsubsection \<open>Examples\<close> |
|
374 |
||
375 |
text \<open> |
|
75490
5e37ea93759d
clarified documentation: $ISABELLE_HOME is not a repository for regular releases;
wenzelm
parents:
75489
diff
changeset
|
376 |
Synchronize the current repository onto a remote host, with accurate |
75493 | 377 |
treatment of all content: |
77783
fb61887c069a
clarified underlying SSH session of "isabelle hg_sync" and "isabelle sync";
wenzelm
parents:
77567
diff
changeset
|
378 |
@{verbatim [display] \<open> isabelle hg_sync -T -s remotename test/repos\<close>} |
75476 | 379 |
\<close> |
380 |
||
381 |
||
58618 | 382 |
section \<open>Installing standalone Isabelle executables \label{sec:tool-install}\<close> |
28224 | 383 |
|
61575 | 384 |
text \<open> |
385 |
By default, the main Isabelle binaries (@{executable "isabelle"} etc.) are |
|
386 |
just run from their location within the distribution directory, probably |
|
387 |
indirectly by the shell through its @{setting PATH}. Other schemes of |
|
388 |
installation are supported by the @{tool_def install} tool: |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
389 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
390 |
\<open>Usage: isabelle install [OPTIONS] BINDIR |
28224 | 391 |
|
392 |
Options are: |
|
50132 | 393 |
-d DISTDIR refer to DISTDIR as Isabelle distribution |
28224 | 394 |
(default ISABELLE_HOME) |
395 |
||
50132 | 396 |
Install Isabelle executables with absolute references to the |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
397 |
distribution directory.\<close>} |
28224 | 398 |
|
61575 | 399 |
The \<^verbatim>\<open>-d\<close> option overrides the current Isabelle distribution directory as |
400 |
determined by @{setting ISABELLE_HOME}. |
|
28224 | 401 |
|
61575 | 402 |
The \<open>BINDIR\<close> argument tells where executable wrapper scripts for |
79059
ae682b2aab03
removed obsolete/broken isabelle_scala_script wrapper (see also abf9fcfa65cf);
wenzelm
parents:
78665
diff
changeset
|
403 |
@{executable "isabelle"} and @{executable isabelle_java} should be |
61575 | 404 |
placed, which is typically a directory in the shell's @{setting PATH}, such |
405 |
as \<^verbatim>\<open>$HOME/bin\<close>. |
|
48815 | 406 |
|
61406 | 407 |
\<^medskip> |
61575 | 408 |
It is also possible to make symbolic links of the main Isabelle executables |
409 |
manually, but making separate copies outside the Isabelle distribution |
|
410 |
directory will not work! |
|
411 |
\<close> |
|
28224 | 412 |
|
413 |
||
58618 | 414 |
section \<open>Creating instances of the Isabelle logo\<close> |
28224 | 415 |
|
61575 | 416 |
text \<open> |
73399 | 417 |
The @{tool_def logo} tool creates variants of the Isabelle logo, for |
418 |
inclusion in PDF{\LaTeX} documents. |
|
419 |
||
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
420 |
@{verbatim [display] |
73399 | 421 |
\<open>Usage: isabelle logo [OPTIONS] [NAME] |
28224 | 422 |
|
423 |
Options are: |
|
73399 | 424 |
-o FILE alternative output file |
425 |
-q quiet mode |
|
426 |
||
427 |
Create variant NAME of the Isabelle logo as "isabelle_name.pdf".\<close>} |
|
48936 | 428 |
|
73399 | 429 |
Option \<^verbatim>\<open>-o\<close> provides an alternative output file, instead of the default in |
430 |
the current directory: \<^verbatim>\<open>isabelle_\<close>\<open>name\<close>\<^verbatim>\<open>.pdf\<close> with the lower-case version |
|
431 |
of the given name. |
|
48936 | 432 |
|
73399 | 433 |
\<^medskip> |
72316
3cc6aa405858
clarified "isabelle logo", after discontinuation of DVI output (see 564012e31db1);
wenzelm
parents:
72309
diff
changeset
|
434 |
Option \<^verbatim>\<open>-q\<close> omits printing of the resulting output file name. |
48936 | 435 |
|
61406 | 436 |
\<^medskip> |
61575 | 437 |
Implementors of Isabelle tools and applications are encouraged to make |
73399 | 438 |
derived Isabelle logos for their own projects using this template. The |
439 |
license is the same as for the regular Isabelle distribution (BSD). |
|
61575 | 440 |
\<close> |
28224 | 441 |
|
442 |
||
58618 | 443 |
section \<open>Output the version identifier of the Isabelle distribution\<close> |
28224 | 444 |
|
58618 | 445 |
text \<open> |
48602 | 446 |
The @{tool_def version} tool displays Isabelle version information: |
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
447 |
@{verbatim [display] |
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
448 |
\<open>Usage: isabelle version [OPTIONS] |
41511 | 449 |
|
450 |
Options are: |
|
451 |
-i short identification (derived from Mercurial id) |
|
73481 | 452 |
-t symbolic tags (derived from Mercurial id) |
41511 | 453 |
|
61407
7ba7b8103565
@{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents:
61406
diff
changeset
|
454 |
Display Isabelle version information.\<close>} |
41511 | 455 |
|
61406 | 456 |
\<^medskip> |
79500 | 457 |
The default is to output the Isabelle distribution name, e.g.\ |
80157 | 458 |
``\<^verbatim>\<open>Isabelle2024\<close>''. |
41511 | 459 |
|
73481 | 460 |
\<^medskip> |
461 |
Option \<^verbatim>\<open>-i\<close> produces a short identification derived from the Mercurial id |
|
462 |
of the @{setting ISABELLE_HOME} directory; option \<^verbatim>\<open>-t\<close> prints version tags |
|
463 |
(if available). |
|
464 |
||
465 |
These options require either a repository clone or a repository archive |
|
466 |
(e.g. download of |
|
73480
0e880b793db1
support repository archives (without full .hg directory);
wenzelm
parents:
73399
diff
changeset
|
467 |
\<^url>\<open>https://isabelle.sketis.net/repos/isabelle/archive/tip.tar.gz\<close>). |
58618 | 468 |
\<close> |
28224 | 469 |
|
78665 | 470 |
|
471 |
section \<open>Managed installations of \<^text>\<open>Haskell\<close> and \<^text>\<open>OCaml\<close>\<close> |
|
472 |
||
473 |
text \<open> |
|
474 |
Code generated in Isabelle \<^cite>\<open>"Haftmann-codegen"\<close> for \<^text>\<open>SML\<close> |
|
475 |
or \<^text>\<open>Scala\<close> integrates easily using Isabelle/ML or Isabelle/Scala |
|
476 |
respectively. |
|
477 |
||
478 |
To facilitate integration with further target languages, there are |
|
479 |
tools to provide managed installations of the required ecosystems: |
|
480 |
||
481 |
\<^item> Tool @{tool_def ghc_setup} provides a basic \<^text>\<open>Haskell\<close> \<^cite>\<open>"Thompson-Haskell"\<close> environment |
|
482 |
consisting of the Glasgow Haskell Compiler and the Haskell Tool Stack. |
|
483 |
||
484 |
\<^item> Tool @{tool_def ghc_stack} provides an interface to that \<^text>\<open>Haskell\<close> |
|
485 |
environment; use \<^verbatim>\<open>isabelle ghc_stack --help\<close> for elementary |
|
486 |
instructions. |
|
487 |
||
488 |
\<^item> Tool @{tool_def ocaml_setup} provides a basic \<^text>\<open>OCaml\<close> \<^cite>\<open>OCaml\<close> environment |
|
489 |
consisting of the OCaml compiler and the OCaml Package Manager. |
|
490 |
||
491 |
\<^item> Tool @{tool_def ocaml_opam} provides an interface to that \<^text>\<open>OCaml\<close> |
|
492 |
environment; use \<^verbatim>\<open>isabelle ocaml_opam --help\<close> for elementary |
|
493 |
instructions. |
|
494 |
\<close> |
|
495 |
||
67399 | 496 |
end |