Skip to content

Commit 2289fdc

Browse files
committed
fix(spindle-ci): tectonic master + BebopBamf TL2024 .ttb (per tectonic#1269)
Per operator: doronbehar's comment 3551606513 on tectonic#1269 has the working nix overlay. Adopt it (slightly trimmed): - flake: build tectonic from master @ d7f3275 (2025-10-06) which speaks the .ttb bundle format. Override on top of nixpkgs's tectonic-unwrapped with the cargoVendor hash from the comment. - pin the BebopBamf-hosted TL2024 .ttb bundle: https://bebopbamf-tex.syd1.cdn.digitaloceanspaces.com/texlive2024-0312.ttb - warmup in flake uses --bundle TTB so the cache populates against TL2024. - render.yml shim now also passes --bundle TTB (override via TECTONIC_BUNDLE env if needed). The CTAN pseudo.sty zip drop in render.yml is retained as defensive insurance — TL2024 should make it redundant but keeping the pattern costs nothing.
1 parent 2389c73 commit 2289fdc

2 files changed

Lines changed: 38 additions & 14 deletions

File tree

.tangled/workflows/render.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ steps:
192192
'if [ -d "$FOREST_TEX_DIR" ]; then' \
193193
' for f in "$FOREST_TEX_DIR"/*.tex "$FOREST_TEX_DIR"/*.sty; do [ -e "$f" ] && ln -sf "$f" .; done' \
194194
'fi' \
195-
'tectonic --outfmt xdv --keep-logs --print "${base}.tex" 2>&1 || { echo "::error::tectonic FAILED for ${base}.tex (cwd=$(pwd))" >&2; cat "${base}.log" 2>/dev/null | tail -40 >&2 || true; exit 1; }' \
195+
'tectonic --outfmt xdv --keep-logs --print --bundle "${TECTONIC_BUNDLE:-https://bebopbamf-tex.syd1.cdn.digitaloceanspaces.com/texlive2024-0312.ttb}" "${base}.tex" 2>&1 || { echo "::error::tectonic FAILED for ${base}.tex (cwd=$(pwd))" >&2; cat "${base}.log" 2>/dev/null | tail -40 >&2 || true; exit 1; }' \
196196
'[ -f "${base}.xdv" ] && mv -f "${base}.xdv" "${base}.dvi"' \
197197
> /tmp/bin/latex
198198
chmod +x /tmp/bin/latex

flake.nix

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,54 @@
9494
meta.description = "texlive scheme-small + standalone/tikz-cd/xy combo for forester";
9595
};
9696

97+
# Build tectonic from master @ 2025-10-06 (which supports the .ttb
98+
# bundle format from doronbehar's nix overlay in tectonic#1269 comment
99+
# 3551606513). nixpkgs's tectonic 0.16.9 is too old for the TL2024
100+
# bundle; we need post-2025-10-06.
101+
tectonicUnstableFor = pkgs: pkgs.tectonic-unwrapped.overrideAttrs (final: prev: {
102+
version = "0.15.0-unstable-2025-10-06";
103+
src = pkgs.fetchFromGitHub {
104+
owner = "tectonic-typesetting";
105+
repo = "tectonic";
106+
rev = "d7f3275adf6b501fc21122a1873912e970bf52ba";
107+
hash = "sha256-4p5ZU1O75xcE4pDUs1xwZkFkxJ+g3Rm9LL5Cog96Sm8=";
108+
};
109+
patches = [];
110+
cargoPatches = [];
111+
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
112+
inherit (final) src;
113+
hash = "sha256-J3q0dtQ/qb/72b6A40TNYDIZvDrUSpxF3SFjhc+X0fw=";
114+
};
115+
# Skip the sandbox-incompatible segfault test.
116+
checkFlags = (prev.checkFlags or []) ++ [
117+
"--skip=tests::no_segfault_after_failed_compilation"
118+
];
119+
});
120+
121+
tectonicBundleUrl = "https://bebopbamf-tex.syd1.cdn.digitaloceanspaces.com/texlive2024-0312.ttb";
122+
97123
forestTectonicFor = pkgs: pkgs.stdenv.mkDerivation {
98124
pname = "forest-tectonic";
99125
# Includes dvisvgm now too — nixery rejects the standalone dvisvgm
100126
# pkg name; shipping it alongside tectonic in the same NAR avoids
101127
# the manifest miss.
102-
version = "${tectonicVersion}+dvisvgm";
128+
version = "${tectonicVersion}+dvisvgm+ttb2024";
103129

104-
# No source — we build off the nixpkgs tectonic binary plus a tiny
130+
# No source — we build off the master tectonic plus a tiny
105131
# warmup .tex file that pulls every package the real forest build
106132
# is expected to need.
107133
dontUnpack = true;
108134
dontConfigure = true;
109135

110-
nativeBuildInputs = [ pkgs.tectonic pkgs.cacert pkgs.texlive.bin.dvisvgm ];
136+
nativeBuildInputs = [ (tectonicUnstableFor pkgs) pkgs.cacert pkgs.texlive.bin.dvisvgm ];
111137

112138
buildPhase = ''
113139
runHook preBuild
114140
export HOME=$TMPDIR
115141
export TECTONIC_CACHE_DIR=$HOME/.cache/Tectonic
116142
mkdir -p "$TECTONIC_CACHE_DIR"
117-
# Warmup: a representative doc that loads the heavy packages forest
118-
# uses. Iterate this — add \usepackage{...} lines as the forest LaTeX
119-
# surfaces missing packages on the first real run.
143+
# Warmup: representative doc that loads the heavy packages forest
144+
# uses. Add \usepackage{...} lines as forest LaTeX surfaces more.
120145
cat > warmup.tex <<'WARMUP'
121146
\documentclass[a4paper]{article}
122147
\usepackage{amsmath, amssymb, amsthm}
@@ -128,20 +153,19 @@
128153
Hello world.
129154
\end{document}
130155
WARMUP
131-
# tectonic's default bundle works; we don't pin --bundle because
132-
# the v2 URL returns 404 and the current default (v33) redirects
133-
# to the TL2022 tlextras anyway. For forest, render.yml fetches
134-
# the newer pseudo.sty from CTAN at runtime and stages it into
135-
# the latex shim's cwd to override TL2022's stale version.
136-
tectonic --outdir . warmup.tex || true
156+
# Pin to the BebopBamf TL2024 .ttb bundle (tectonic#1269 community
157+
# workaround — official bundles stopped at TL2022). Newer
158+
# pseudo.sty in TL2024 auto-registers /tcb/pseudo/* keys forest
159+
# expects, so the runtime CTAN override becomes redundant.
160+
tectonic --bundle ${tectonicBundleUrl} --outdir . warmup.tex || true
137161
ls -la "$TECTONIC_CACHE_DIR" || true
138162
runHook postBuild
139163
'';
140164

141165
installPhase = ''
142166
runHook preInstall
143167
mkdir -p $out/bin $out/share
144-
ln -s ${pkgs.tectonic}/bin/tectonic $out/bin/tectonic
168+
ln -s ${tectonicUnstableFor pkgs}/bin/tectonic $out/bin/tectonic
145169
# dvisvgm comes from texlive.bin.dvisvgm in this nixpkgs (top-level
146170
# pkgs.dvisvgm is absent; texlive.bin.core doesn't include it).
147171
# Fail loud if the path doesn't exist so we don't ship a broken NAR.

0 commit comments

Comments
 (0)