[Nix-dev] Looking for development version of zlib
Peter Simons
simons at cryp.to
Thu Jun 4 11:00:28 CEST 2015
Hi Amy,
I checked out the current Git version of "creatur":
| [simons at work:/tmp]$ git clone https://github.com/mhwombat/creatur && cd creatur
| Cloning into 'creatur'...
| remote: Counting objects: 613, done.
| remote: Total 613 (delta 0), reused 0 (delta 0), pack-reused 613
| Receiving objects: 100% (613/613), 124.39 KiB | 0 bytes/s, done.
| Resolving deltas: 100% (318/318), done.
| Checking connectivity... done.
Generated build instructions for it:
| [simons at work:/tmp/creatur]$ cabal2nix . >creatur.nix
But then the build failed:
| [simons at work:/tmp/creatur]$ nix-shell -p "haskellPackages.callPackage ./creatur.nix {}"
| these derivations will be built:
| /nix/store/klakl5g7klccmblvrh1c7pg98l81rplb-haskell-creatur-5.9.5.drv
| building path(s) ‘/nix/store/w7hxpkv7fahnk7qcpj22yb5p7605aaja-haskell-creatur-5.9.5’
| setupCompilerEnvironmentPhase
| Build with /nix/store/bc84hdk730zcdm1c9s5yf2ahpvm51lzp-ghc-7.10.1.
| unpacking sources
| unpacking source archive /nix/store/j67hsfyra2qjrpmilgw9hx3cnxpilg7f-creatur
| source root is creatur
| patching sources
| compileBuildDriverPhase
| setupCompileFlags: -package-db=/tmp/nix-build-haskell-creatur-5.9.5.drv-0/package.conf.d -j8 -threaded
| [1 of 1] Compiling Main ( Setup.hs, /tmp/nix-build-haskell-creatur-5.9.5.drv-0/Main.o )
| Linking Setup ...
| configuring
| configureFlags: --verbose --prefix=/nix/store/w7hxpkv7fahnk7qcpj22yb5p7605aaja-haskell-creatur-5.9.5 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-haskell-creatur-5.9.5.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/w7hxpkv7fahnk7qcpj22yb5p7605aaja-haskell-creatur-5.9.5/lib/ghc-7.10.1/creatur-5.9.5 --ghc-option=-j8 --enable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
| Configuring creatur-5.9.5...
| Setup: At least the following dependencies are missing:
| MonadRandom ==0.3.*, zlib ==0.5.*
| builder for ‘/nix/store/klakl5g7klccmblvrh1c7pg98l81rplb-haskell-creatur-5.9.5.drv’ failed with exit code 1
| error: build of ‘/nix/store/klakl5g7klccmblvrh1c7pg98l81rplb-haskell-creatur-5.9.5.drv’ failed
| /run/current-system/sw/bin/nix-shell: failed to build all dependencies
Now, clearly those libraries exist in Nixpkgs and they are passed to the
build, so why aren't they found? The reason is that the versions of
these libraries that we have don't fit into the version constraints:
| [nix-shell:/tmp/creatur]$ nix-env -qa -A haskellPackages.zlib
| haskell-zlib-0.6.1.1
|
| [nix-shell:/tmp/creatur]$ nix-env -qa -A haskellPackages.MonadRandom haskellPackages.zlib
| haskell-MonadRandom-0.4
At this point, the proper way to go forward is to open an upstream
ticket and to ask them to update their software:
https://github.com/mhwombat/creatur/issues/1
Meanwhile, we can try whether the build works if we just disregard the
version constraints:
| [simons at work:/tmp/creatur]$ cabal2nix --jailbreak . >creatur.nix
Et voilà:
| [simons at work:/tmp/creatur]$ nix-shell -p "haskellPackages.callPackage ./creatur.nix {}"
| [...]
| Linking dist/build/creatur-tests/creatur-tests ...
| running tests
| Running 1 test suites...
| Test suite creatur-tests: RUNNING...
| Test suite creatur-tests: PASS
| Test suite logged to: dist/test/creatur-5.9.5-creatur-tests.log
| 1 of 1 test suites (1 of 1 test cases) passed.
| Installing library in
| /nix/store/898b6wh83grjvrisgfai2znaxapw5zf3-haskell-creatur-5.9.5/lib/ghc-7.10.1/creatur-5.9.5
| Creating package registration file:
| /nix/store/898b6wh83grjvrisgfai2znaxapw5zf3-haskell-creatur-5.9.5/lib/ghc-7.10.1/package.conf.d/creatur-5.9.5.conf
| post-installation fixup
| patching ELF executables and libraries in /nix/store/898b6wh83grjvrisgfai2znaxapw5zf3-haskell-creatur-5.9.5
| /nix/store/898b6wh83grjvrisgfai2znaxapw5zf3-haskell-creatur-5.9.5/lib/ghc-7.10.1/creatur-5.9.5/libHScreatur-5.9.5-7s9QWp2Pef3B7eaMXWrnUX-ghc7.10.1.so
| gzipping man pages in /nix/store/898b6wh83grjvrisgfai2znaxapw5zf3-haskell-creatur-5.9.5
| stripping (with flags -S) in /nix/store/898b6wh83grjvrisgfai2znaxapw5zf3-haskell-creatur-5.9.5/lib
| [...]
|
| [nix-shell:/tmp/creatur]$
The build works fine with the new library versions.
More information about this subject is available at:
http://lists.science.uu.nl/pipermail/nix-dev/2015-January/015608.html
Best regards,
Peter
More information about the nix-dev
mailing list