1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Copyright 2016-2021 the Tectonic Project
// Licensed under the MIT License.
//! Implementations of Tectonic bundle formats.
//!
//! A Tectonic “bundle” is a collection of TeX support files. In code, bundles
//! implement the [`Bundle`] trait defined here, although most of the action in
//! a bundle will be in its implementation of [`tectonic_io_base::IoProvider`].
//!
//! This crate provides the following bundle implementations:
//!
//! - [`cache::CachingBundle`] for access to remote bundles with local
//! filesystem caching.
//! - [`dir::DirBundle`] turns a directory full of files into a bundle; it is
//! useful for testing and lightweight usage.
//! - [`zip::ZipBundle`] for a ZIP-format bundle.
use ;
use ;
use ;
use StatusBackend;
/// A trait for bundles of Tectonic support files.
///
/// A “bundle” is an [`IoProvider`] with a few special properties. Bundles are
/// read-only, and their contents can be enumerated In principle a bundle is
/// completely defined by its file contents, which can be summarized by a
/// cryptographic digest, obtainable using the [`Self::get_digest`] method: two
/// bundles with the same digest should contain exactly the same set of files,
/// and if any aspect of a bundle’s file contents change, so should its digest.
/// Finally, it is generally expected that a bundle will contain a large number
/// of TeX support files, and that you can generate one or more TeX format files
/// using only the files contained in a bundle.
/// The URL of the default bundle.
///
/// This is a hardcoded URL of a default bundle that will provide some
/// "sensible" set of TeX support files. The higher-level `tectonic` crate
/// provides a configuration mechanism to allow the user to override this
/// setting, so you should use that if you are in a position to do so.
///
/// This URL will be embedded in the binaries that you create, which may be used
/// for years into the future, so it needs to be durable and reliable. At the
/// moment, the URL is hosted on `archive.org` and redirects to a web-based
/// storage service that has changed a few times over the years. Note that
/// `archive.org` is blocked in China, causing problems for that potential user
/// base.
pub const FALLBACK_BUNDLE_URL: &str =
"https://archive.org/services/purl/net/pkgwpub/tectonic-default";
/// Open the fallback bundle.
///
/// This is essentially the default Tectonic bundle, but the higher-level
/// `tectonic` crate provides a configuration mechanism to allow the user to
/// override the [`FALLBACK_BUNDLE_URL`] setting, and that should be preferred
/// if you’re in a position to use it.