Skip to content

Fix tinytex install silently ignoring extraction failures#14357

Merged
cderv merged 4 commits intomainfrom
fix/issue-14304
Apr 15, 2026
Merged

Fix tinytex install silently ignoring extraction failures#14357
cderv merged 4 commits intomainfrom
fix/issue-14304

Conversation

@cderv
Copy link
Copy Markdown
Collaborator

@cderv cderv commented Apr 14, 2026

When quarto install tinytex downloads a .tar.xz archive on a system without xz-utils, tar xf fails but the installer shows [✓] Unzipping and proceeds to move files from a non-existent directory, producing a confusing lstat/NotFound error.

Root Cause

The unzip() call in tinytex.ts discards the ProcessResult return value. Other callers (extension install, quarto use template, quarto use brand) all check result.success — the TinyTeX installer was the exception.

This became a visible problem after #14181 made .tar.xz the preferred format for Linux and macOS TinyTeX packages. Unlike .tar.gz (gzip is universal), .tar.xz requires xz-utils which isn't installed on minimal/container images.

Fix

Check the unzip() return value and throw on failure with a clear error message. For .tar.xz archives, the message includes a hint to install xz-utils.

Also add xz-utils to .deb Recommends and xz to .rpm Recommends, since TinyTeX now ships .tar.xz as the preferred archive format.

Fixes #14304

cderv added 2 commits April 14, 2026 14:45
Check the return value of unzip() during TinyTeX installation. When
extraction fails (e.g., tar xf on a .tar.xz without xz-utils), the
installer now throws a clear error instead of proceeding to move
non-existent files and producing a confusing lstat/NotFound error.

For .tar.xz archives, the error message includes a hint to install
xz-utils. Also add xz-utils to .deb Recommends and xz to .rpm
Recommends since TinyTeX now ships .tar.xz as the preferred format.

Fixes #14304
cderv added 2 commits April 14, 2026 17:15
The .tar.xz format is also used on macOS, where tar has built-in xz
support. Only show the xz-utils installation hint on Linux where the
tool may genuinely be missing. Adjust tests to verify platform-specific
behavior.
Ensure the catch block verifies the error is actually an extraction
failure ("Failed to extract") before checking xz-utils hint
presence, preventing a false pass if install() unexpectedly succeeds.
cderv added a commit that referenced this pull request Apr 15, 2026
…14360)

Backport from #14357.

`quarto install tinytex` silently succeeded when archive extraction
failed, leaving users with a broken TinyTeX installation. Check the
`unzip()` return value and surface a clear error message, including
an xz-utils install hint on Linux for `.tar.xz` archives. Add
`xz-utils`/`xz` to `.deb`/`.rpm` Recommends so the dependency is
available on fresh installs.

Fixes #14304
@cderv cderv merged commit 896ffea into main Apr 15, 2026
57 checks passed
@cderv cderv deleted the fix/issue-14304 branch April 15, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quarto tinytex install silently ignores extraction failures

1 participant