-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Cannot link to binary #25284
Comments
Someone will hopefully correct me if I'm wrong but I believe the issue here is that some of the libraries are being loaded dynamically at runtime via --- default.orig.nix 2017-04-29 15:09:38.386806062 +0100
+++ default.nix 2017-04-29 16:38:36.801235529 +0100
@@ -27,6 +27,7 @@
, udev
, libxkbcommon
, xorg
+, makeWrapper
}:
stdenv.mkDerivation rec {
@@ -79,6 +80,8 @@
xorg.libxkbfile
];
+ buildInputs = [ makeWrapper ];
+
phases = [ "unpackPhase" ];
unpackPhase = ''
@@ -100,6 +103,8 @@
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
$out/usr/share/nylas-mail/nylas
+ wrapProgram $out/usr/share/nylas-mail/nylas \
+ --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${libgnome_keyring}/lib";
'';
meta = { When invoked via wrapper the application starts without on issues for me but I haven't tested any of the functionality. HTH. |
Thanks @pbogdan! It works! |
@pbogdan Do you happen to know how I would use kwallet as a keyring, instead, or in addition to gnome keyring? I couldn't find much information on it. |
So, Now Nylas-Mail does start running but unfortunately because I'm using KDE, and I don't have gnome-keyring setup, the application complains that it can't store my password securely. I tried enabling gnome keyring and starting it in pam with:
Unfortunately this didn't seem to make a difference. Here's the error that gets spit out when it tells me I can't store my passwords securely.
|
Sorry, by looking at the inputs I assumed it was supposed to be using gnome2's
to:
With that change I get a prompt about creating a new keyring and seems to save the credentials successfully. |
@pbogdan Nice, that worked. Do you know it would be possible to do the same thing with Kwallet? I use KDE and unless it's absolutely necessary I'd rather not be running two keyrings. Or is this kind of thing usually keyring specific? |
Hmm, I'm also having a problem with the plugins not showing up that I think might be NixOS related. When I enable debugging you can see it's searching for something in the Nix store and being unable to find it. Maybe it's something related to how Nix cleans up the packages? Here's the error I get logged to the console:
|
Ugh, this is ugly but give this a try: --- default.orig.nix 2017-04-29 15:09:38.386806062 +0100
+++ default.nix 2017-05-01 11:55:30.565250705 +0100
@@ -5,6 +5,7 @@
, dpkg
, lib
, gnome2
+, gnome3
, libgnome_keyring
, desktop_file_utils
, python2
@@ -27,6 +28,9 @@
, udev
, libxkbcommon
, xorg
+, makeWrapper
+, gcc-unwrapped
+, coreutils
}:
stdenv.mkDerivation rec {
@@ -43,7 +47,7 @@
propagatedBuildInputs = [
gnome2.gtk
gnome2.GConf
- gnome2.gnome_keyring
+ gnome3.gnome_keyring
libgnome_keyring
desktop_file_utils
python2
@@ -79,6 +83,8 @@
xorg.libxkbfile
];
+ buildInputs = [ makeWrapper ];
+
phases = [ "unpackPhase" ];
unpackPhase = ''
@@ -100,6 +106,16 @@
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $binrp:$out/lib:${stdenv.cc.cc.lib}/lib:${lib.makeLibraryPath propagatedBuildInputs } \
$out/usr/share/nylas-mail/nylas
+ wrapProgram $out/usr/share/nylas-mail/nylas \
+ --set LD_LIBRARY_PATH "${xorg.libxkbfile}/lib:${gnome3.libgnome_keyring}/lib";
+
+ sed -i 's|/bin/bash|${stdenv.shell}|' $out/usr/share/nylas-mail/resources/apm/bin/apm
+ wrapProgram $out/usr/share/nylas-mail/resources/apm/bin/apm \
+ --set PATH "${coreutils}/bin"
+
+ patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+ --set-rpath ${gcc-unwrapped.lib}/lib \
+ $out/usr/share/nylas-mail/resources/apm/bin/node
'';
meta = { Far as I can tell the issue is that plugin management requires launching |
Hmm, that diddn't work for me with the changes applied. I'm getting this logged:
|
You have a space character here johnramsden/nixos@e9446ad#diff-162a1061d291896411fa1ebeefa8c1fcR121 in between |
Oh jeez, that's better! Thanks for all your help @pbogdan! |
Issue description
I've been trying for days to figure this out and I figured if I asked here someone might be able to point out what is going wrong.
So my original problem below with libxkb has been solved thanks to @pbogdan, and now I'm having problems with the keyring.
I went into detail below but basically I'm unable to figure out how to register this application with the gnome keyring. Preferably I would register it with my kde kwallet, but I think it will only work with a gnome keyring. Maybe someone could correct me if this is wrong.
I've patched a package with patchelf, nylas-mail and all of the libraries have been linked normally except for one, libxkbfile. When I run ldd it's missing, I even tried adding it explicitly with:
patchelf --set-rpath $ffrp:$out/lib:${stdenv.cc.cc.lib}/lib:${xorg.libxkbfile.out}/lib:${lib.makeLibraryPath propagatedBuildInputs }
and it won't add it.Here's the full config.
Steps to reproduce
Patch a binary using patchelf, when attempting to run I end up with.
The full error can be seen here.
Running ldd on the binary you can see it is clearly not linking to it properly.
It brings up nothing.
Technical details
The text was updated successfully, but these errors were encountered: