Skip to content

Commit 932fe3e

Browse files
author
cranko
committed
Release commit created with Cranko.
+++ cranko-release-info-v1 [[projects]] qnames = ["tectonic_xdv", "cargo"] version = "0.1.10" age = 4 [[projects]] qnames = ["tectonic_cfg_support", "cargo"] version = "0.1.1" age = 4 [[projects]] qnames = ["tectonic", "cargo"] version = "0.3.3" age = 0 +++
2 parents 9bf53df + fdaedbf commit 932fe3e

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# tectonic 0.3.3 (2020-11-16)
2+
3+
- When testing whether the engine needs rerunning, compare the new file to the
4+
entire old file, not just the part that was read by the engine. Should fix
5+
unnecessary reruns in some less-common cases. (#679, #681, @pkgw)
6+
7+
18
# tectonic 0.3.2 (2020-11-14)
29

310
- Slightly alter how some filenames are looked up. Before, if the TeX code

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[package]
66
name = "tectonic"
7-
version = "0.3.2"
7+
version = "0.3.3"
88
authors = ["Peter Williams <[email protected]>"]
99
build = "build.rs"
1010
description = """

src/engines/mod.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,20 @@ impl<'a> ExecutionState<'a> {
469469
let p: *const InputHandle = &*self.input_handles[i];
470470

471471
if p == handle {
472-
let ih = self.input_handles.swap_remove(i);
472+
let mut ih = self.input_handles.swap_remove(i);
473+
let mut rv = false;
474+
475+
if let Err(e) = ih.scan_remainder() {
476+
tt_warning!(self.status, "error closing out input {}", ih.name().to_string_lossy(); e);
477+
rv = true;
478+
}
479+
473480
let (name, digest_opt) = ih.into_name_digest();
474481
self.events.input_closed(name, digest_opt);
475-
return false;
482+
return rv;
476483
}
477484
}
485+
478486
// TODO: Handle the error better. This indicates a bug in the engine.
479487
tt_error!(
480488
self.status,

src/io/mod.rs

+31
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,37 @@ impl InputHandle {
141141
self.inner
142142
}
143143

144+
/// Read any remaining data in the file and incorporate them into the
145+
/// digest. This helps the rerun detection logic work correctly in
146+
/// the somewhat-unusual case that a file is read then written, but
147+
/// only part of the file is read, not the entire thing. This seems
148+
/// to happen with biblatex XML state files.
149+
pub fn scan_remainder(&mut self) -> Result<()> {
150+
const BUFSIZE: usize = 1024;
151+
let mut buf: [u8; BUFSIZE] = [0; BUFSIZE];
152+
153+
loop {
154+
let n = match self.inner.read(&mut buf[..]) {
155+
Ok(n) => n,
156+
157+
// There are times when the engine tries to open and read
158+
// directories. When closing out such a handle, we'll get this
159+
// error, but we should ignore it.
160+
Err(ref ioe) if ioe.raw_os_error() == Some(libc::EISDIR) => return Ok(()),
161+
162+
Err(e) => return Err(e.into()),
163+
};
164+
165+
if n == 0 {
166+
break;
167+
}
168+
169+
self.digest.update(&buf[..n]);
170+
}
171+
172+
Ok(())
173+
}
174+
144175
/// Consumes the object and returns the SHA256 sum of the content that was
145176
/// read. No digest is returned if there was ever a seek on the input
146177
/// stream, since in that case the results will not be reliable. We also

0 commit comments

Comments
 (0)