Skip to content

Instantly share code, notes, and snippets.

@seanhess
Last active July 26, 2020 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanhess/dcf4fdf06b0a38215f10e5a5bcc099d0 to your computer and use it in GitHub Desktop.
Save seanhess/dcf4fdf06b0a38215f10e5a5bcc099d0 to your computer and use it in GitHub Desktop.
Miso external dependency example (failing)
# Following the approach of https://github.com/dmjio/miso/issues/616
# This fails with an error:
# Setup: Encountered missing dependencies:
# aeson >=1.4.4.0 && <=1.6
let
overlay = self: super:
let
haskell-ghcjs-packages = super.haskell.packages.ghcjs.extend (
self: super: {
morpheus-graphql-client = super.callPackage config/morpheus-client.nix { };
morpheus-graphql-core = super.callPackage config/morpheus-core.nix { };
}
);
in {
haskell = super.haskell // {
packages = super.haskell.packages // {
ghcjs = haskell-ghcjs-packages;
};
};
};
in
with (import (builtins.fetchTarball {
url = "https://github.com/dmjio/miso/archive/ea25964565074e73d4052b56b60b6e101fa08bc5.tar.gz";
sha256 = "1yb9yvc0ln4yn1jk2k5kwwa1s32310abawz40yd8cqqkm1z7w6wg";
}) { overlays = [ overlay ]; });
pkgs.haskell.packages.ghcjs.callCabal2nix "app" ./. {}
$ nix-build
these derivations will be built:
/nix/store/1n6gxpfj5y03avjc70b1cc95yrcdzpy8-morpheus-graphql-core-0.13.0.drv
/nix/store/c8v6z57bcy43xwg0jl018nzxi6qlb67d-morpheus-graphql-client-0.13.0.drv
/nix/store/5fjqkblvk23jj7hzsjdglcsqkb7vs043-app-0.1.0.0.drv
building '/nix/store/1n6gxpfj5y03avjc70b1cc95yrcdzpy8-morpheus-graphql-core-0.13.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/938hj0i46icly476hfdg7yic1j10xk65-ghcjs-8.6.0.1.
unpacking sources
unpacking source archive /nix/store/pwsvdaw2d4k21i706ydjdgzx6sdkqc2s-morpheus-graphql-core-0.13.0.tar.gz
source root is morpheus-graphql-core-0.13.0
setting SOURCE_DATE_EPOCH to timestamp 1592848496 of file morpheus-graphql-core-0.13.0/morpheus-graphql-core.cabal
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/var/folders/k4/ssd0y__569x7nwm514tbpp5m0000gn/T/nix-build-morpheus-graphql-core-0.13.0.drv-0/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main ( /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs, /private/var/folders/k4/ssd0y__569x7nwm514tbpp5m0000gn/T/nix-build-morpheus-graphql-core-0.13.0.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/fchfamkgysvspia43n4zg1dz5qcq7fsq-morpheus-graphql-core-0.13.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --datadir=/nix/store/jf2bh0c664glz737dfnz8dwmymp6kqid-morpheus-graphql-core-0.13.0-data/share/ghcjs-8.6.0.1 --docdir=/nix/store/96djs8wwwmb83fj1xnfy2qyf7yrlhjp7-morpheus-graphql-core-0.13.0-doc/share/doc/morpheus-graphql-core-0.13.0 --with-gcc=clang --package-db=/private/var/folders/k4/ssd0y__569x7nwm514tbpp5m0000gn/T/nix-build-morpheus-graphql-core-0.13.0.drv-0/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 --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --disable-library-stripping --disable-executable-stripping --ghcjs --extra-include-dirs=/nix/store/0kn38pv5vqmkq5j4jrpqynjrwv551hjc-libc++-7.1.0/include --extra-lib-dirs=/nix/store/0kn38pv5vqmkq5j4jrpqynjrwv551hjc-libc++-7.1.0/lib --extra-include-dirs=/nix/store/vw5ffjgiy8ciglvnglad1gga0ygaydrm-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/vw5ffjgiy8ciglvnglad1gga0ygaydrm-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/mizr852kqhgrj9727yc707x4ckfw07wr-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/a3xf5hr0igg3jlap17wssayyww644521-compiler-rt-7.1.0/lib --extra-framework-dirs=/nix/store/waa0aqhsw9rzap3di15si6wdbqh7zi4b-swift-corefoundation/Library/Frameworks
Using Parsec parser
Configuring morpheus-graphql-core-0.13.0...
CallStack (from HasCallStack):
die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple
defaultMain, called at /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
aeson >=1.4.4.0 && <=1.6
builder for '/nix/store/1n6gxpfj5y03avjc70b1cc95yrcdzpy8-morpheus-graphql-core-0.13.0.drv' failed with exit code 1
cannot build derivation '/nix/store/c8v6z57bcy43xwg0jl018nzxi6qlb67d-morpheus-graphql-client-0.13.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5fjqkblvk23jj7hzsjdglcsqkb7vs043-app-0.1.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/5fjqkblvk23jj7hzsjdglcsqkb7vs043-app-0.1.0.0.drv' failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment