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

Certain paths don't link if multi outputs are used #65325

Open
doronbehar opened this issue Jul 24, 2019 · 15 comments
Open

Certain paths don't link if multi outputs are used #65325

doronbehar opened this issue Jul 24, 2019 · 15 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@doronbehar
Copy link
Contributor

doronbehar commented Jul 24, 2019

I've opened a thread on the forums about the issue but getting no replies I hope I can get some attention here. I'd be happy to contribute a fix but I don't know even where to look..

Describe the bug

Trying to install GNU's make info manuals to my user environment via nix-env -iA nixos.gnumake.info but from some reason they are not found in my ~/.nix-profile/share/info.

To Reproduce

Steps to reproduce the behavior:

nix-env -iA nixos.gnumake.info
ls -l ~/.nix-profile/share/info/make*

Expected behavior

make* files are found.

Additional context

I tried the following commands / workarounds but non helped:

  1. Running nix-env -iA nixos-unstable.gnumake.all
  2. Running nix-env -iA nixos-unstable.gnumake while gnumake's meta.outputsToInstall is overrided in my ~/.config/nixpkgs/config.nix to include "info" as so:
    gnumake = pkgs.gnumake.overrideAttrs (oldAttrs: rec {
      meta.outputsToInstall = [ "info" "out" ];
    });

As explained here.

I can see the package's info files in /nix/store/...-gnumake-info/share/info/ but from some reason they are not linked to my profile! This problem is there for every package with and "info" output (e.g (using git grep in nixpkgs) groff.info).

Metadata

Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.

  • system: "x86_64-linux"
  • host os: Linux 5.2.2, NixOS, 19.09pre186326.62cb4f72282 (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(root): "nixos-19.09pre186326.62cb4f72282"
  • channels(doron): "nixos-unstable-19.09pre186326.62cb4f72282"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@matthewbauer
Copy link
Member

GNU Info requires an index (install-info) to work correctly so you need some way to generate the dir index declaratively. There are a few solutions available:

@doronbehar
Copy link
Contributor Author

I think GNU info's dir index is not relevant to the issue. The point is, that the .info files from the package are not even linked to the profile at the expected location (~/.nix-profile/share/info/) only when the output is split. A 'proof' for that is that I can run info <program> for packages that provide a .info file in their single output's $out/share/info/ (e.g package octave).

I'll summarize:

  • If a package has multiple outputs and one of them is "info", nix-env -iA <package>.info doesn't link the .info files ~/.nix-profile/share/info.
  • On the other hand, if a package has only "out" output, the .info files are linked O.K.

@doronbehar
Copy link
Contributor Author

BTW the same issue goes with ncurses' dev output which provides the executable infocmp (I needed it for a script of mine) - installing nixpkgs.ncurses.dev doesn't make this executable available in ~/.nix-profile/bin/. I've applied the following overlay:

self: super:

{
  ncurses = super.ncurses.overrideAttrs (oldAttrs: rec {
    meta = oldAttrs.meta // {
      outputsToInstall = oldAttrs.outputs;
    };
  });
}

Almost identical to the overlay suggested by @lilyball in the discourse thread.

@matthewbauer
Copy link
Member

I actually have a PR that actually would fix this, but it was considered too much of a breaking change:

#44168

@lilyball
Copy link
Member

It looks like your PR installs all outputs. I can see why that may be considered undesirable. Fixing the issue where nix-env -iA nixos.gnumake.info doesn't actually install the info pages seems quite valuable though.

@doronbehar doronbehar changed the title GNU info manuals are not linked to user profile if installed via a package's split output Certain paths don't link if multi outputs are used Apr 26, 2020
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/could-weve-implemented-multi-output-packages-better/6597/5

@doronbehar doronbehar mentioned this issue May 1, 2020
10 tasks
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/missing-man-pages/4680/7

@stale
Copy link

stale bot commented Dec 10, 2020

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 Dec 10, 2020
@doronbehar
Copy link
Contributor Author

doronbehar commented Dec 10, 2020 via email

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 10, 2020
@stale
Copy link

stale bot commented Jun 9, 2021

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 Jun 9, 2021
@doronbehar
Copy link
Contributor Author

This is no longer an issue with nix profile. Personally I think we should move forward from nix-env and consider this a resolved issue, but I'll leave this issue open for nix-env users.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 10, 2021
@bdesham
Copy link
Contributor

bdesham commented Jun 15, 2021

@doronbehar Interesting. Where can I read more about nix profile? (It’s difficult to Google and this wiki page has a minimal amount of information.) Is it available on OSes other than NixOS?

@doronbehar
Copy link
Contributor Author

@bdesham nix profile is available if you use nixUnstable. I have a vague memory that you use Darwin? I don't know how to switch to nixUnstable on Darwin, possibly possible via home-manager, but on NixOS there is:

https://nixos.org/manual/nixos/unstable/options.html#opt-nix.package .

@bdesham
Copy link
Contributor

bdesham commented Aug 8, 2021

@doronbehar Thanks!

@stale
Copy link

stale bot commented Apr 29, 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 Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

5 participants