Skip to content

texlive.withPackages: add withDocs, withSources and expose texliveFullWithDocs at top level#497867

Closed
xworld21 wants to merge 2 commits into
NixOS:masterfrom
xworld21:texlive-with-docs
Closed

texlive.withPackages: add withDocs, withSources and expose texliveFullWithDocs at top level#497867
xworld21 wants to merge 2 commits into
NixOS:masterfrom
xworld21:texlive-with-docs

Conversation

@xworld21
Copy link
Copy Markdown
Contributor

@xworld21 xworld21 commented Mar 8, 2026

Expose new attributes withDocs, withSources that evaluate to the same texlive.withPackages derivation, but with withDocs = true. I have added texliveFullWithDocs at the top level to have Hydra add all texdoc containers to the binary cache.

If this gets merged, I think we can finally deprecate texlive.combine for good, and start updating the documentation.

There's a bit of history around these changes.

I tried to implement .overrideAttrs { withDocs = true; } quite some time ago (#312945), but it died out, it's just too cumbersome to implement (see also #432957) and it doesn't look like people were clamoring for it. .overrideAttrs is also tricky to get right, because some overrides require rebuilding the formats, some don't. It's hard to come up with an overriding mechanism that captures this nicely. Instead, .withDocs is embarrassingly simple to add (and suggests adding .withPaper for switching defaults between A4 and letter). At any rate, if we manage to implement a version .overrideAttrs { withDocs = true; }, leaving the .withDocs alias is very cheap.

The top level texliveFullWithDocs is odd, but when I tried to have Hydra build all texdoc containers via texlivePackages, I was told that in fact building each TeX Live package separately causes scheduling issues. I forgot where that conversation was!

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@xworld21 xworld21 requested review from chrjabs and veprbl March 8, 2026 10:51
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 6.topic: TeX Issues regarding texlive and TeX in general labels Mar 8, 2026
@xworld21 xworld21 force-pushed the texlive-with-docs branch from a226a59 to 44c09bd Compare March 8, 2026 12:03
@chrjabs
Copy link
Copy Markdown
Contributor

chrjabs commented Mar 10, 2026

Even though I've done the last couple of texlive version updates, I'm not actually too familiar with the internals of how the packaging works. Is there some discussion somewhere on deprecating texlive.combine?

Copy link
Copy Markdown
Contributor

@chrjabs chrjabs left a comment

Choose a reason for hiding this comment

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

Tests (nix-build ../../../../.. -A tests.texlive --no-out-link) and build of texliveFullWithDocs (nix build .#texliveFullWithDocs) pass (on x86_64-linux), so looks good to me.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 10, 2026
@xworld21
Copy link
Copy Markdown
Contributor Author

Is there some discussion somewhere on deprecating texlive.combine?

I have mentioned it a few times since introducing texlive.withPackages, because there's a lot of extra code to maintain compatibility with texlive.combine and it's all very ugly. I'll open a discussion, though. I am not sure myself how to deprecate it properly (starting with 26.05 or right after 26.05? etc etc).

@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-and-when-to-deprecate-texlive-combine-looking-for-tex-live-reviewers/76121/1

Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

LGTM

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Mar 13, 2026
@xworld21
Copy link
Copy Markdown
Contributor Author

Great, if somebody can merge, in the meanwhile I'll start making documentation updates.

@xworld21 xworld21 marked this pull request as draft April 4, 2026 09:23
@xworld21
Copy link
Copy Markdown
Contributor Author

xworld21 commented Apr 4, 2026

The new buildEnv has just been merged into staging, which means .overrideAttrs { withDocs = true; } is now feasible, and clearly the correct way to go. It just requires a bit of restructuring inside build-tex-env.nix. The only practical problem is that staging and master are quite out of sync, so I'll need to wait before I can make a safe PR.

@xworld21
Copy link
Copy Markdown
Contributor Author

Superseded by #506700.

@xworld21 xworld21 closed this Apr 25, 2026
@xworld21 xworld21 deleted the texlive-with-docs branch April 25, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: TeX Issues regarding texlive and TeX in general 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants