Skip to content

Skip tlmgr_update() and re-packaging for TinyTeX-2 when no changes needed#491

Merged
yihui merged 3 commits intomainfrom
copilot/update-build-tinytex-script
Mar 7, 2026
Merged

Skip tlmgr_update() and re-packaging for TinyTeX-2 when no changes needed#491
yihui merged 3 commits intomainfrom
copilot/update-build-tinytex-script

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

TinyTeX-2 builds always ran tlmgr_update() and re-packaged bundles even when nothing changed, wasting significant CI time. This adds a pre-check using check-update.R to skip unnecessary work.

Build scripts (build-tinytex-2.sh / build-tinytex-2.ps1)

  • Run Rscript tools/check-update.R before tlmgr_update(); skip the update if exit code is 0 (nothing to update)
  • Orphaned package detection/removal runs regardless (PKGS_BEFORE/AFTER diff is a no-op when update was skipped)
  • Output tinytex2-changed=true|false to $GITHUB_OUTPUTtrue if updates were applied, orphaned packages removed, or full rebuild; false otherwise
  • In the fast path, pass the working directory to install-bin-unix.sh / install-bin-windows.bat so the downloaded TinyTeX-2 installer is preserved in GITHUB_WORKSPACE rather than deleted

Install scripts (install-bin-unix.sh / install-bin-windows.bat)

  • Accept an optional directory argument; when provided, the downloaded installer is moved there instead of deleted after extraction
  • Use the original installer filename (e.g. TinyTeX-2-linux-x86_64.tar.xz, TinyTeX-2-windows.exe) instead of a generic name (TinyTeX.tar.xz, install.exe)
  • install-bin-unix.sh refactored: checks for prebuilt TinyTeX first, then branches on Darwin vs Linux for the download tool; the extract + save/delete logic is now in one shared place

Workflow (build.yaml) — all 5 platform jobs

Splits the monolithic "Build TinyTeX-2" step into focused steps per platform:

  • Build TinyTeX-2 (id: build-tinytex-2): runs the script only, captures tinytex2-changed output; the downloaded installer is preserved in the workspace
  • Package TinyTeX-2: re-packages from the updated TinyTeX installation only when tinytex2-changed != 'false'; when skipped, the original installer preserved by the install script is used as-is
  • Copy TinyTeX-2 alias (platforms with aliases): unconditional — copies the platform bundle to its legacy filename (e.g. TinyTeX-2.tar.gz, TinyTeX-2.tgz, TinyTeX-2.exe); works whether the bundle was just re-packaged or preserved from the install step

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…hanges needed

Co-authored-by: yihui <163582+yihui@users.noreply.github.com>
Copilot AI changed the title [WIP] Update build-tinytex-2 scripts for checking updates Skip tlmgr_update() and re-packaging for TinyTeX-2 when no changes needed Mar 7, 2026
Copilot finished work on behalf of yihui March 7, 2026 03:38
Copy link
Contributor

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't do gh release download, but let install-bin-* scripts accept an optional argument that takes a dir path; if this path is passed to the script, the script won't delete the downloaded installer but move it to the specified path

with this path argument, we can move the downloaded installer to the current working directory, so that we don't need to download again

however, this requires another change in install-bin-* scripts: when downloading the installers, we shouldn't change the filenames of the installers (we currently do), e.g., on windows, we specify install.exe or install.zip as the downloaded filename, and TinyTeX.tar.xz as the download filename on *unix; we should keep the original name TinyTeX-2-OS-arch.tar.xz

after moving TinyTeX-2 installers to the current working directory, we can make copies for the old filenames

please try to minimize code repetition in build.yaml and shell/batch scripts

…ad of re-downloading

Co-authored-by: yihui <163582+yihui@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 7, 2026

don't do gh release download, but let install-bin-* scripts accept an optional argument that takes a dir path; if this path is passed to the script, the script won't delete the downloaded installer ...

Done in 61bb4b7.

  • install-bin-unix.sh and install-bin-windows.bat now accept an optional directory argument; when provided, the downloaded installer is moved there (using its original name, e.g. TinyTeX-2-linux-x86_64.tar.xz) instead of being deleted.
  • build-tinytex-2.sh passes "$(pwd)" and build-tinytex-2.ps1 passes "$PWD" so the installer lands in GITHUB_WORKSPACE.
  • The unix script was also refactored: it now checks for prebuilt TinyTeX first, then branches on Darwin vs Linux for the download tool — the extract + save/delete is in one shared location.
  • In build.yaml, the 5× gh release download steps are gone. In their place, each platform has an unconditional "Copy TinyTeX-2 alias" step (e.g. cp TinyTeX-2-linux-x86_64.tar.xz TinyTeX-2.tar.gz). This step works regardless of whether the .tar.xz was just re-packaged from the updated TinyTeX install or preserved as-is by the install script.

Copilot finished work on behalf of yihui March 7, 2026 04:45
@yihui yihui marked this pull request as ready for review March 7, 2026 05:01
@yihui yihui merged commit f12aa4f into main Mar 7, 2026
12 of 13 checks passed
@yihui yihui deleted the copilot/update-build-tinytex-script branch March 7, 2026 05:02
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.

3 participants