Skip to content

Commit

Permalink
Release commit created with Cranko.
Browse files Browse the repository at this point in the history
+++ cranko-release-info-v1
[[projects]]
qnames = ["tectonic_xdv", "cargo"]
version = "0.1.10"
age = 1

[[projects]]
qnames = ["tectonic_cfg_support", "cargo"]
version = "0.1.1"
age = 1

[[projects]]
qnames = ["tectonic", "cargo"]
version = "0.3.0"
age = 0

+++
  • Loading branch information
cranko committed Nov 1, 2020
2 parents 1ebf90c + d313948 commit 180a4fd
Show file tree
Hide file tree
Showing 151 changed files with 5,633 additions and 3,162 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
# tectonic 0.3.0 (2020-11-01)

The 0.3 series updates the core Tectonic engines to align with the code in
[TeXLive 2020.0][tl2020.0]. The default “bundle” of support files will soon be
updated to match TeXLive 2020.0 as well. Standard usages should work if you use
an older version of Tectonic with the new bundle, and vice versa, but we
recommend that you update your installations to the 0.3 promptly if you can.

[tl2020.0]: https://www.tug.org/texlive/

This release introduces a straightforward but **breaking change** to the API of
the `tectonic` Rust crate, documented below.

For context, Tectonic’s core TeX implementation is forked from the [XeTeX]
engine. Accumulated changes to XeTeX are periodically reviewed and imported into
Tectonic, a process that must be done manually because Tectonic’s modernized
developer and user experiences demand a huge amount of customization. (The
scripts to support the first stage of this process may be found in the
[tectonic-staging] repository.) It has been a while since the last
synchronization, but this release incorporates the new changes introduced
between the last update and the release of TeXLive 2020.0.

[XeTeX]: https://tug.org/xetex/
[tectonic-staging]: https://github.com/tectonic-typesetting/tectonic-staging

The changes for TeXLive 2020.0 include:

- New low-level primitives including `\filemoddate`, `\filedump`,
`\uniformvariate`, `\elapsedtime`, and a few others.
- Tweaks to how font design sizes are mapped to TeX values
- New magic numbers used in PDF last x/y position accounting,
instead of `cur_[hv]_offset`.
- Don't `print_raw_char` in `show_context` with `trick_buf`
- Back up `cur_cs` in `scan_keyword` and `compare_strings`.
- Handle `XETEX_MATH_GIVEN` in `scan_something_internal`
- If encountering an unexpandable primitive in `scan_something_internal`,
try to deal with it. Ditto for `scan_int`.
- Do something different with active characters in `str_toks_cat`
- Rework how file names are scanned.
- Defend against undefined eTeX registers in `main_control`
- Some `uc_hyph` tweak deep in the linebreaking algorithm

There are also numerous changes in Tectonic’s included `xdvipdfmx`.

The implementation of the `\filemoddate` API required a **breaking change** to
the API of the `tectonic` Rust crate:

- We needed to add more data to the data structures of the `MemoryIo` provider.
Migration should be pretty easy: instead of `files` containing a bunch of
`Vec<u8>`s, it now contains a bunch of `MemoryFileInfo` structs that contain a
`Vec<u8>` field named `data`. So you just need to add some `.data` field
accessors to existing code. This API clearly needs some polish to allow
greater stability going forward.

Other changes:

- Issue a warning if `xdvipdfmx` needs to translate a VF font to PK format,
which is unimplemented in Tectonic (it relies on `mktexpk`) and so causes
failures on certain documents that work with XeTeX.
- The Windows [vcpkg]-based build is temporarily disabled, as vcpkg currently has
[a debilitating issue][vcpkg-issue] relating to SSL on Windows.
- There is a new `-Z continue-on-errors` unstable option that tells the engine
to emulate the classic TeX style of plunging on ahead even in the face of
severe errors. This is a nice example of the possibilities unlocked by the new
`-Z` infrastructure introduced in 0.2!

[vcpkg]: https://github.com/microsoft/vcpkg
[vcpkg-issue]: https://github.com/tectonic-typesetting/tectonic/issues/668


# tectonic 0.2.0 (2020-10-21)

The 0.2 series finally adds "unstable" `-Z` flags! These allow you to configure
Expand Down
19 changes: 16 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[package]
name = "tectonic"
version = "0.2.0"
version = "0.3.0"
authors = ["Peter Williams <[email protected]>"]
build = "build.rs"
description = """
Expand Down Expand Up @@ -79,6 +79,7 @@ profile = []
# libz-sys = "^1.0"

[dev-dependencies]
filetime = "^0.2"
futures = "0.1"
headers = "0.2"
hyper = "0.12"
Expand All @@ -87,7 +88,7 @@ tokio = "0.1.22"

[package.metadata.vcpkg]
git = "https://github.com/microsoft/vcpkg"
rev = "76a7e9248fb3c57350b559966dcaa2d52a5e4458"
rev = "527c0e04332db88a7906e469dca1d9f0a35726fc"

[package.metadata.vcpkg.target]
x86_64-apple-darwin = { install = ["freetype","harfbuzz[icu,graphite2]"] }
Expand Down
10 changes: 9 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ impl DepState {
let mut include_paths = vec![];

for dep in VCPKG_LIBS {
let library = vcpkg::find_package(dep)
let library = vcpkg::Config::new()
.cargo_metadata(false)
.find_package(dep)
.unwrap_or_else(|e| panic!("failed to load package {} from vcpkg: {}", dep, e));
include_paths.extend(library.include_paths.iter().cloned());
}
Expand Down Expand Up @@ -161,6 +163,11 @@ impl DepState {
}

DepState::VcPkg(_) => {
for dep in VCPKG_LIBS {
vcpkg::find_package(dep).unwrap_or_else(|e| {
panic!("failed to load package {} from vcpkg: {}", dep, e)
});
}
if target.contains("-linux-") {
// add icudata to the end of the list of libs as vcpkg-rs
// does not order individual libraries as a single pass
Expand Down Expand Up @@ -311,6 +318,7 @@ fn main() {
.file("tectonic/dpx-mem.c")
.file("tectonic/dpx-mfileio.c")
.file("tectonic/dpx-mpost.c")
.file("tectonic/dpx-mt19937ar.c")
.file("tectonic/dpx-numbers.c")
.file("tectonic/dpx-otl_conf.c")
.file("tectonic/dpx-otl_opt.c")
Expand Down
10 changes: 7 additions & 3 deletions cfg_support/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# tectonic_cfg_support 0.1.1 (2020-10-21)
# See elsewhere for changelog

- No code changes; just issuing a new release to update deps and silence
Cranko's change detection.
This project’s release notes are curated from the Git history of its main
branch. You can find them by looking at [the version of this file on the
`release` branch][branch] or the [GitHub release history][gh-releases].

[branch]: https://github.com/tectonic-typesetting/tectonic/blob/release/cfg_support/CHANGELOG.md
[gh-releases]: https://github.com/tectonic-typesetting/tectonic/releases
15 changes: 9 additions & 6 deletions dist/azure-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,15 @@ parameters:
TARGET: x86_64-apple-darwin
TOOLCHAIN: stable

- name: windows
vmImage: windows-2019
params: {}
vars:
TARGET: x86_64-pc-windows-msvc
TOOLCHAIN: stable-x86_64-pc-windows-msvc
# Temporarily disabled due to vcpkg brokenness that looks like it
# will take a little while to resolve. Tracking issue:
# https://github.com/tectonic-typesetting/tectonic/issues/668
# - name: windows
# vmImage: windows-2019
# params: {}
# vars:
# TARGET: x86_64-pc-windows-msvc
# TOOLCHAIN: stable-x86_64-pc-windows-msvc

- name: crossBuilds
type: object
Expand Down
2 changes: 1 addition & 1 deletion reference_sources
Submodule reference_sources updated 473 files
2 changes: 1 addition & 1 deletion src/bin/tectonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fn inner(args: CliOptions, config: PersistentConfig, status: &mut dyn StatusBack
engine
);

status.dump_error_logs(&output);
status.dump_error_logs(&output.data);
}
}
}
Expand Down
43 changes: 25 additions & 18 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@ use std::fs::File;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::result::Result as StdResult;
use std::str::FromStr;
use std::time::SystemTime;

use crate::digest::DigestData;
use crate::engines::IoEventBackend;
use crate::errors::{ErrorKind, Result, ResultExt};
use crate::io::{Bundle, InputOrigin, IoProvider, IoSetup, IoSetupBuilder, OpenResult};
use crate::status::StatusBackend;
use crate::unstable_opts::UnstableOptions;
use crate::{ctry, errmsg, tt_error, tt_note, tt_warning};
use crate::{BibtexEngine, Spx2HtmlEngine, TexEngine, TexResult, XdvipdfmxEngine};
use std::result::Result as StdResult;
use crate::{
ctry,
digest::DigestData,
engines::IoEventBackend,
errmsg,
errors::{ErrorKind, Result, ResultExt},
io::{
memory::MemoryFileCollection, Bundle, InputOrigin, IoProvider, IoSetup, IoSetupBuilder,
OpenResult,
},
status::StatusBackend,
tt_error, tt_note, tt_warning,
unstable_opts::UnstableOptions,
BibtexEngine, Spx2HtmlEngine, TexEngine, TexResult, XdvipdfmxEngine,
};

/// Different patterns with which files may have been accessed by the
/// underlying engines. Once a file is marked as ReadThenWritten or
Expand Down Expand Up @@ -845,7 +852,7 @@ impl ProcessingSession {

let mut n_skipped_intermediates = 0;

for (name, contents) in &*self.io.mem.files.borrow() {
for (name, file) in &*self.io.mem.files.borrow() {
if name == self.io.mem.stdout_key() {
continue;
}
Expand Down Expand Up @@ -882,7 +889,7 @@ impl ProcessingSession {
continue;
}

if contents.is_empty() {
if file.data.is_empty() {
status.note_highlighted(
"Not writing ",
&format!("`{}`", sname),
Expand All @@ -892,15 +899,15 @@ impl ProcessingSession {
}

let real_path = root.join(name);
let byte_len = Byte::from_bytes(contents.len() as u128);
let byte_len = Byte::from_bytes(file.data.len() as u128);
status.note_highlighted(
"Writing ",
&format!("`{}`", real_path.to_string_lossy()),
&format!(" ({})", byte_len.get_appropriate_unit(true).to_string()),
);

let mut f = File::create(&real_path)?;
f.write_all(contents)?;
f.write_all(&file.data)?;
summ.got_written_to_disk = true;

if let Some(ref mut mf_dest) = mf_dest_maybe {
Expand Down Expand Up @@ -1009,10 +1016,10 @@ impl ProcessingSession {
.files
.borrow()
.get(&self.tex_aux_path)
.map(|data| {
.map(|file| {
// We used to use aho-corasick crate here, but it was removed to reduce the code
// size.
data.windows(BIBDATA.len()).any(|s| s == BIBDATA)
file.data.windows(BIBDATA.len()).any(|s| s == BIBDATA)
})
.unwrap_or(false)
}
Expand Down Expand Up @@ -1081,7 +1088,7 @@ impl ProcessingSession {

let format_cache = &mut *self.io.format_cache.as_mut().unwrap();

for (name, contents) in &*self.io.mem.files.borrow() {
for (name, file) in &*self.io.mem.files.borrow() {
if name == self.io.mem.stdout_key() {
continue;
}
Expand All @@ -1093,7 +1100,7 @@ impl ProcessingSession {
}

// Note that we intentionally pass 'stem', not 'name'.
ctry!(format_cache.write_format(stem, contents, status); "cannot write format file {}", sname);
ctry!(format_cache.write_format(stem, &file.data, status); "cannot write format file {}", sname);
}

// All done. Clear the memory layer since this was a special preparatory step.
Expand Down Expand Up @@ -1229,7 +1236,7 @@ impl ProcessingSession {
/// This will panic if you there are multiple strong references to the
/// `files` map. This should only happen if you create and keep a clone of
/// the `Rc<>` wrapping it before calling this function.
pub fn into_file_data(self) -> HashMap<OsString, Vec<u8>> {
pub fn into_file_data(self) -> MemoryFileCollection {
Rc::try_unwrap(self.io.mem.files)
.expect("multiple strong refs to MemoryIo files")
.into_inner()
Expand Down
25 changes: 25 additions & 0 deletions src/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,23 @@ impl<'a> ExecutionState<'a> {
}
}

fn input_get_mtime(&mut self, handle: *mut InputHandle) -> libc::time_t {
let rhandle: &mut InputHandle = unsafe { &mut *handle };
let maybe_time = match rhandle.get_unix_mtime() {
Ok(t) => t,
Err(e) => {
tt_warning!(self.status, "failed to get the modification time of an input"; e);
Some(0)
}
};

if let Some(t) = maybe_time {
t as libc::time_t
} else {
1 // Intentionally make this distinguishable from the error value 0
}
}

fn input_seek(&mut self, handle: *mut InputHandle, pos: SeekFrom) -> Result<u64> {
let rhandle: &mut InputHandle = unsafe { &mut *handle };
rhandle.try_seek(pos)
Expand Down Expand Up @@ -697,6 +714,14 @@ pub extern "C" fn input_get_size(
es.input_get_size(handle)
}

#[no_mangle]
pub extern "C" fn input_get_mtime(
es: &mut ExecutionState,
handle: *mut InputHandle,
) -> libc::time_t {
es.input_get_mtime(handle)
}

#[no_mangle]
pub extern "C" fn input_seek(
es: &mut ExecutionState,
Expand Down
8 changes: 7 additions & 1 deletion src/engines/tex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,16 @@ impl TexEngine {
unsafe {
super::tt_xetex_set_int_variable(b"shell_escape_enabled\0".as_ptr() as _, v);
}
let v = if self.halt_on_error { 1 } else { 0 };

let mut halt_on_error = self.halt_on_error;
if unstables.continue_on_errors {
halt_on_error = false; // command-line override
}
let v = if halt_on_error { 1 } else { 0 };
unsafe {
super::tt_xetex_set_int_variable(b"halt_on_error_p\0".as_ptr() as _, v);
}

let v = if self.initex_mode { 1 } else { 0 };
unsafe {
super::tt_xetex_set_int_variable(b"in_initex_mode\0".as_ptr() as _, v);
Expand Down
Loading

0 comments on commit 180a4fd

Please sign in to comment.