Nixpkgs: haskell.compiler.ghcjs fails: Expected a type, but Hyperlink has kind * -> *

Created on 7 Apr 2020  ·  9Comments  ·  Source: NixOS/nixpkgs

On master (926a875def3d08fbf32643937a623dd6f4f1e419), this fails:

nix-build -A haskell.compiler.ghcjs

with

…
building '/nix/store/vpkv5fr8b6f2di1s2bpxpkvwscz73ccq-haddock-library-ghcjs-1.6.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5.
unpacking sources
unpacking source archive /nix/store/f3r5ki0aggp9q4bms430zn0mnxwdcfbl-configured-ghcjs-src/lib/haddock-library-ghcjs
source root is haddock-library-ghcjs
patching sources
Run jailbreak-cabal to lift version restrictions on build inputs.
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/0i4wbhkj6663nlh63ydhr01vx8w90s49-ncurses-6.2/lib --extra-lib-dirs=/nix/store/dfs0i8z58m64zak8102hf7g0w9skhdw6-libffi-3.3/lib --extra-lib-dirs=/nix/store/js28swbiimjvd139x6kr7nc68s81fdg6-gmp-6.2.0/lib
Using Parsec parser
Configuring haddock-library-ghcjs-1.6.0...
Dependency base -any: using base-4.12.0.0
Dependency bytestring -any: using bytestring-0.10.8.2
Dependency containers -any: using containers-0.6.0.1
Dependency parsec -any: using parsec-3.1.13.0
Dependency text -any: using text-1.2.3.1
Dependency transformers -any: using transformers-0.5.6.2
Dependency QuickCheck -any: using QuickCheck-2.13.2
Dependency base -any: using base-4.12.0.0
Dependency base-compat -any: using base-compat-0.11.1
Dependency bytestring -any: using bytestring-0.10.8.2
Dependency containers -any: using containers-0.6.0.1
Dependency deepseq -any: using deepseq-1.4.4.0
Dependency hspec -any: using hspec-2.7.1
Dependency parsec -any: using parsec-3.1.13.0
Dependency text -any: using text-1.2.3.1
Dependency transformers -any: using transformers-0.5.6.2
Dependency base -any: using base-4.12.0.0
Dependency base-compat -any: using base-compat-0.11.1
Dependency directory -any: using directory-1.3.3.0
Dependency filepath -any: using filepath-1.4.2.1
Dependency haddock-library -any: using haddock-library-1.8.0
Dependency optparse-applicative -any: using optparse-applicative-0.15.1.0
Dependency tree-diff -any: using tree-diff-0.1
Source component graph:
    component test:spec
    component test:fixtures
    component lib
Configured component graph:
    component haddock-library-ghcjs-1.6.0-3jOEv0SuccjCnLv4DrHhtP-spec
        include QuickCheck-2.13.2-BoBcmKmSgwjHIXfsnVFi8g
        include base-4.12.0.0
        include base-compat-0.11.1-HgwyiOzKEQ9KmBXaEHlBfi
        include bytestring-0.10.8.2
        include containers-0.6.0.1
        include deepseq-1.4.4.0
        include hspec-2.7.1-8nnxokyPwWC9FQ7e0xix8s
        include parsec-3.1.13.0
        include text-1.2.3.1
        include transformers-0.5.6.2
    component haddock-library-ghcjs-1.6.0-8QC9VCuoyD3Lv19HL3c14C-fixtures
        include base-4.12.0.0
        include base-compat-0.11.1-HgwyiOzKEQ9KmBXaEHlBfi
        include directory-1.3.3.0
        include filepath-1.4.2.1
        include haddock-library-1.8.0-19I3fmm32n5KCgLmD4fd7w
        include optparse-applicative-0.15.1.0-91LreDG4bKA3bi3R0O4wta
        include tree-diff-0.1-9yYdoYmdDZMDN64pPfpffQ
    component haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi
        include base-4.12.0.0
        include bytestring-0.10.8.2
        include containers-0.6.0.1
        include parsec-3.1.13.0
        include text-1.2.3.1
        include transformers-0.5.6.2
Linked component graph:
    unit haddock-library-ghcjs-1.6.0-3jOEv0SuccjCnLv4DrHhtP-spec
        include QuickCheck-2.13.2-BoBcmKmSgwjHIXfsnVFi8g
        include base-4.12.0.0
        include base-compat-0.11.1-HgwyiOzKEQ9KmBXaEHlBfi
        include bytestring-0.10.8.2
        include containers-0.6.0.1
        include deepseq-1.4.4.0
        include hspec-2.7.1-8nnxokyPwWC9FQ7e0xix8s
        include parsec-3.1.13.0
        include text-1.2.3.1
        include transformers-0.5.6.2
    unit haddock-library-ghcjs-1.6.0-8QC9VCuoyD3Lv19HL3c14C-fixtures
        include base-4.12.0.0
        include base-compat-0.11.1-HgwyiOzKEQ9KmBXaEHlBfi
        include directory-1.3.3.0
        include filepath-1.4.2.1
        include haddock-library-1.8.0-19I3fmm32n5KCgLmD4fd7w
        include optparse-applicative-0.15.1.0-91LreDG4bKA3bi3R0O4wta
        include tree-diff-0.1-9yYdoYmdDZMDN64pPfpffQ
    unit haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi
        include base-4.12.0.0
        include bytestring-0.10.8.2
        include containers-0.6.0.1
        include parsec-3.1.13.0
        include text-1.2.3.1
        include transformers-0.5.6.2
        Documentation.Haddock.Doc=haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi:Documentation.Haddock.Doc,Documentation.Haddock.Markup=haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi:Documentation.Haddock.Markup,Documentation.Haddock.Parser=haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi:Documentation.Haddock.Parser,Documentation.Haddock.Parser.Monad=haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi:Documentation.Haddock.Parser.Monad,Documentation.Haddock.Types=haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi:Documentation.Haddock.Types,Documentation.Haddock.Utf8=haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi:Documentation.Haddock.Utf8
Ready component graph:
    definite haddock-library-ghcjs-1.6.0-8QC9VCuoyD3Lv19HL3c14C-fixtures
        depends base-4.12.0.0
        depends base-compat-0.11.1-HgwyiOzKEQ9KmBXaEHlBfi
        depends directory-1.3.3.0
        depends filepath-1.4.2.1
        depends haddock-library-1.8.0-19I3fmm32n5KCgLmD4fd7w
        depends optparse-applicative-0.15.1.0-91LreDG4bKA3bi3R0O4wta
        depends tree-diff-0.1-9yYdoYmdDZMDN64pPfpffQ
    definite haddock-library-ghcjs-1.6.0-3jOEv0SuccjCnLv4DrHhtP-spec
        depends QuickCheck-2.13.2-BoBcmKmSgwjHIXfsnVFi8g
        depends base-4.12.0.0
        depends base-compat-0.11.1-HgwyiOzKEQ9KmBXaEHlBfi
        depends bytestring-0.10.8.2
        depends containers-0.6.0.1
        depends deepseq-1.4.4.0
        depends hspec-2.7.1-8nnxokyPwWC9FQ7e0xix8s
        depends parsec-3.1.13.0
        depends text-1.2.3.1
        depends transformers-0.5.6.2
    definite haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi
        depends base-4.12.0.0
        depends bytestring-0.10.8.2
        depends containers-0.6.0.1
        depends parsec-3.1.13.0
        depends text-1.2.3.1
        depends transformers-0.5.6.2
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghc-8.6.5
Using install prefix:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0
Executables installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/bin
Libraries installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/lib/ghc-8.6.5/x86_64-linux-ghc-8.6.5/haddock-library-ghcjs-1.6.0-16wm5IfvQER6ZZNWI7pkZi
Dynamic Libraries installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/lib/ghc-8.6.5/x86_64-linux-ghc-8.6.5
Private executables installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/libexec/x86_64-linux-ghc-8.6.5/haddock-library-ghcjs-1.6.0
Data files installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/share/x86_64-linux-ghc-8.6.5/haddock-library-ghcjs-1.6.0
Documentation installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/share/doc/x86_64-linux-ghc-8.6.5/haddock-library-ghcjs-1.6.0
Configuration files installed in:
/nix/store/3l6ykwifdwgqiiv11z7rhdb6a3n1qw2f-haddock-library-ghcjs-1.6.0/etc
No alex found
Using ar found on system at:
/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 9.3.0 given by user at:
/nix/store/x9vxn05bn19wn2mzn6d4h56glbd02pyr-gcc-wrapper-9.3.0/bin/gcc
Using ghc version 8.6.5 found on system at:
/nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/bin/ghc
Using ghc-pkg version 8.6.5 found on system at:
/nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.22.0 found on system at:
/nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/bin/haddock
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/ynyqybiwjvkmr8bkhgsr3j6khwmk7zyb-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/rnry29lhl0gvmqgb1kzngxgkpmv9rn31-binutils-wrapper-2.31.1/bin/ld.gold
No pkg-config found
Using runghc version 8.6.5 found on system at:
/nix/store/c1zpndaxjvdzgygz8kzlbz3k53bmnh01-ghc-8.6.5/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/sq2b0dqlq243mqn4ql5h36xmpplyy20k-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/g17n49rfl1zmcd1cc6p0gbsdj6pl0hd1-gnutar-1.32/bin/tar
No uhc found
building
Preprocessing test suite 'fixtures' for haddock-library-ghcjs-1.6.0..
Building test suite 'fixtures' for haddock-library-ghcjs-1.6.0..
[1 of 1] Compiling Main             ( fixtures/Fixtures.hs, dist/build/fixtures/fixtures-tmp/Main.o )

fixtures/Fixtures.hs:150:17: error:
    � Expecting one more argument to �Hyperlink�
      Expected a type, but �Hyperlink� has kind �* -> *�
    � In the first argument of �ToExpr�, namely �Hyperlink�
      In the instance declaration for �ToExpr Hyperlink�
    |
150 | instance ToExpr Hyperlink
    |                 ^^^^^^^^^

builder for '/nix/store/vpkv5fr8b6f2di1s2bpxpkvwscz73ccq-haddock-library-ghcjs-1.6.0.drv' failed with exit code 1
cannot build derivation '/nix/store/sxmba1hqqjnwh9ravwgc6fcvspf986zn-haddock-api-ghcjs-2.20.0.drv': 1 dependencies couldn't be built
building '/nix/store/q58zvcfj997g019i8r8zs5s5bxn3hxk5-http2-2.0.3.drv'...
cannot build derivation '/nix/store/n3myz4qv0yl6j5z5svhn08c8n9n714hp-ghcjs-8.6.0.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/iyzb8has2hfi5si8a9phdp8dxcp5hffa-ghcjs-8.6.0.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/iyzb8has2hfi5si8a9phdp8dxcp5hffa-ghcjs-8.6.0.1.drv' failed

Based on git log, maybe @ElvishJerricco wants to know about this?

bug haskell

All 9 comments

@nomeata Unfortunately we don't always keep haskell.compiler.ghcjs in a compilable state, but if you (or anyone else) is interested in fixing this, we would appreciate PRs fixing it up.

Is there some form of CI that would check whether it is compilable and maybe help identifying what broke it?

@nomeata

Is there some form of CI that would check whether it is compilable and maybe help identifying what broke it?

Not really.

There is @GrahamcOfBorg, which will compile haskell.compiler.ghcjs whenever someone sends a PR specifically for it.

There is also hydra, which runs builds for the various derivations in nixpkgs, but unfortunately it doesn't run all builds on all PRs (which would be too expensive). So most people don't have a good idea when different builds break.

(I was planning on linking you to the GHCJS derivations on Hydra, but it is so slow, I'm not actually able to find a good link for you. If you go to https://hydra.nixos.org/ and type in ghcjs to the search box, you might get lucky and it will load for you. I believe you should be able to use this to go back in time and figure out when the GHCJS builds broke. Although Hydra's interface doesn't necessarily make this easy.)

There are a few people who watch/review Haskell-related PRs here on nixpkgs, but we're often not too careful about the GHCJS builds. I don't think any of us use it.

There are also a few other people who often send PRs to the Haskell infrastructure (@Infinisil, @Ericson2314, @matthewbauer, etc), but I am not sure if any of them rely on the GHCJS builds.

I don't have a good solution for how to keep the GHCJS builds healthy, other than someone specifically keeping an eye on it.


Although if all you're interested in is fixing the immediate build problem, you could try git bisecting your way to the commit responsible for the breakage. I imagine the GHCJS builds have been working at least in the last couple months or so?

Oh, the Hydra search results just loaded.

I think this is the GHCJS build on nixpkgs master:

https://hydra.nixos.org/job/nixpkgs/trunk/haskell.compiler.ghcjs.x86_64-linux

It looks like this was the last successful build:

https://hydra.nixos.org/build/113124707

This was the first failure build after this success:

https://hydra.nixos.org/build/113640150

You might have to first look to see if that failure is the same one you're seeing locally. If it is, then you could try git bisect to figure out what commit caused it.

If that failure is not the same one you're seeing locally, then I'm not sure the best way to go about figuring out what broke it.

Thanks! Unfortunately, that was a weekend project, so probably won’t get to it until the next weekend where I will work on that… and pinning an old version of nixpkgs works around the problem nicely.

Are there any updates on this? I was hoping to upgrade to a newer nixpkgs to get cabal 3, but I don't know of a good working commit.

Ran into this as well. Found out that ghcjs builds fine on the release-20.03 branch (commit 8946799 currently). Hydra builds for it can be found here:

https://hydra.nixos.org/job/nixpkgs/staging-20.03/haskell.compiler.ghcjs86.x86_64-linux

Interestingly, neither of the commits on master that @cdepillabout pointed out - 1caac6 (the last successful one) and 4dfb63 (the first failing one) - are ancestors of release-20.03:

$ git merge-base --is-ancestor 1caac6 release-20.03 && echo is ancestor || echo not an ancestor
not an ancestor

$ git merge-base --is-ancestor 4dfb63 release-20.03 && echo is ancestor || echo not an ancestor
not an ancestor

I guess that means that release-20.03 contains some older packages. The version number of ghcjs is the same as in master, though - 8.6.0.1.

FYI, published a PR that should resolve this issue: https://github.com/NixOS/nixpkgs/pull/96141~~ #96193

Hopefully closed by #96193.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chris-martin picture chris-martin  ·  3Comments

domenkozar picture domenkozar  ·  3Comments

ob7 picture ob7  ·  3Comments

sid-kap picture sid-kap  ·  3Comments

teto picture teto  ·  3Comments