Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 3908f82

Browse files
authored
Merge pull request #14 from rm-dr/rework
Huge rewrite, many fixes
2 parents 8710e25 + ce2e4c4 commit 3908f82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2307
-55556
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = false
13+
14+
[*.sh]
15+
indent_style = tab

.gitignore

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
__pycache__/
2-
/state
3-
/zip2tarindex/target/
2+
/scripts/*/target/
3+
4+
/build
5+
/tests/build
6+
7+
*.ignore
8+
*.tar
9+
*.tar.xz

README.md

+65-92
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,115 @@
1-
# Tectonic TeXLive Bundle Builder
1+
# Tectonic Bundles
2+
3+
This repository contains scripts for building bundles for
4+
[Tectonic](https://tectonic-typesetting.github.io), each of which is a complete TeX distribution.
5+
6+
**You do not need this repository to build Tectonic.** \
7+
You only need these scripts if you want to make your own bundles of TeX files.
8+
9+
**Warning:** The `./tests` do not work yet, they need to be reworked for the new bundle spec!
10+
211

3-
This repository contains scripts for building “bundles” for
4-
[Tectonic](https://tectonic-typesetting.github.io) based on [Norbert Preining’s
5-
Git mirror](http://git.texlive.info/texlive/) of [the TeXLive Subversion
6-
repository](http://tug.org/svn/texlive/).
712

8-
*You do not need this repository to build Tectonic.* You only need these scripts
9-
if you want to make your own bundle of TeX files based on the TeXLive sources.
1013

1114

1215
## Prerequisites
1316

1417
To use these tools, you will need:
1518

16-
- An installation of [Docker](https://www.docker.com/).
17-
- A checkout of the Preining TeXLive Git repository
18-
(`git://git.texlive.info/texlive.git`), placed or symlinked in a subdirectory
19-
named `state/repo` below this file. Be aware that this repository currently
20-
weighs in at **40 gigabytes**!
21-
- A Rust toolchain if you want to create “indexed tar” bundles. (So, you don’t
22-
need Rust if you want to create a bundle and test it locally.)
19+
- Bash, `pv`, GNU `patch` and `diff`
20+
- A [TeXlive tarball](https://tug.org/texlive/acquire-tar.html). Different bundles need different TeXlive versions.
21+
- A Rust toolchain (`cargo`).
2322

24-
Data files associated with the staging process will land in other subdirectories
25-
of `state/`.
2623

2724

28-
## Getting started: creating the bundler image
2925

30-
The first step is to create a Docker container that will host most of the
31-
computations — this promotes reproducibility and portability, regardless of what
32-
kind of system you are using. To create this container, run:
26+
## Bundles:
27+
Each directory in `./bundles` is a bundle specification, which contains everything we need to reproducibly build a bundle.\
28+
See [`./bundles/README.md`](./bundles/README.md) for details.
3329

34-
```
35-
./driver.sh build-image
36-
```
30+
The following bundles are available:
31+
- `texlive2023-nopatch`: based on `texlive2023-20230313`.
3732

3833

39-
## Creating TeXLive containers
4034

41-
The next step is to create TeXLive “containers” — which are different than
42-
Docker containers. A *Docker* container is an encapsulated Linux machine that
43-
provides a reproducible build environment. *TeXLive* containers are archives
44-
containing the files associated with the various TeXLive packages.
4535

46-
To create TeXLive container files for all of the packages associated with your
47-
TeXLive checkout, run:
4836

49-
```
50-
./driver.sh update-containers
51-
```
5237

53-
This will use the Docker container to generate TeXLive container files in
54-
`state/containers`. *The results of this step will depend on what version of the
55-
TeXLive tree you currently have checked out in `state/repo`.*
38+
## Build Process:
39+
Before building any bundles, acquire a [TeXlive tarball](https://tug.org/texlive/acquire-tar.html) with a version that matches the bundle you want to build. These are usually distributed as compressed tarballs, which you'll have to manually decompress. **`build.sh` expects an uncompressed `.tar` file!** It checks the hash of this file, and will refuse to work if that hash doesn't match.
5640

41+
The tarball you end up with should have a name of the form `texlive-YYYYMMDD-texmf.tar`. **Do not rename this file!**
5742

58-
## Creating a TeXLive installation tree
5943

60-
Run:
6144

62-
```
63-
./driver.sh make-installation bundles/tlextras
64-
./driver.sh install-packages bundles/tlextras
65-
```
45+
To build a bundle, run the following jobs. These **must** be run in order!
6646

67-
(In the future, we might add more specifications to the `bundles` directory for
68-
creating specialized bundles. The `tlextras` bundle is the one-size-fits-all
69-
default bundle.)
47+
- `./build.sh <tarball> extract`: extracts texlive into `./build/texlive/<version>`\
48+
This also generates `TEXLIVE-SHA256SUM` in the texlive version directory.
7049

50+
- `./build.sh <bundle> content`: assemble all files into a bundle at `./build/output/<bundle>content`.\
51+
This will delete all bundles in `output/<bundle>/`, move them elsewhere if you still need them.
7152

72-
## Updating patches
53+
Once `./build/output/content` has been created, run any of the following commands to package the bundle.\
54+
See [`builder/README.md`](./scripts/builder/README.md) for details.
7355

74-
As of TeXLive 2021, we have bitten the bullet and decided to maintain some
75-
patches against the TeXLive tree.
56+
- `./build.sh <bundle> ttbv1`: create a ttb (version 1) bundle from the content directory.\
57+
TTB bundles may be used locally or hosted on the web.
7658

77-
Maintaining long-lived patches is never fun, but Git makes life a lot easier
78-
than it could be. We use a secondary branch named `vendor-pristine` to help
79-
maintain our patches. The way we do that is to copy the “vendor” (TeXLive
80-
original) files into branch, then use `git merge` to update the main branch with
81-
whatever changes have been introduced between TeXLive updates.
8259

83-
First, bump the version of your bundle and run the standard update steps through
84-
the `install-packages` step described above. Make sure that the current branch
85-
is clean with no changes in the working tree or index. Then run:
8660

87-
```
88-
./driver.sh get-vendor-pristine bundles/tlextras
89-
```
9061

91-
Then follow the suggested workflow as printed out by that command. The basic
92-
plan is to commit the vendor files into the bundle’s `patched/` directory *on
93-
the vendor-pristine* branch, then merge them back into the main branch.
9462

9563

96-
## Exporting to a Zip-format bundle
64+
## Output Files
9765

98-
Run:
9966

100-
```
101-
./driver.sh make-zipfile bundles/tlextras
102-
```
67+
**`./build.sh <bundle> content` produces the following:**
68+
- `./build/output/<bundle>/content`: contains all bundle files. It is organized by source: files from the bundle's `include` dir will be under `./include`, texlive files will be under `./texlive`, and so on. See `main.rs` of `scripts/select`.
69+
This directory also contains some metadata:
70+
- `content/FILES`: each line of this file is `<path> <hash>`, sorted by file name.\
71+
Files with identical names are included.\
72+
Files not in any search path are also included.\
73+
`<hash>` is either a hex sha256 of that file's contents, or `nohash` for a few special files.
74+
- `content/SHA256SUM`: The sha256sum of `content/FILES`. This string uniquely defines this bundle.
75+
- `content/SEARCH`: File search order for this bundle. See bundle spec documentation.
76+
- `search-report`: debug file. Lists all directories that will not be searched by the rules in `search-order`.\
77+
The entries in this file are non-recursive: If `search-report` contains a line with `/texlive`, this means that direct children of `/texlive` (like `/texlive/file.tex`) will not be found, but files in *subdirectories* (like `/texlive/tex/file.tex`) may be.
10378

104-
This will create a large Zip-format bundle file with a name something like
105-
`state/artifacts/tlextras-2020.0r0/tlextras-2020.0r0.zip`. Such a bundle file
106-
can be used with the `tectonic` command-line program with the `-b` argument.
10779

80+
**`./build.sh <bundle> ttbv1` produces the following:**
81+
- `<bundle>.ttb`: the bundle. Note that the ttb version is *not* included in the extension.
82+
- Index location and length are printed once this job completes.
83+
- You can extract files from this bundle by running `dd if=file.ttb ibs=1 skip=<start> count=<len> | gunzip`
10884

109-
## Converting to an “indexed tar” bundle
11085

111-
This step is needed to create a bundle that will be hosted on the web. Run:
11286

113-
```
114-
./driver.sh make-itar bundles/tlextras
115-
```
87+
## Testing
11688

117-
This will create both the `.tar` and the `.tar.index.gz` files that need to be
118-
uploaded for use as a web bundle.
89+
Tests are under `./tests`, and are currently a work in progress. All tests are run through `test.sh` as follows: `./test.sh <path-to-ttb> <test set>`.
11990

91+
Tests require the following:
92+
- a `ttb` bundle (local or remote)
93+
- a recent installation of Tectonic
12094

121-
## Testing
95+
### Test Sets
96+
The following test sets are avaiable:
97+
- `files`, which tries to compile all files under `tests/files` and `tests/formats`
98+
- `classes`, which tries to compile a simple document using `tests/classes.list`
12299

123-
Bundle definitions come with testing information. To test a bundle, you need the
124-
`tectonic` command-line program to be in your $PATH, as well as a Python 3
125-
interpreter and the [toml] package.
100+
Note that most test files contain comments explaining the reason and expected outcome of the test.
126101

127-
[toml]: https://pypi.org/project/toml/
128102

129-
Test scripts are located in the `tests` directory. Currently available:
130103

131-
- `tests/classes.py`: basic compilation smoketest of the documentclasses in a bundle
132-
- `tests/formats.py`: test generation of the format files defined in the bundle
133-
- `tests/packages.py`: test loading if the package (style) files defined in the
134-
bundle. There are thousands of style files in a typical bundle, so this
135-
program uses a framework to run a random-but-reproducible subset of the tests.
136-
See the header comment in the Python file for more information.
104+
### Test Output
105+
All test output ends up under `tests/build`
137106

107+
**Output for `files`:**
108+
- `files/logs`: log files for all builds (passed or failed)
109+
- `files/*.{pdf,fmt,etc}`: output files for each build
138110

139-
#### Copyright and Licensing
140111

141-
The infrastructure scripts in this repository are licensed under the MIT
142-
License. Their copyright is assigned to the Tectonic Project.
112+
**Output for `classes`
113+
- `failed`: classes that failed to compile
114+
- `passed`: classes that complied without error
115+
- `logs`: log files for all compile jobs

0 commit comments

Comments
 (0)