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

[18.09] Keybase updates #55429

Merged
merged 9 commits into from Mar 2, 2019

Conversation

worldofpeace
Copy link
Contributor

Motivation for this change

Thought it would be a good idea to backport as certain users were having problems, and it seems keybase has certain restrictions with which client versions can communicate with their servers.

cc @rvolosatovs

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@kalbasit
Copy link
Member

kalbasit commented Feb 8, 2019

I'm getting an error when I try to run keybase-gui. It says that keybase is not found, but the path does exist.

 pure  λ  nix-shell -p nix-review --run 'nix-review pr 55429'
 impure  λ  keybase service &
[1] 5415
▶ INFO | net.Listen on unix:/run/user/2000/keybase/keybased.sock
 impure  λ  NIX_SKIP_KEYBASE_CHECKS=1 keybase-gui
Could not find kbfsfuse client in keybase status.
You might need to run: kbfsfuse
/nix/store/n00sfd4bvlc3q4gckxa8a4v5d7cfa91r-keybase-gui-3.0.0/bin/.keybase-gui-wrapped: line 23: /nix/store/n00sfd4bvlc3q4gckxa8a4v5d7cfa91r-keybase-gui-3.0.0/share/keybase/Keybase: No such file or directory
 impure  λ  ls -la /nix/store/n00sfd4bvlc3q4gckxa8a4v5d7cfa91r-keybase-gui-3.0.0/share/keybase/Keybase
.r-xr-xr-x 116M root 31 Dec  1969 /nix/store/n00sfd4bvlc3q4gckxa8a4v5d7cfa91r-keybase-gui-3.0.0/share/keybase/Keybase

EDIT: I also tried running kbfsfuse first, I still got the same error.
EDIT: I tried #55428 again, and I found no issues, so something is breaking the 18.09 version.

@worldofpeace does it work for you?

In the sh-session below, the first run is this PR, the second one is #55429 .

 impure  λ  strace /nix/store/n00sfd4bvlc3q4gckxa8a4v5d7cfa91r-keybase-gui-3.0.0/share/keybase/Keybase
execve("/nix/store/n00sfd4bvlc3q4gckxa8a4v5d7cfa91r-keybase-gui-3.0.0/share/keybase/Keybase", ["/nix/store/n00sfd4bvlc3q4gckxa8a"...], 0x7ffc5c00ee80 /* 196 vars */) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=2997, ...}) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
read(3, "", 4096)                       = 0
close(3)                                = 0
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 15), ...}) = 0
write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
getpid()                                = 26099
exit_group(1)                           = ?
+++ exited with 1 +++
 impure  λ  strace /nix/store/n7fkpxygw1fq3hwfy3bmg8y5zrmbdjrd-keybase-gui-3.0.0/share/keybase/Keybase
execve("/nix/store/n7fkpxygw1fq3hwfy3bmg8y5zrmbdjrd-keybase-gui-3.0.0/share/keybase/Keybase", ["/nix/store/n7fkpxygw1fq3hwfy3bmg"...], 0x7ffd47cd9690 /* 196 vars */) = 0
brk(NULL)                               = 0x55c13c7f8000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd7841f6000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd7841f4000
access("/etc/ld-nix.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/tls/haswell/x86_64/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/tls/haswell/x86_64", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/tls/haswell/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/tls/haswell", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/tls/x86_64/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/tls/x86_64", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/tls/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/tls", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/haswell/x86_64/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/haswell/x86_64", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/haswell/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/haswell", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/x86_64/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib/x86_64", 0x7fff39395fe0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/run/opengl-driver/lib/libffmpeg.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/run/opengl-driver/lib", {st_mode=S_IFDIR|0555, st_size=1138, ...}) = 0
o
...SNIP...

repo = "client";
rev = "v${version}";
sha256 = "1gfxnqzs8msxmykg1zrhrrl2slmb29gl7b8s4m2g44zxaj91gfi9";
src = fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

why this change?

Copy link
Member

Choose a reason for hiding this comment

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

Using fetchFromGitHub does not work on Darwin. Please see 8da3c3648a0279f78a130abe10941a68fec7240a for context.

Copy link
Member

Choose a reason for hiding this comment

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

Why not just redefine fetchFromGitHub as(simplified):

{
   fetchFromGitHub = {owner, repo, rev, sha256}: fetchurl {
      inherit sha256;
      url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"
   };
}

Then?
There are plenty of packages using the function(which AFAIK was considered the best practice), and so we'd need to change all invocations in nixpkgs to ensure consistency and compatibility with Darwin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'd get a major loss there as the automatically generated archives are not stable and can result in a different hash, which is something we don't want. It's less a problem to just use fetchurl for darwin and open that risk as this would never build on that platform if we didn't.

Commit msg for context

fetchFromGitHub and thus fetchzip hashes the contents of the archive and
not the archive itself. Unicode file names lead to different checksums
on HFS+ vs. other file systems because of Unicode normalisation

Though it might be worth checking if we can eliminate this problem in the near future by identifying the problematic file upstream.

Copy link
Member

Choose a reason for hiding this comment

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

Though it might be worth checking if we can eliminate this problem in the near future by identifying the problematic file upstream.

I did not like this solution either, I would love to find a way for us to hash the contents regardless of the Filesystem. Keep in mind also that most Darwin machines are now sold pre-installed with APFS, which does not suffer from this issue.

@worldofpeace
Copy link
Contributor Author

Just got wind that our kbfs is out of date. See #50999 (comment)

@worldofpeace
Copy link
Contributor Author

@kalbasit I can reproduce the issue you're having with the 18.09 version.

On master works fine.

@kalbasit
Copy link
Member

@heronhaye we're having an interesting issue with the latest Keybase on release 18.09 (see my comment above). Do you know what could be causing this?

@worldofpeace
Copy link
Contributor Author

Possible solution for keybase-gui is that we could stop patching the electron blob and just use electron_4 in nixpkgs.

@worldofpeace
Copy link
Contributor Author

Ok, realized that it's obviously a problem with autoPatchelfHook and backporting all the changes to it fixes this and another backport pr that uses it.

Not sure if that could cause problems for stable, but I'd like to care for 18.09 as best I can until the next release.

@rvolosatovs rvolosatovs mentioned this pull request Feb 17, 2019
10 tasks
@kalbasit
Copy link
Member

kalbasit commented Mar 1, 2019

@worldofpeace #55538 has been merged, you should probably rebase this PR so I can give it another try.

@worldofpeace
Copy link
Contributor Author

@kalbasit Incoming in a moment

I wasn't sure what would be the best state to have 18.09 in for keybase.
I guess having just kbfs outdated instead of everything would be better.
We should probably fix #55679 soon, but it's not a discussion for 18.09

rvolosatovs and others added 9 commits March 1, 2019 13:38
(cherry picked from commit a3a0742)
(cherry picked from commit 563d4e2)
(cherry picked from commit 239dc14)
fetchFromGitHub and thus fetchzip hashes the contents of the archive and
not the archive itself. Unicode file names lead to different checksums
on HFS+ vs. other file systems because of Unicode normalisation

(cherry picked from commit f466c9f)
(cherry picked from commit 1f332e7)
(cherry picked from commit 3bc3772)
(cherry picked from commit 66d844b)
(cherry picked from commit 6d9c525)
(cherry picked from commit ce8c243)
@kalbasit kalbasit merged commit 07ead02 into NixOS:release-18.09 Mar 2, 2019
@kalbasit
Copy link
Member

kalbasit commented Mar 2, 2019

@worldofpeace it looks good now, thanks!

@worldofpeace worldofpeace deleted the keybase-updates-backport branch March 3, 2019 00:56
@worldofpeace
Copy link
Contributor Author

You're welcome @kalbasit ❇️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: port to stable A PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants