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.withPackages: relax dependency resolution #321750

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

xworld21
Copy link
Contributor

Description of changes

Solves the problem of replacing one package with a different version (see https://discourse.nixos.org/t/new-tex-live-withpackages-function/34902/19?u=xworld21 and preceding discussion).

This is done with two changes: first, .withPackages process its argument before the packages already included in the scheme; second, the version attribute is dropped from the dependency resolution. Thus, replacing e.g. minted with a new version should be as easy as

texliveFull.withPackages (_: [ newminted ])

as long as newminted.pname == texlive.pkgs.minted.pname.

It is not a solid way to replace a package with another one, because it does not compose well and it is very sensitive to the order of the arguments, so I will not reference it in the documentation. overrideScope will be the supported way to do that kind of change, when ready.

Note: this requires a nixpkgs-review to ensure I did not break packages relying on .withPackages.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: TeX Issues regarding texlive and TeX in general label Jun 22, 2024
@xworld21 xworld21 requested a review from veprbl June 22, 2024 12:31
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/new-tex-live-withpackages-function/34902/22

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Jun 22, 2024
The change allow swapping one package with a different one by simply
passing the new package to `.withPackages`.
@xworld21 xworld21 force-pushed the texlive-deps-resolution-by-pname branch from 7e0f164 to 7f1a82f Compare June 23, 2024 10:25
@ofborg ofborg bot added 10.rebuild-darwin: 101-500 10.rebuild-linux: 101-500 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Jun 23, 2024
@veprbl
Copy link
Member

veprbl commented Jun 24, 2024

Result of nixpkgs-review pr 321750 run on x86_64-linux 1

29 packages marked as broken and skipped:
  • golden-cheetah-bin
  • python311Packages.torchWithRocm
  • python311Packages.torchWithRocm.cxxdev
  • python311Packages.torchWithRocm.dev
  • python311Packages.torchWithRocm.dist
  • python311Packages.torchWithRocm.lib
  • python312Packages.torchWithRocm
  • python312Packages.torchWithRocm.cxxdev
  • python312Packages.torchWithRocm.dev
  • python312Packages.torchWithRocm.dist
  • python312Packages.torchWithRocm.lib
  • rocmPackages.mivisionx
  • rocmPackages.mivisionx-cpu
  • rocmPackages.mivisionx-hip
  • rocmPackages.rdc
  • rocmPackages.rdc.doc
  • rocmPackages_5.mivisionx
  • rocmPackages_5.mivisionx-cpu
  • rocmPackages_5.mivisionx-hip
  • rocmPackages_5.mivisionx-opencl
  • rocmPackages_5.rdc
  • rocmPackages_5.rdc.doc
  • rocmPackages_6.mivisionx
  • rocmPackages_6.mivisionx-cpu
  • rocmPackages_6.mivisionx-hip
  • rocmPackages_6.rdc
  • rocmPackages_6.rdc.doc
  • spring
  • springLobby
15 packages failed to build:
  • open-webui
  • open-webui.dist
  • polymake
  • pynac
  • python311Packages.abjad
  • python311Packages.abjad.dist
  • python312Packages.abjad
  • python312Packages.abjad.dist
  • rocmPackages_5.migraphx
  • rocmPackages_5.miopen (rocmPackages_5.miopen-hip)
  • rocmPackages_5.miopen-opencl
  • rocmPackages_5.rocprofiler
  • singular
  • xyce-parallel
  • xyce-parallel.doc
233 packages built:
  • R
  • R.tex
  • advi
  • apostrophe
  • asciidoc-full
  • asciidoc-full-with-plugins
  • asciidoc-full-with-plugins.dist
  • asciidoc-full.dist
  • asymptote
  • asymptote.doc
  • asymptote.info
  • asymptote.man
  • asymptote.tex
  • auctex
  • auctex.tex
  • auto-multiple-choice
  • avrdude
  • avrdudess
  • blahtexml
  • blahtexml.doc
  • bluespec
  • bluespec.doc
  • cantor (libsForQt5.cantor ,plasma5Packages.cantor)
  • catdvi
  • catdvi.dev
  • cddlib
  • clevis
  • clevis.man
  • dblatex
  • dblatexFull
  • denemo
  • diffoscope
  • diffoscope.dist
  • diffoscope.man
  • digikam
  • disorderfs
  • dot2tex (python311Packages.dot2tex)
  • dot2tex.dist (python311Packages.dot2tex.dist)
  • eclib
  • enblend-enfuse
  • fastcap
  • fastcap.doc
  • frescobaldi
  • frescobaldi.dist
  • gap
  • gap-full
  • gap-minimal
  • gfan
  • giac
  • giac-with-xcas
  • giac.doc
  • gnu-cobol
  • gnu-cobol.bin
  • gnu-cobol.dev
  • gnu-cobol.lib
  • gp2c
  • herwig
  • hid-tools
  • hid-tools.dist
  • hugin
  • iotas
  • ipe
  • jasp-desktop
  • jetbrains.dataspell
  • rep (kakounePlugins.rep)
  • klipper-firmware
  • klipper-flash
  • labplot
  • latte-integrale
  • lcalc
  • lilypond
  • lilypond-unstable
  • lilypond-unstable-with-fonts
  • lilypond-with-fonts
  • luksmeta
  • manim (python311Packages.manim)
  • manim-slides
  • manim-slides.dist
  • manim.dist (python311Packages.manim.dist)
  • mitscheme
  • mitschemeX11
  • ne
  • nuweb
  • openmolcas
  • opentx
  • paperwork
  • paperwork.dist
  • pari
  • postgresql12JitPackages.plr
  • postgresql12Packages.plr
  • postgresql13JitPackages.plr
  • postgresql13Packages.plr
  • postgresql14JitPackages.plr
  • postgresql14Packages.plr
  • postgresqlJitPackages.plr (postgresql15JitPackages.plr)
  • postgresqlPackages.plr (postgresql15Packages.plr)
  • postgresql16JitPackages.plr
  • postgresql16Packages.plr
  • python311Packages.cnvkit
  • python311Packages.cnvkit.dist
  • python311Packages.cypari2
  • python311Packages.cypari2.dist
  • python311Packages.cysignals
  • python311Packages.cysignals.dist
  • python311Packages.fpylll
  • python311Packages.fpylll.dist
  • python311Packages.manim-slides
  • python311Packages.manim-slides.dist
  • python311Packages.pplpy
  • python311Packages.pplpy.dist
  • python311Packages.pplpy.doc
  • python311Packages.primecountpy
  • python311Packages.primecountpy.dist
  • python311Packages.pypandoc
  • python311Packages.pypandoc.dist
  • python311Packages.radian
  • python311Packages.radian.dist
  • python311Packages.rchitect
  • python311Packages.rchitect.dist
  • recoll (python311Packages.recoll)
  • rivet (python311Packages.rivet)
  • python311Packages.rpy2
  • python311Packages.rpy2.dist
  • python311Packages.sphinxcontrib-bayesnet
  • python311Packages.sphinxcontrib-bayesnet.dist
  • python311Packages.sphinxcontrib-tikz
  • python311Packages.sphinxcontrib-tikz.dist
  • python311Packages.unstructured
  • python311Packages.unstructured.dist
  • python312Packages.cnvkit
  • python312Packages.cnvkit.dist
  • python312Packages.cypari2
  • python312Packages.cypari2.dist
  • python312Packages.cysignals
  • python312Packages.cysignals.dist
  • python312Packages.dot2tex
  • python312Packages.dot2tex.dist
  • python312Packages.fpylll
  • python312Packages.fpylll.dist
  • python312Packages.manim
  • python312Packages.manim-slides
  • python312Packages.manim-slides.dist
  • python312Packages.manim.dist
  • python312Packages.pplpy
  • python312Packages.pplpy.dist
  • python312Packages.pplpy.doc
  • python312Packages.primecountpy
  • python312Packages.primecountpy.dist
  • python312Packages.pypandoc
  • python312Packages.pypandoc.dist
  • python312Packages.radian
  • python312Packages.radian.dist
  • python312Packages.rchitect
  • python312Packages.rchitect.dist
  • python312Packages.recoll
  • python312Packages.rivet
  • python312Packages.rpy2
  • python312Packages.rpy2.dist
  • python312Packages.sphinxcontrib-bayesnet
  • python312Packages.sphinxcontrib-bayesnet.dist
  • python312Packages.sphinxcontrib-tikz
  • python312Packages.sphinxcontrib-tikz.dist
  • python312Packages.unstructured
  • python312Packages.unstructured.dist
  • qmk
  • qmk.dist
  • quarto
  • recoll-nox
  • resorter
  • rocmPackages.rocdbgapi (rocmPackages_6.rocdbgapi)
  • rocmPackages.rocdbgapi.doc (rocmPackages_6.rocdbgapi.doc)
  • rocmPackages.rocgdb (rocmPackages_6.rocgdb)
  • rocmPackages.rocprofiler (rocmPackages_6.rocprofiler)
  • rocmPackages.rocr-debug-agent (rocmPackages_6.rocr-debug-agent)
  • rocmPackages_5.miopengemm
  • rocmPackages_5.miopengemm.doc
  • rocmPackages_5.rocdbgapi
  • rocmPackages_5.rocdbgapi.doc
  • rocmPackages_5.rocr-debug-agent
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • sage
  • sageWithDoc
  • sagetex.tex
  • sherpa
  • skribilo
  • solfege
  • spark (spark3 ,spark_3_5)
  • spark_3_4
  • sympow
  • tang
  • tang.man
  • tests.pkg-config.defaultPkgConfigPackages.libR
  • texliveBasic
  • texliveBasic.info
  • texliveBasic.man
  • texliveBookPub
  • texliveBookPub.info
  • texliveBookPub.man
  • texliveConTeXt
  • texliveConTeXt.info
  • texliveConTeXt.man
  • texliveFull
  • texliveFull.info
  • texliveFull.man
  • texliveGUST
  • texliveGUST.info
  • texliveGUST.man
  • texliveMedium
  • texliveMedium.info
  • texliveMedium.man
  • texliveMinimal
  • texliveMinimal.info
  • texliveMinimal.man
  • texliveSmall
  • texliveSmall.info
  • texliveSmall.man
  • texliveTeTeX
  • texliveTeTeX.info
  • texliveTeTeX.man
  • texmacs
  • thepeg
  • therion
  • tinygo
  • vscode-extensions.reditorsupport.r
  • wayback-machine-archiver
  • wayback-machine-archiver.dist
  • xyce
  • xyce.doc
  • yosys-bluespec
  • zettlr

@xworld21
Copy link
Contributor Author

nixpkgs-review seems good... @veprbl before merging, let's wait for confirmation that texliveFull.withPackages (_: [ newminted ]) actually works as I'd like it to (I'll try to check it myself when I can).

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jun 24, 2024
@xworld21
Copy link
Contributor Author

confirmation that texliveFull.withPackages (_: [ newminted ]) actually works as I'd like it to (I'll try to check it myself when I can).

Oh, this is very easy to test:

nix-repl> (texliveInfraOnly.withPackages (_: [ { pname = "scheme-infraonly"; } ])).requiredTeXPackages
[ ]

Passing pname = "kpathsea" has a similar effect. It works!

@veprbl veprbl merged commit 5ef104a into NixOS:master Jun 25, 2024
23 checks passed
@xworld21 xworld21 deleted the texlive-deps-resolution-by-pname branch June 25, 2024 16:49
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: 101-500 10.rebuild-linux: 101-500 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants