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

nixos: Fix pam_kwallet5 integration #28470

Merged
merged 1 commit into from
Aug 24, 2017
Merged

Conversation

benley
Copy link
Member

@benley benley commented Aug 22, 2017

Fixes #28469

  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -281,7 +281,7 @@ let
"auth optional ${pkgs.pam_mount}/lib/security/pam_mount.so"}
${optionalString cfg.enableKwallet
("auth optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
" kwalletd=${pkgs.libsForQt5.kwallet}/bin/kwalletd5")}
" kwalletd=${pkgs.libsForQt5.kwallet.bin}/bin/kwalletd5")}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I suggest to use lib.getBin pkgs.libsForQt5.kwallet instead? That would ensure that the correct path is found even if the outputs of kwallet change later.

@dezgeg
Copy link
Contributor

dezgeg commented Aug 23, 2017

BTW, rest of Nixpkgs follows the convention that binaries are in the first output which libsForQt5 doesn't seem to follow. It probably should.

(Also path to pam_kwallet5.so needs to be fixed then :)

@ttuegel
Copy link
Member

ttuegel commented Aug 24, 2017

BTW, rest of Nixpkgs follows the convention that binaries are in the first output which libsForQt5 doesn't seem to follow. It probably should.

Is this policy stated anywhere? If Qt-based packages complied with this policy, we could no longer put binaries in their own output. (Qt libraries must go in the first output.)

@dezgeg
Copy link
Contributor

dezgeg commented Aug 24, 2017

https://nixos.org/nixpkgs/manual/#idm140737318570400

By convention, the first output should contain the executable programs provided by the package as that output is used by Nix in string conversions, allowing references to binaries like ${pkgs.perl}/bin/perl to always work.

@ttuegel
Copy link
Member

ttuegel commented Aug 24, 2017

OK, I will have to go through and remove the bin outputs from every package using Qt.

@benley I will merge this as-is to fix the problem, but it will be shortly obsolete anyway.

@ttuegel ttuegel merged commit 27c043c into NixOS:master Aug 24, 2017
@dezgeg
Copy link
Contributor

dezgeg commented Aug 24, 2017

Can you describe in what way Qt assumes that libraries are in the first output, and why that assumption can't be fixed instead?

@benley benley deleted the fix-pam-kwallet5 branch August 24, 2017 17:23
@ttuegel
Copy link
Member

ttuegel commented Aug 25, 2017

Can you describe in what way Qt assumes that libraries are in the first output, and why that assumption can't be fixed instead?

The last time I tried this was while multiple-outputs was still unmerged; the situation may have changed. Qt tends to remember paths used during the build by encoding them as strings in the library being built. Something about the first output causes it to always be remembered. If the first output is bin, and the libraries are in out, then there is a dependency cycle: binaries in bin have out in their RPATH and libraries in out have bin in their data sections because of some weird Qt thing.

There are probably ways to mitigate this (nukeReferences?) but I am hesitant to do that because I never really understood what was going on. Or, maybe we can show this is no longer a problem.

@dezgeg
Copy link
Contributor

dezgeg commented Aug 25, 2017

Yes I'm pretty sure things have changed since then. This is basically the only code in stdenv builder that cares about the first output:

176     local propagaterOutput="$outputDev"
177     if [ -z "$propagaterOutput" ]; then
178         propagaterOutput="$outputFirst"
179     fi

where outputDev is initialized to either "$dev" or "$out":

32 _overrideFirst outputDev "dev" "out"

(it's also dead code I think, since the stdenv builder explodes in other ways if there is no out output, so no matter what outputDev will be initialized).

Also I did get a clean compile of kwallet with this change (though of course that doesn't seem to be everything):

diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix
index d5995459fd..51b8140def 100644
--- a/pkgs/development/libraries/kde-frameworks/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/default.nix
@@ -78,7 +78,7 @@ let
             inherit (args) name;
             inherit (srcs."${name}") src version;
 
-            outputs = args.outputs or [ "out" "dev" "bin" ];
+            outputs = args.outputs or [ "bin" "dev" "out" ];
             hasBin = lib.elem "bin" outputs;
             hasDev = lib.elem "dev" outputs;
 

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

Successfully merging this pull request may close these issues.

None yet

3 participants