srid / neuron

Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote)
https://neuron.zettel.page
GNU Affero General Public License v3.0
1.52k stars 150 forks source link

Unable to install on WSL #31

Closed 573 closed 4 years ago

573 commented 4 years ago
$ nix run nixpkgs.nix-info -c nix-info -m
 - system: `"x86_64-linux"`
 - host os: `Linux 4.4.0-17134-Microsoft, Arch Linux, noversion`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.2.1`
 - channels(me): `"nixpkgs-19.09pre191265.c4adeddb5f8"`
 - nixpkgs: `/home/me/.nix-defexpr/channels/nixpkgs`
 $ nix-env -if https://github.com/srid/neuron/tarball/master

gives

unpacking 'https://github.com/srid/neuron/tarball/master'... unpacking 'https://github.com/srid/rib/archive/6ba865b4b9e4831cd484c868475004038d26fab8.tar.gz'... unpacking 'https://github.com/nixos/nixpkgs/archive/24c765c744b.tar.gz'... error: attribute 'name' missing, at /nix/store/cgfjk9d24dip7rk1kxpnyyv77h994wqz-source/lib/sources.nix:76:65

srid commented 4 years ago

Judging from the host os, it looks like you are running Arch Linux on Windows Subsystem for Linux (WSL).

I cannot reproduce this on the systems I have access to (NixOS & Ubuntu) even without the cache, and I do not have access to a Windows machine, so I'm afraid I'm unable to help.

But it very much sounds to me like an issue specific to Nix on WSL. You might want to try posting this on the NixOS forum, @573.


As an aside, Github Actions (which is used to test rib and neuron in CI) does not yet have support for WSL.

srid commented 4 years ago

Also, you might want to see if upgrading nix from 2.2 to 2.3 fixes the issue.

573 commented 4 years ago

After upgrading nix v2.2 to v2.3 the installer actually seems to be doing. I'll try the declarative install by monday as well and leave you a note how it's going. Thanks again for helping out!

573 commented 4 years ago

Still not getting the clay to build, I'll move this to their issues:

Running 1 test suites... Test suite Test-Clay: RUNNING... Test-Clay: clock_getres: invalid argument (Invalid argument) Test suite Test-Clay: FAIL Test suite logged to: dist/test/clay-0.14.0-Test-Clay.log 0 of 1 test suites (0 of 1 test cases) passed. killing process 275: No such process builder for '/nix/store/gvr0hyc91q82aqlvlnk48pc74cva8y6k-clay-0.14.0.drv' failed with exit code 1 building '/nix/store/wmqdhsghv82ln69k8n99frji4g8420nc-hm-dummy1.drv'... cannot build derivation '/nix/store/1y882mhn0ih6anxfw41x5imiddprvasq-neuron-0.1.0.0.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/mpclr3svw9q08p1ylg5swajbwvbrl08x-home-manager-path.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/vfzx4w2dzk2k3imfxdizr0sr0swclvlr-home-manager-generation.drv': 1 dependencies couldn't be built error: build of '/nix/store/vfzx4w2dzk2k3imfxdizr0sr0swclvlr-home-manager-generation.drv' failed

srid commented 4 years ago

Still not getting the clay to build

That is because you are still using callPackage. You should replace that with import. Looking at your Nix expressions in the linked Clay issue it doesn't look like you have actually tried my suggestions here.

573 commented 4 years ago

@srid with (import (builtins.fetchTarball "https://github.com/srid/neuron/tarball/master") {}) as the only expression regarding neuron as a whole in my home config, it still uses ghc882 and the unreleased clay 0.14 as a resolution which fails testing on WSL apparently.

I then also tried to hook neuron inside my home.packages collections as follows to disable testing:

(pkgs.haskellPackages.callPackage (import (builtins.fetchTarball "https://github.com/srid/neuron/tarball/master") {}) {
      clay =
        let clay = pkgs.haskellPackages.clay;
        # https://github.com/NixOS/nixpkgs/blob/cdf1a522cacfb209e340af9d51c2ac4dd84e7124/pkgs/development/haskell-modules/lib.nix#L104
        in with pkgs.haskell.lib; doJailbreak (dontCheck (markUnbroken clay));
    })

(EDIT: The above let expression seems to have no effect anyway in the resulting derivation as I may even put something like doSharkbite in there without any errors / changes)

with no further effect either.

srid commented 4 years ago

@573 I see!

From what you are saying, it looks like clay tests fail on WSL (although they succeed on macOS and Linux). Okay, I've disabled clay tests in both rib and neuron. Could you try installing again using the latest master?

(By the way, neuron should indeed use ghc882 and clay 0.14, as that is what rib uses in its default.nix).

573 commented 4 years ago

Hi @srid very cool, I have since added an overlay ~/.config/nixpkgs/overlays/haskell-no-check.nix which kind of seems like a bad deed but it lets me install neuron:

# ~/.config/nixpkgs/overlays/haskell-no-check.nix
# https://stackoverflow.com/a/57854640
self: super: {
  haskell = super.haskell // {
    packageOverrides = hself: hsuper: {
      mkDerivation = args: hsuper.mkDerivation (args // {
        doCheck = false;
      });
    };
  };
}

I will import the new neuron master overnight though to test your edits.

573 commented 4 years ago

Tested latest master w/o the overlay and got similar error clock_getres (...)

Running 1 test suites... Test suite tests: RUNNING... tests: clock_getres: invalid argument (Invalid argument) Test suite tests: FAIL Test suite logged to: dist/test/hspec-megaparsec-2.1.0-tests.log 0 of 1 test suites (0 of 1 test cases) passed. killing process 23057: No such process builder for '/nix/store/w7c8w980m1gh8bw4almvhajc3s7qjswm-hspec-megaparsec-2.1.0.drv' failed with exit code 1 cannot build derivation '/nix/store/jkrw3il78w6q80z8ldisww7yyrvaj1c3-mmark-0.0.7.2.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/kjfwaza36b93x5q0527vbzqkqavj85f8-modern-uri-0.3.1.0.drv': 1 dependencies couldn't be built building '/nix/store/5rralbb1g7hjmjd89s5yr51frna70kjn-pandoc-include-code-1.5.0.0.drv'... cannot build derivation '/nix/store/33mkfq80hn7saphxsx6zp3ilfxkyn845-neuron-0.1.0.0.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/fq35ykmlvhfx637wc3drhfb3yi063lwq-home-manager-path.drv': 1 dependencies couldn't be built cannot build derivation '/nix/store/4w486ihx22jw0x3aq4qdjq70x92hh4zb-home-manager-generation.drv': 1 dependencies couldn't be built error: build of '/nix/store/4w486ihx22jw0x3aq4qdjq70x92hh4zb-home-manager-generation.drv' failed

srid commented 4 years ago

@573 This time it is megaparsec's tests that fail. It looks like several packages have broken tests on WSL. So let's forget trying to change rib/neuron for WSL's sake, especially as you have already successfully figured out a workaround (using doCheck = false; on all Haskell packages) to get neuron installed (we could add this trick to the documentation though)