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

xorg.libX11: use the absolute path of libXcursor.so.1 #101064

Closed
wants to merge 1 commit into from

Conversation

@zanculmarktum
Copy link
Contributor

@zanculmarktum zanculmarktum commented Oct 19, 2020

Motivation for this change

#24137

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"
  • 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.
@pbogdan
Copy link
Member

@pbogdan pbogdan commented Oct 19, 2020

Does this actually work for you? IIRC the issue is that libXcursor itself depends on libX11 so it can't be fed as an input / dependency to the latter without forming a cycle and triggering an infinite recursion.

@zanculmarktum
Copy link
Contributor Author

@zanculmarktum zanculmarktum commented Oct 19, 2020

Yes, although only tested through my configuration.nix using https://gitlab.com/zanc/overlays.

@pbogdan
Copy link
Member

@pbogdan pbogdan commented Oct 19, 2020

Hmm, I haven't looked at the overlay but as is libX11 doesn't evaluate on this branch:

$ nix-instantiate -A xorg.libX11                                                                                                                                    
error: --- EvalError ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix-instantiate
at: (18:19) in file: /nix/store/nvmqjsr9nh3vy7w2p6bqqmrjs17q5dfc-nix-3.0pre20200829_f156513/share/nix/corepkgs/derivation.nix

    17|       value = commonAttrs // {
    18|         outPath = builtins.getAttr outputName strict;
      |                   ^
    19|         drvPath = strict.drvPath;

infinite recursion encountered
(use '--show-trace' to show detailed location information)

(presumably due to the cycle) and ofborg seems to agree.

@zanculmarktum
Copy link
Contributor Author

@zanculmarktum zanculmarktum commented Oct 19, 2020

Further test shows that my overlays work because I used the following:

final: prev:
{
  xorg = prev.xorg // {
    libX11 = prev.xorg.libX11.overrideAttrs (oldAttrs: {
      postPatch = (oldAttrs.postPatch or "") + ''
        substituteInPlace src/CrGlCur.c --replace "libXcursor.so.1" "${final.xorg.libXcursor}/lib/libXcursor.so.1"
      '';
    });
  };
}

instead of:

final: prev:
{
  xorg = prev.xorg.overrideScope' (self: super: {
    libX11 = super.libX11.overrideAttrs (oldAttrs: {
      postPatch = (oldAttrs.postPatch or "") + ''
        substituteInPlace src/CrGlCur.c --replace "libXcursor.so.1" "${self.libXcursor}/lib/libXcursor.so.1"
      '';
    });
  });
}

The latter gave me infinite recursion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants