Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texlive: Refactors toward working texdoc #120578

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bb010g
Copy link
Contributor

@bb010g bb010g commented Apr 25, 2021

The main thing to notice is that texlive is now a package scope. Inside it, texlivePackages contains what was previously lexically-scoped local tl, and the previous interface is provided for compatibility. Evaluations are not slower from the minor testing I did, and may be slightly faster. Please review commit-by-commit.

lib.makeScope' now appears, with the interface of lib.makeScopeWithSplicing but the (non-deprecated) functionality of lib.makeScope, so that the texlive scope may be forwards-compatible with lib.makeScopeWithSplicing.

buildenv now passes through preferLocalBuild and allowSubstitutes so that buildTexliveCombinedEnv doesn't invoke .overrideAttrs to achieve that effect.

I'm not sure about names, so feedback is really appreciated there. I tried to keep callPackage in the child scope unambiguous.

Motivation for this change

While investigating solutions for #118757, working with TeX Live in Nixpkgs was a pain. It's now less of a pain, but still needs work in my opinion to have nice separation between TeX Live, CTAN, and the combination machinery. Something simple like overriding texliveBin works without gymnastics, and changes to helper functions can be experimented with without copying & pasting whole files, closer to the flexibility Nixpkgs provides for Python.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
    (No diff detected, stopping review...)
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This change is Reviewable

bb010g added 5 commits April 24, 2021 22:01
Evaluation is slightly quicker now, too.
No derivations are changed.
An alias that warns is provided.
Like `makeScope`, but with a `makeScopeWithSplicing`-style interface,
since that uses proper `overrideScope`. For use in new code, or wherever
we can actually switch from `overrideScope'` to `overrideScope`.
@github-actions github-actions bot added 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: python 6.topic: TeX Issues regarding texlive and TeX in general 8.has: documentation This PR adds or changes documentation labels Apr 25, 2021
@bb010g
Copy link
Contributor Author

bb010g commented Apr 25, 2021

nix-build -A tests.texlive -A tests.texlive.dvipng runs without error.

bb010g added 2 commits April 24, 2021 22:40
Avoids an `.overrideAttrs` invocation in `buildTexliveCombinedEnv`.
@bb010g
Copy link
Contributor Author

bb010g commented Apr 25, 2021

ofborg-eval results in:

nix-env did not evaluate cleanly:
 ["trace: warning: Obsolete attribute `bin\' is used. It was renamed to `texliveBin\'."]

I can't find any package that using bin, so I presume this is from evaluating all of texlive's attributes? I'm not sure what a proper fix for this is. Should lib.warn not be used on bin? (The warning was based on lib.modules.mkRenamedOptionModule.)

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/texdoc-cannot-find-texlive-tlpdb/9303/2

@tobiasBora
Copy link
Contributor

If I understand correctly, texdoc is not yet working even with this PR?

@stale
Copy link

stale bot commented Jan 9, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 9, 2022
@xworld21 xworld21 mentioned this pull request Aug 20, 2023
12 tasks
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: python 6.topic: TeX Issues regarding texlive and TeX in general 8.has: documentation This PR adds or changes documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants