haskdogs on nixos
Closed this issue · 3 comments
Hi,
I want to get go to definition
working on nixos/haskell. I tried installing haskell-ide-engine to no avail.
I thought I would try hasktags/haskdogs but I still have some problems shown in the log at the end of this message:
1/ even if I disable stack, the program still checks for it => confusing
2/ haskdogs can't seem to generate tags for the libraries available in my ghc environment (I believe you are familiar with nixos, the following packages are built as part of the nix-shell:
> cabal unpack base-4.11.1.0
Can't unpack base-4.11.1.0
> cabal unpack netlink-1.1.1.0
Can't unpack netlink-1.1.1.0
> cabal unpack optparse-applicative-0.14.3.0
Can't unpack optparse-applicative-0.14.3.0
Is there anyway I can generate tags for theses packages ?
Full log:
haskdogs --use-stack OFF
Cheking for stack with GNU which
> which stack
which: no stack in (/nix/store/5jfps79ygrqwfq21xg8a6j8qlg3awsbw-ghc-8.4.4-with-packages/bin:/nix/store/s9a8h6qqdmignsqphir5jyllr5ivf0p3-ghc-8.4.4/bin:/nix/store/10yq7kwlvbc6h658izmrlsspry1g9f3c-gcc-wrapper-7.3.0/bin:/nix/store/6qmfmricr58bjivgr16y9sjisakdykag-gcc-7.3.0/bin:/nix/store/340di8nn7b9a1swdhj64324l6p4bsjfp-glibc-2.27-bin/bin:/nix/store/dzvbhkzfgwkq97ljkcvi4gs7vmflh6a0-coreutils-8.30/bin:/nix/store/an3icm1hajqx1lld6n8q4qr40nwbs544-binutils-wrapper-2.30/bin:/nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin:/nix/store/340di8nn7b9a1swdhj64324l6p4bsjfp-glibc-2.27-bin/bin:/nix/store/dzvbhkzfgwkq97ljkcvi4gs7vmflh6a0-coreutils-8.30/bin:/nix/store/21d9kpg4hqni8nfnn8asdskpf8c5f91k-remove-references-to/bin:/nix/store/jd2zmvpdnr7lswji4c0i7cjny1rinfr4-haskdogs-0.5.3/bin:/nix/store/frvxygyh82s0g89abkx3ad36zzp3335w-hasktags-0.71.2/bin:/nix/store/8nic6ljn0yzhqns9dafh862zp60rzhbz-haskell-ide-engine-0.3.0.0/bin:/nix/store/2x6iv4zw7d3if9i549kaw0y91g8d39iy-patchelf-0.9/bin:/nix/store/wvz8gp7bhwp572jy2w1n48n1rn8wdrw3-paxctl-0.9/bin:/nix/store/iirmif7qgp7pgbv80z5x1sj3hbay893d-ncurses-6.1/bin:/nix/store/iirmif7qgp7pgbv80z5x1sj3hbay893d-ncurses-6.1/bin:/nix/store/s9a8h6qqdmignsqphir5jyllr5ivf0p3-ghc-8.4.4/bin:/nix/store/10yq7kwlvbc6h658izmrlsspry1g9f3c-gcc-wrapper-7.3.0/bin:/nix/store/6qmfmricr58bjivgr16y9sjisakdykag-gcc-7.3.0/bin:/nix/store/340di8nn7b9a1swdhj64324l6p4bsjfp-glibc-2.27-bin/bin:/nix/store/dzvbhkzfgwkq97ljkcvi4gs7vmflh6a0-coreutils-8.30/bin:/nix/store/an3icm1hajqx1lld6n8q4qr40nwbs544-binutils-wrapper-2.30/bin:/nix/store/vcc4svb8gy29g4pam2zja6llkbcwsyiq-binutils-2.30/bin:/nix/store/340di8nn7b9a1swdhj64324l6p4bsjfp-glibc-2.27-bin/bin:/nix/store/dzvbhkzfgwkq97ljkcvi4gs7vmflh6a0-coreutils-8.30/bin:/nix/store/s9a8h6qqdmignsqphir5jyllr5ivf0p3-ghc-8.4.4/bin:/nix/store/21d9kpg4hqni8nfnn8asdskpf8c5f91k-remove-references-to/bin:/nix/store/iirmif7qgp7pgbv80z5x1sj3hbay893d-ncurses-6.1/bin:/nix/store/iirmif7qgp7pgbv80z5x1sj3hbay893d-ncurses-6.1/bin:/nix/store/dzvbhkzfgwkq97ljkcvi4gs7vmflh6a0-coreutils-8.30/bin:/nix/store/y6lkznrphrb5q914my4cah6cnjcc7czw-findutils-4.6.0/bin:/nix/store/hjaa4gvr4hhhacy33l69cxk182jw36sv-diffutils-3.6/bin:/nix/store/zj5pg6bcab6b5wllj87bmws432gh4sm6-gnused-4.5/bin:/nix/store/a7pnidn0y95axmhhkpm3vh7ws54qa324-gnugrep-3.1/bin:/nix/store/h1z344s6hy8pj4qddnpkia8xwjbky48j-gawk-4.2.1/bin:/nix/store/y9nwn094yhwkg11pdl1w3427lyk9nvg3-gnutar-1.30/bin:/nix/store/gkzw2a5lygmjn7bxnj4sjr79ybg8ln47-gzip-1.9/bin:/nix/store/l2i9gmhz0rsi91mz4pvvvnvzkvi5wl6b-bzip2-1.0.6.0.1-bin/bin:/nix/store/fabhw7nzi5ij0ff3dljxnfnldgzrcqgv-gnumake-4.2.1/bin:/nix/store/r47p5pzx52m3n34vdgqpk5rvqgm0m24m-bash-4.4-p23/bin:/nix/store/biyl7z0380bq3xzahv1yxzcikck0j7nb-patch-2.7.6/bin:/nix/store/3530yjs5jpm2qic5f0n8kdr25kmd1ncs-xz-5.2.4-bin/bin:/home/teto/rofi-scripts:/home/teto/buku_run:/home/teto/bin:/run/wrappers/bin:/home/teto/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/etc/profiles/per-user/teto/bin)
GNU which falied to find stack
> which hasktags
> find . -type f -and ( -name *\.hs -or -name *\.lhs -or -name *\.hsc )
> cat ./daemon.hs ./dist/build/project1/autogen/Paths_netlink_pm.hs
> ghc-pkg --simple-output find-module Prelude
Import Prelude resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module Options.Applicative
Import Options.Applicative resolved to optparse-applicative-0.14.3.0
> ghc-pkg --simple-output find-module System.Linux.Netlink
Import System.Linux.Netlink resolved to netlink-1.1.1.0
> ghc-pkg --simple-output find-module System.Linux.Netlink.GeNetlink
Import System.Linux.Netlink.GeNetlink resolved to netlink-1.1.1.0
> ghc-pkg --simple-output find-module System.Linux.Netlink.GeNetlink.Control
Import System.Linux.Netlink.GeNetlink.Control resolved to netlink-1.1.1.0
> ghc-pkg --simple-output find-module Data.Word
Import Data.Word resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module Control.Exception
Import Control.Exception resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module Data.Version
Import Data.Version resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module System.Environment
Import System.Environment resolved to base-4.11.1.0
> cabal unpack base-4.11.1.0
Can't unpack base-4.11.1.0
> cabal unpack netlink-1.1.1.0
Can't unpack netlink-1.1.1.0
> cabal unpack optparse-applicative-0.14.3.0
Can't unpack optparse-applicative-0.14.3.0
./daemon.hs
./dist/build/project1/autogen/Paths_netlink_pm.hs
> hasktags -c -x STDIN
Success
Hi, @teto. At first glance, it looks like your environment lacks cabal
executable. Could it be so? Haskdogs calls either cabal or stack to download and unpack library sources to generate tags.
I found that NIxOS note in the readme contained wrong package, it should be fixed now. Could you please try nix-shell ..
line?
thanks. I've installed cabal but it doesn't seem enough:
(ins)[nix-shell:~/mptcpnetlink/hs]$ haskdogs --use-stack OFF
Cheking for stack with GNU which
> which stack
> which hasktags
> find . -type f -and ( -name *\.hs -or -name *\.lhs -or -name *\.hsc )
> cat ./daemon.hs ./dist/build/project1/autogen/Paths_netlink_pm.hs
> ghc-pkg --simple-output find-module Prelude
Import Prelude resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module Options.Applicative
Import Options.Applicative resolved to optparse-applicative-0.14.3.0
> ghc-pkg --simple-output find-module System.Linux.Netlink
Import System.Linux.Netlink resolved to netlink-1.1.1.0
> ghc-pkg --simple-output find-module System.Linux.Netlink.GeNetlink
Import System.Linux.Netlink.GeNetlink resolved to netlink-1.1.1.0
> ghc-pkg --simple-output find-module System.Linux.Netlink.GeNetlink.Control
Import System.Linux.Netlink.GeNetlink.Control resolved to netlink-1.1.1.0
> ghc-pkg --simple-output find-module Data.Word
Import Data.Word resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module Control.Exception
Import Control.Exception resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module Data.Version
Import Data.Version resolved to base-4.11.1.0
> ghc-pkg --simple-output find-module System.Environment
Import System.Environment resolved to base-4.11.1.0
> cabal unpack base-4.11.1.0
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
cabal: There is no package named 'base'.
You may need to run 'cabal update' to get the latest list of available
packages.
Can't unpack base-4.11.1.0
> cabal unpack netlink-1.1.1.0
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
cabal: There is no package named 'netlink'.
You may need to run 'cabal update' to get the latest list of available
packages.
Can't unpack netlink-1.1.1.0
> cabal unpack optparse-applicative-0.14.3.0
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
cabal: There is no package named 'optparse-applicative'.
You may need to run 'cabal update' to get the latest list of available
packages.
Can't unpack optparse-applicative-0.14.3.0
./daemon.hs
./dist/build/project1/autogen/Paths_netlink_pm.hs
> hasktags -c -x STDIN
and I can definitely import optparse-applicative so the package is installed
I've tried to run cabal v1-update
but it exits with
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
I removed my .cabal/config file and used cabal user-config init
to regenerate it. That one contained the missing parts that then allowed cabal update
to work. I was then able to generate the tags ! Thanks for the help.