Skip to content

texlive.withPackages: do not override .out, .all attributes#296751

Merged
veprbl merged 1 commit intoNixOS:masterfrom
xworld21:texlive-do-not-mask-true-outputs
Mar 21, 2024
Merged

texlive.withPackages: do not override .out, .all attributes#296751
veprbl merged 1 commit intoNixOS:masterfrom
xworld21:texlive-do-not-mask-true-outputs

Conversation

@xworld21
Copy link
Contributor

Description of changes

The .out, .all attributes should never be modified to avoid interfering with standard interfaces such as .overrideAttrs. For instance, .overrideAttrs would not change the value of .out, breaking all sorts of things, including nix-shell.

Messing around with the outputs using passthru was a really bad idea. By the looks of it, this is the last piece of code related to it. I am temporarily leaving texmfdist, texmfroot in place, but they will disappear with the new refactor (they will become normal derivation arguments).

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.05 Release Notes (or backporting 23.05 and 23.11 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.

@xworld21 xworld21 requested a review from veprbl March 17, 2024 21:01
@github-actions github-actions bot added the 6.topic: TeX Issues regarding texlive and TeX in general label Mar 17, 2024
The output attributes should never be modified to avoid interfering with
standard interfaces such as overrideAttrs.
@xworld21 xworld21 force-pushed the texlive-do-not-mask-true-outputs branch from 59c1afe to 9950ef4 Compare March 17, 2024 21:12
@xworld21
Copy link
Contributor Author

PS: this should be a zero rebuild change because it's all about passthru (let's see if ofborg confirms).

@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Mar 17, 2024
@xworld21
Copy link
Contributor Author

PS: this should be a zero rebuild change because it's all about passthru (let's see if ofborg confirms).

Interesting. I am not sure why rebuilds are happening. Somehow, I created the wrong fixed point around passthru.out? That might explain why I couldn't fix the store paths issues...

I suppose running nixpkgs-review on Linux is the safest course of action to make sure the rebuilds are the ones we expect (i.e. only the schemes and associated outputs).

@xworld21
Copy link
Contributor Author

Result of nixpkgs-review pr 296751 run on x86_64-darwin 1

30 packages built:
  • 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
  • texliveInfraOnly
  • texliveInfraOnly.info
  • texliveInfraOnly.man
  • texliveMedium
  • texliveMedium.info
  • texliveMedium.man
  • texliveMinimal
  • texliveMinimal.info
  • texliveMinimal.man
  • texliveSmall
  • texliveSmall.info
  • texliveSmall.man
  • texliveTeTeX
  • texliveTeTeX.info
  • texliveTeTeX.man

@veprbl
Copy link
Member

veprbl commented Mar 21, 2024

I suppose running nixpkgs-review on Linux is the safest course of action to make sure the rebuilds are the ones we expect (i.e. only the schemes and associated outputs).

You can see the list of rebuilds in "Details" for ofborg-eval. In fact, nixpkgs-review by default tries to use that same evaluation if it is available.

@veprbl veprbl merged commit b2f2956 into NixOS:master Mar 21, 2024
@xworld21 xworld21 deleted the texlive-do-not-mask-true-outputs branch March 21, 2024 08:31
@github-actions
Copy link
Contributor

Successfully created backport PR for release-23.11:

@SuperSandro2000
Copy link
Member

Could this be related to nix shell not working?

 ➜ nix shell nixpkgs#texliveMedium
error: path '«unknown»/nix/store/567f3f6bkiwwc9kiys6xnnk67msyvdj3-texlive-2023-env-man' is a symlink

@xworld21
Copy link
Contributor Author

Could this be related to nix shell not working?

 ➜ nix shell nixpkgs#texliveMedium
error: path '«unknown»/nix/store/567f3f6bkiwwc9kiys6xnnk67msyvdj3-texlive-2023-env-man' is a symlink

Oh my, I can't reproduce it on my machine, nixpkgs-unstable darwin. Could that be a nix (intentional) regression? Which nix version is it?

(PS: by the way the man output is a symlink to a directory, surely there is no reason to reject it?)

@xworld21
Copy link
Contributor Author

I can't reproduce it on my machine

I reproduced it by running nixUnstable.

nix shell nixpkgs#nixUnstable
nix shell nixpkgs#texliveMedium

This should be flagged as a Nix regression, I think. In the meanwhile I'll mitigate it on the Nixpkgs side, somehow.

@SuperSandro2000
Copy link
Member

This could be similar to NixOS/nix#9882 and some things could have been missed in NixOS/nix#9884 . I can only reproduce this with nix 2.20 and 2.21, 2.19 works fine.

@SuperSandro2000
Copy link
Member

I think the actual code that introduced this is https://github.com/NixOS/nixpkgs/pull/270232/files#diff-dc2ebdb8ed1e22695937e7c0c7b6bee656bade7c86422d7d9766d79f829bebcfR238-R245

Either

 pkgs/tools/typesetting/tex/texlive/build-tex-env.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
index 73e69578dc9f..1035bb73904c 100644
--- a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
+++ b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
@@ -238,7 +238,7 @@
     for otherOutputName in $outputs ; do
       if [[ "$otherOutputName" == 'out' ]] ; then continue ; fi
       otherOutput="otherOutput_$otherOutputName"
-      ln -s "''${!otherOutput}" "''${!otherOutputName}"
+      cp -r "''${!otherOutput}" "''${!otherOutputName}"
     done
   '' +
     # environment variables (note: only export the ones that are used in the wrappers)

or maybe

diff --git a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
index 73e69578dc9f..74db05e3f310 100644
--- a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
+++ b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
@@ -32,7 +33,7 @@
 , __extraName ? "combined"
 , __extraVersion ? ""
 # emulate the old texlive.combine (e.g. add man pages to main output)
-, __combine ? false
+, __combine ? true
 # adjust behavior further if called from the texlive.combine wrapper
 , __fromCombineWrapper ? false
 }@args:

or

diff --git a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
index 73e69578dc9f..e06ccf5d3103 100644
--- a/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
+++ b/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix
@@ -14,6 +14,7 @@
 , toTLPkgSets
 , bash
 , perl
+, xorg
 
   # common runtime dependencies
 , coreutils
@@ -228,6 +229,7 @@
     tl.texlive-scripts # fmtutil, updmap
     tl.texlive-scripts-extra # texlinks
     perl
+    xorg.lndir
   ];
 
   inherit meta passthru;
@@ -238,7 +240,8 @@
     for otherOutputName in $outputs ; do
       if [[ "$otherOutputName" == 'out' ]] ; then continue ; fi
       otherOutput="otherOutput_$otherOutputName"
-      ln -s "''${!otherOutput}" "''${!otherOutputName}"
+      mkdir "''${!otherOutputName}"
+      lndir "''${!otherOutput}"/ "''${!otherOutputName}"/
     done
   '' +
     # environment variables (note: only export the ones that are used in the wrappers)
diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix
index cab889f5f8b3..ee2c4ac5c712 100644
--- a/pkgs/tools/typesetting/tex/texlive/default.nix
+++ b/pkgs/tools/typesetting/tex/texlive/default.nix
@@ -10,7 +10,7 @@
 , makeWrapper, installShellFiles
 , python3, ruby, perl, tk, jdk, bash, snobol4
 , coreutils, findutils, gawk, getopt, gnugrep, gnumake, gnupg, gnused, gzip, html-tidy, ncurses, zip
-, libfaketime, asymptote, biber-ms, makeFontsConf
+, libfaketime, asymptote, biber-ms, makeFontsConf, xorg
 , useFixedHashes ? true
 , recurseIntoAttrs
 }:
@@ -109,7 +109,7 @@
   buildTeXEnv = import ./build-tex-env.nix {
     inherit bin tl;
     ghostscript = ghostscript_headless;
-    inherit lib buildEnv libfaketime makeFontsConf makeWrapper runCommand
+    inherit lib buildEnv libfaketime makeFontsConf makeWrapper runCommand xorg
       writeShellScript writeText toTLPkgSets bash perl coreutils gawk gnugrep gnused;
   };
 

SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 9, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 14, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 16, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 18, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 20, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 23, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 25, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Dec 31, 2025
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 2, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 3, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 7, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 9, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 12, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 15, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 17, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 21, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 23, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 25, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Jan 29, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 2, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 3, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 3, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 5, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 5, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 9, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 13, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 16, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 19, 2026
SuperSandro2000 added a commit to SuperSandro2000/nixpkgs that referenced this pull request Feb 24, 2026
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-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants