Skip to content

Commit 92207b5

Browse files
committed
docs: update docs on distributions
1 parent db60d69 commit 92207b5

File tree

3 files changed

+96
-23
lines changed

3 files changed

+96
-23
lines changed

docs/distributions.rst

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
Distribution Archives
55
=====================
66

7-
The output of a build is referred to as a Python *distribution*.
7+
This project produces tarball archives containing Python distributions.
88

9-
A distribution is a zstandard-compressed tar file. All paths inside the
10-
tar archive are prefixed with ``python/``. Within the ``python/`` directory
11-
are the following well-known paths:
9+
Full Archive
10+
============
11+
12+
The canonical output of this project's build system are ``.tar.zst``
13+
(zstandard compressed tarballs) files.
14+
15+
All files within the tar are prefixed with ``python/``.
16+
17+
Within the ``python/`` directory are the following well-known paths:
1218

1319
PYTHON.json
1420
Machine readable file describing this Python distribution.
@@ -22,7 +28,7 @@ The ``PYTHON.json`` file should be read to determine where specific entities
2228
are located within the archive.
2329

2430
PYTHON.json File
25-
================
31+
----------------
2632

2733
The ``PYTHON.json`` file describes the Python distribution in a machine
2834
readable manner. This file is meant to be opened by downstream consumers
@@ -572,3 +578,23 @@ system
572578

573579
System libraries are typically passed into the linker by name only and
574580
found using default library search paths.
581+
582+
Install Only Archive
583+
====================
584+
585+
At release time, this project produces tar files containing just the
586+
Python installation, without the ``PYTHON.json`` or build files from
587+
the full ``.tar.zst`` archives. These are referred to as *install only*
588+
archives.
589+
590+
An *install only* archive is created by taking a ``.tar.zst`` and
591+
rewriting ``python/install/*`` to ``python/*``. All files not under
592+
``python/install/*`` are not carried forward to the *install only*
593+
archive.
594+
595+
The fastest available build for a given target is used for the *install
596+
only* archive. Builds are generally preferred in the following order:
597+
``pgo+lto``, ``pgo``, ``lto``, ``noopt``.
598+
599+
For maximum compatibility, gzipped compressed versions of the
600+
*install only* archives are made available.

docs/index.rst

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,36 @@ Python Standalone Builds
33

44
This project produces self-contained, highly-portable Python
55
distributions. These Python distributions contain a fully-usable,
6-
full-featured Python installation as well as their build artifacts
7-
(object files, libraries, etc).
8-
9-
The included build artifacts can be recombined by downstream
10-
repackagers to derive a custom Python distribution, possibly without
11-
certain features like SQLite and OpenSSL. This is useful for
12-
embedding Python in a larger binary, where a full Python is
13-
often not needed and where interfacing with the Python C API
14-
is desirable. (See the
15-
`PyOxidizer <https://github.com/indygreg/PyOxidizer>`_ sister project
16-
for such a downstream repackager.)
6+
full-featured Python installation: most extension modules from
7+
the Python standard library are present and their library
8+
dependencies are either distributed with the distribution or
9+
are statically linked.
1710

1811
The Python distributions are built in a manner to minimize
1912
run-time dependencies. This includes limiting the CPU instructions
2013
that can be used and limiting the set of shared libraries required
2114
at run-time. The goal is for the produced distribution to work on
2215
any system for the targeted architecture.
2316

17+
Some distributions ship with their build artifacts (object files,
18+
libraries, etc) along with rich metadata describing the distribution
19+
and how it was assembled. The build artifacts can be recombined by
20+
downstream repackagers to derive a custom Python distribution, possibly
21+
without certain features like SQLite and OpenSSL. This is useful for
22+
embedding Python in a larger binary. See the
23+
`PyOxidizer <https://github.com/indygreg/PyOxidizer>`_ sister project
24+
for such a downstream repackager.
25+
2426
.. toctree::
2527
:maxdepth: 2
2628
:caption: Contents:
2729

28-
building.rst
29-
running.rst
30-
quirks.rst
31-
technotes.rst
32-
distributions.rst
33-
status.rst
30+
running
31+
building
32+
quirks
33+
technotes
34+
distributions
35+
status
3436

3537
Indices and tables
3638
==================

docs/running.rst

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,55 @@
44
Running Distributions
55
=====================
66

7+
Obtaining Distributions
8+
=======================
9+
10+
Pre-built distributions are published as releases on GitHub at
11+
https://github.com/indygreg/python-build-standalone/releases.
12+
Simply go to that page and find the latest release along with
13+
its release notes.
14+
15+
Published distributions vary by their:
16+
17+
* Python version
18+
* Target machine architecture
19+
* Build configuration
20+
* Archive flavor
21+
22+
The Python version is hopefully pretty obvious.
23+
24+
The target machine architecture defines the CPU type and operating
25+
system the distribution runs on. We use LLVM target triples.
26+
27+
The build configuration denotes how Python and its dependencies were built.
28+
Common configurations include:
29+
30+
``pgo+lto``
31+
Profile guided optimization and link-time optimization. These should be
32+
the fastest distributions since they have the most build-time
33+
optimizations.
34+
35+
``pgo``
36+
Profile guided optimization.
37+
38+
``lto``
39+
Link-time optimization.
40+
41+
``noopt``
42+
A regular optimized build without PGO or LTO.
43+
44+
``debug``
45+
A debug build. No optimizations.
46+
47+
The archive flavor denotes the content in the archive. See
48+
:ref:`distributions` for more. Casual users will likely want to use the
49+
``install_only`` archive, as most users do not need the build artifacts
50+
present in the ``full`` archive.
51+
752
Extracting Distributions
853
========================
954

10-
Distributions are defined as zstandard-compressed tarballs.
55+
Distributions are defined as zstandard or gzip compressed tarballs.
1156

1257
Modern versions of ``tar`` support zstandard and you can extract
1358
like any normal archive::

0 commit comments

Comments
 (0)