Closed mrVanDalo closed 6 years ago
I have the same problem, someone can help finding a fix ?
cc @peti
I suppose the correct solution would be to raise the upper bound limits of the dependency versions upstream:
"As for the over-restrictive bounds I'd be happy to merge a PR that just bumps the related dependencies if you tested that everything builds and works with them."
https://github.com/DanielG/ghc-mod/pull/928#issuecomment-368343343
@peti ghc-mod is also broken on master and 18.03. Could you maybe also take a look?
these derivations will be built:
/nix/store/zsqmaym21dfa4r5kbkwbj4xy8rx0w3xh-ghc-mod-5.8.0.0.drv
building '/nix/store/zsqmaym21dfa4r5kbkwbj4xy8rx0w3xh-ghc-mod-5.8.0.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/kl50jjg6740c8dqpb0p62pfi6n9lvcn7-ghc-8.2.2.
unpacking sources
unpacking source archive /nix/store/vq4zl3c2hhn78vqqpqsdp1466wl1iniq-ghc-mod-5.8.0.0.tar.gz
source root is ghc-mod-5.8.0.0
setting SOURCE_DATE_EPOCH to timestamp 1495938286 of file ghc-mod-5.8.0.0/test/TestUtils.hs
patching sources
Replace Cabal file with edited version from http://hackage.haskell.org/package/ghc-mod-5.8.0.0/revision/1.cabal.
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/package.conf.d -j4 -threaded
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
Setup.hs:85:60: error:
• Couldn't match expected type ‘UnitId’
with actual type ‘PathTemplate’
• In the third argument of ‘substPathTemplate’, namely
‘(progPrefix lbi)’
In the expression:
substPathTemplate (packageId pd) lbi (progPrefix lbi)
In an equation for ‘progprefix’:
progprefix = substPathTemplate (packageId pd) lbi (progPrefix lbi)
|
85 | progprefix = substPathTemplate (packageId pd) lbi (progPrefix lbi)
| ^^^^^^^^^^^^^^
Setup.hs:86:60: error:
• Couldn't match expected type ‘UnitId’
with actual type ‘PathTemplate’
• In the third argument of ‘substPathTemplate’, namely
‘(progSuffix lbi)’
In the expression:
substPathTemplate (packageId pd) lbi (progSuffix lbi)
In an equation for ‘progsuffix’:
progsuffix = substPathTemplate (packageId pd) lbi (progSuffix lbi)
|
86 | progsuffix = substPathTemplate (packageId pd) lbi (progSuffix lbi)
| ^^^^^^^^^^^^^^
Setup.hs:87:28: error:
• Couldn't match expected type ‘[a]’
with actual type ‘PathTemplate -> FilePath’
• Probable cause: ‘progprefix’ is applied to too few arguments
In the first argument of ‘(++)’, namely ‘progprefix’
In the expression: progprefix ++ exeName exe ++ progsuffix
In an equation for ‘fixedExeBaseName’:
fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
• Relevant bindings include
fixedExeBaseName :: [a] (bound at Setup.hs:87:9)
|
87 | fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
| ^^^^^^^^^^
Setup.hs:87:42: error:
• Couldn't match expected type ‘[a]’
with actual type ‘Distribution.Types.UnqualComponentName.UnqualComponentName’
• In the first argument of ‘(++)’, namely ‘exeName exe’
In the second argument of ‘(++)’, namely
‘exeName exe ++ progsuffix’
In the expression: progprefix ++ exeName exe ++ progsuffix
• Relevant bindings include
fixedExeBaseName :: [a] (bound at Setup.hs:87:9)
|
87 | fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
| ^^^^^^^^^^^
Setup.hs:87:57: error:
• Couldn't match expected type ‘[a]’
with actual type ‘PathTemplate -> FilePath’
• Probable cause: ‘progsuffix’ is applied to too few arguments
In the second argument of ‘(++)’, namely ‘progsuffix’
In the second argument of ‘(++)’, namely
‘exeName exe ++ progsuffix’
In the expression: progprefix ++ exeName exe ++ progsuffix
• Relevant bindings include
fixedExeBaseName :: [a] (bound at Setup.hs:87:9)
|
87 | fixedExeBaseName = progprefix ++ exeName exe ++ progsuffix
| ^^^^^^^^^^
Setup.hs:92:26: error:
• Couldn't match expected type ‘Distribution.Types.UnqualComponentName.UnqualComponentName’
with actual type ‘[Char]’
• In the second argument of ‘(==)’, namely ‘"ghc-mod-real"’
In the first argument of ‘when’, namely
‘(exeName exe == "ghc-mod-real")’
In the expression: when (exeName exe == "ghc-mod-real")
|
92 | when (exeName exe == "ghc-mod-real") $ do
| ^^^^^^^^^^^^^^
builder for '/nix/store/zsqmaym21dfa4r5kbkwbj4xy8rx0w3xh-ghc-mod-5.8.0.0.drv' failed with exit code 1
error: build of '/nix/store/zsqmaym21dfa4r5kbkwbj4xy8rx0w3xh-ghc-mod-5.8.0.0.drv' failed
Unfortunately, those problems are harder to fix. Note that master
is based on GHC 8.2.x (while release-17.09 still uses GHC 8.0.x), and it appears that ghc-mod
does not support that newer compiler. I might be wrong, of course, but that's what it looks like. IMHO, those build failures have to be fixed upstream.
Okay, thanks!
ghc-mod
is still broken as of today. Should it be marked as broken
until it become usable again? (Is it possible to do?)
$ nix-shell -p haskellPackages.ghc-mod -I 'nixpkgs=https://github.com/NixOS/nixpkgs/archive/master.tar.gz'
builder for '/nix/store/d5vjvp0yx9q9wns1gvzl05nrfqssxfn9-cabal-helper-0.8.1.2.drv' failed with exit code 1
cannot build derivation '/nix/store/hplbi5wsyr1wdpz6dw5aqn95kg6crj2d-ghc-mod-5.8.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/hplbi5wsyr1wdpz6dw5aqn95kg6crj2d-ghc-mod-5.8.0.0.drv' failed
Still broken in two different ways on 18.09 and unstable (channel) as of today. :/
$ nix run -f channel:nixos-unstable pkgs.haskellPackages.ghc-mod
builder for '/nix/store/ddr3fnswk05xpllfqva499aca8j2538f-ghc-mod-5.8.0.0.drv' failed with exit code 1; last 10 log lines:
Setup.hs:92:26: error:
• Couldn't match expected type ‘Distribution.Types.UnqualComponentName.UnqualComponentName’
with actual type ‘[Char]’
• In the second argument of ‘(==)’, namely ‘"ghc-mod-real"’
In the first argument of ‘when’, namely
‘(exeName exe == "ghc-mod-real")’
In the expression: when (exeName exe == "ghc-mod-real")
|
92 | when (exeName exe == "ghc-mod-real") $ do
| ^^^^^^^^^^^^^^
[5 built (1 failed), 184 copied (2660.9 MiB), 224.5 MiB DL]
error: build of '/nix/store/ddr3fnswk05xpllfqva499aca8j2538f-ghc-mod-5.8.0.0.drv' failed
$ nix run -f channel:nixos-18.09 pkgs.haskellPackages.ghc-mod
builder for '/nix/store/1703hwn599nwc393pkdilxn24rn16p89-cabal-helper-0.8.1.2.drv' failed with exit code 1; last 10 log lines:
die', called at ./Distribution/Simple/Configure.hs:958:20 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple.Configure
configureFinalizedPackage, called at ./Distribution/Simple/Configure.hs:462:12 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple.Configure
configure, called at ./Distribution/Simple.hs:596:20 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple
confHook, called at ./Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple.UserHooks
configureAction, called at ./Distribution/Simple.hs:178:19 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple
defaultMainHelper, called at ./Distribution/Simple.hs:115:27 in Cabal-2.2.0.1-302vnEvwKgd3FEKLIV6HbI:Distribution.Simple
defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
pretty-show >=1.8.1 && <1.9, temporary >=1.2.1 && <1.3
cannot build derivation '/nix/store/x7acqkrr3yh8d77iglp3338350jjxs9z-ghc-mod-5.8.0.0.drv': 1 dependencies couldn't be built
[0 built (1 failed)]
error: build of '/nix/store/x7acqkrr3yh8d77iglp3338350jjxs9z-ghc-mod-5.8.0.0.drv' failed
AFAIK threre's no upstream release supporting GHC 8.4.x. I'm building ghc-mod
and cabal-helper
from alanz' unofficial forks and it seems to work well enough on 18.09 (https://github.com/DanielG/ghc-mod/issues/931).
I switched to use vscode + hie but it would be nice to have the ghc-mod running again. The Language Server Protocol is a nice thing too.
(just posting this for people who want to find a quick alternative)
I use this hack and this expression to steal hie's ghc-mod
.
# hie_ghc-mod.nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
hie-nix = fetchFromGitHub {
owner = "wizzup";
repo = "hie-nix";
rev = "279a9bb8baad82ea20f18056420b58ce763ee4ad";
sha256 = "1j6763lzgif3wrz28gjsqp201r75rlf7gc3sjhcfa1ix74z0a6ds";
};
ghc-mod84 = (import hie-nix { }).ghc-mod84;
in
mkShell {
name = "haskell-sh";
buildInputs = [ ghc-mod84 hlint ghc ];
shellHook = ''
eval "$(egrep ^export "$(type -p ghc)")"
export PS1=$'\[\033[1;32m\][$name\u2234\W]\n$ \[\033[0m\]'
'';
}
$ nix-shell hie_ghc-mod.nix --run 'ghc-mod --version'
ghc-mod version 5.9.0.0 compiled by GHC 8.4.3
It is a bad hack, used to be easier, binary cache doesn't seem to be working but it still better than nothing
I have no idea why hie
is able to get ghc-mod
working but nixpkgs
is not.
Maybe it is because different package source (stackage vs hackage).
Issue description
I did a
nixos-rebuild switch --upgrade
today and got this :Steps to reproduce
nixos-rebuild switch --upgrade
andnix-shell -p haskellPackages.ghc-mod
(I guess)Technical details