Closed newmana closed 6 years ago
I think this might be a stack
error because I tried building the project using Nix and I got a normal build failure.
Here is my branch:
https://github.com/Gabriel439/zellige/tree/gabriel/nix
I get this build output:
$ nix-build release.nix
these derivations will be built:
/nix/store/dd7n8xfp7vs2n4rrbyzsaab2cr357wa7-zellige-0.1.0.0.drv
building path(s) ‘/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0’, ‘/nix/store/psmm5jgqx3j5v2mlqc9q0rlgdladq0hr-zellige-0.1.0.0-doc’
setupCompilerEnvironmentPhase
Build with /nix/store/xs0vhr0jlgksli9q4fd8rk2jgv32l4fl-ghc-8.0.2.
unpacking sources
unpacking source archive /nix/store/31cknvmshdfwk16qy7951pr0vg2xa4db-zellige
source root is zellige
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/tmp/nix-build-zellige-0.1.0.0.drv-0/package.conf.d -j1 -threaded
[1 of 1] Compiling Main ( Setup.hs, /private/tmp/nix-build-zellige-0.1.0.0.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/psmm5jgqx3j5v2mlqc9q0rlgdladq0hr-zellige-0.1.0.0-doc/share/doc --with-gcc=clang --package-db=/private/tmp/nix-build-zellige-0.1.0.0.drv-0/package.conf.d --ghc-option=-optl=-Wl,-headerpad_max_install_names --ghc-option=-j1 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-library-vanilla --enable-executable-dynamic --enable-tests --extra-include-dirs=/nix/store/1m1zvdz5975idkb8dc5yhzgyxxad5aqx-libc++-4.0.1/include --extra-lib-dirs=/nix/store/1m1zvdz5975idkb8dc5yhzgyxxad5aqx-libc++-4.0.1/lib
Configuring zellige-0.1.0.0...
Dependency QuickCheck -any: using QuickCheck-2.9.2
Dependency aeson -any: using aeson-1.1.2.0
Dependency base >=4.8 && <5: using base-4.9.1.0
Dependency bytestring -any: using bytestring-0.10.8.1
Dependency containers -any: using containers-0.5.7.1
Dependency geojson -any: using geojson-1.3.0
Dependency hspec -any: using hspec-2.4.4
Dependency lens -any: using lens-4.15.4
Dependency optparse-applicative -any: using optparse-applicative-0.13.2.0
Dependency scientific -any: using scientific-0.3.5.2
Dependency stm -any: using stm-2.4.4.1
Dependency text -any: using text-1.2.2.2
Dependency trifecta -any: using trifecta-1.6.2.1
Dependency unordered-containers -any: using unordered-containers-0.2.8.0
Dependency utf8-string -any: using utf8-string-1.0.1.1
Dependency vector -any: using vector-0.12.0.1
Dependency vectortiles -any: using vectortiles-1.2.0.5
Dependency zellige -any: using zellige-0.1.0.0
Using Cabal-1.24.2.0 compiled by ghc-8.0
Using compiler: ghc-8.0.2
Using install prefix:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0
Binaries installed in:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0/bin
Libraries installed in:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0/lib/ghc-8.0.2/zellige-0.1.0.0
Dynamic libraries installed in:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0/lib/ghc-8.0.2/x86_64-osx-ghc-8.0.2
Private binaries installed in:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0/libexec
Data files installed in:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0/share/x86_64-osx-ghc-8.0.2/zellige-0.1.0.0
Documentation installed in:
/nix/store/psmm5jgqx3j5v2mlqc9q0rlgdladq0hr-zellige-0.1.0.0-doc/share/doc
Configuration files installed in:
/nix/store/7b1h819i35fqmzw7l8bnij1yh1aklv4f-zellige-0.1.0.0/etc
No alex found
Using ar found on system at:
/nix/store/h2s0skxhv1hgll528lzcqkmm6d6svc8q-cctools-binutils-darwin/bin/ar
No c2hs found
No cpphs found
Using gcc version 4.2.1 given by user at:
/nix/store/jjbbzpwrxn9mb1dmqrpx0yv225pzg9av-clang-wrapper-4.0.1/bin/clang
Using ghc version 8.0.2 found on system at:
/nix/store/xs0vhr0jlgksli9q4fd8rk2jgv32l4fl-ghc-8.0.2/bin/ghc
Using ghc-pkg version 8.0.2 found on system at:
/nix/store/xs0vhr0jlgksli9q4fd8rk2jgv32l4fl-ghc-8.0.2/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.17.3 found on system at:
/nix/store/xs0vhr0jlgksli9q4fd8rk2jgv32l4fl-ghc-8.0.2/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/xs0vhr0jlgksli9q4fd8rk2jgv32l4fl-ghc-8.0.2/bin/hpc
Using hsc2hs version 0.68.1 found on system at:
/nix/store/xs0vhr0jlgksli9q4fd8rk2jgv32l4fl-ghc-8.0.2/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/b4m36018q6a55bafvpcq6b8q7q5c6fbd-hscolour-1.24.1/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/jjbbzpwrxn9mb1dmqrpx0yv225pzg9av-clang-wrapper-4.0.1/bin/ld
No lhc found
No lhc-pkg found
No pkg-config found
Using strip found on system at:
/nix/store/h2s0skxhv1hgll528lzcqkmm6d6svc8q-cctools-binutils-darwin/bin/strip
Using tar found on system at:
/nix/store/vcm8mrfhyz5j3d7sn0cafzhzlshqsh19-gnutar-1.29/bin/tar
No uhc found
building
Building zellige-0.1.0.0...
Preprocessing library zellige-0.1.0.0...
[1 of 8] Compiling Data.Geometry.Types.Types ( src/Data/Geometry/Types/Types.hs, dist/build/Data/Geometry/Types/Types.o )
[2 of 8] Compiling Data.Geometry.Types.MvtFeatures ( src/Data/Geometry/Types/MvtFeatures.hs, dist/build/Data/Geometry/Types/MvtFeatures.o )
[3 of 8] Compiling Data.Geometry.SphericalMercator ( src/Data/Geometry/SphericalMercator.hs, dist/build/Data/Geometry/SphericalMercator.o )
[4 of 8] Compiling Data.Geometry.Simplify.DouglasPeucker ( src/Data/Geometry/Simplify/DouglasPeucker.hs, dist/build/Data/Geometry/Simplify/DouglasPeucker.o )
[5 of 8] Compiling Data.Geometry.Clip ( src/Data/Geometry/Clip.hs, dist/build/Data/Geometry/Clip.o )
[6 of 8] Compiling Data.Geometry.Types.LayerConfig ( src/Data/Geometry/Types/LayerConfig.hs, dist/build/Data/Geometry/Types/LayerConfig.o )
src/Data/Geometry/Types/LayerConfig.hs:35:7: error:
• Couldn't match type ‘[Char]’ with ‘DT.Text’
Expected type: OA.Parser DT.Text
Actual type: OA.Parser String
• In the second argument of ‘(<*>)’, namely
‘OA.strOption
(OA.long "layer-name"
<> OA.metavar "VECTOR LAYER NAME" <> OA.help "Name of Layer")’
In the first argument of ‘(<*>)’, namely
‘LayerConfig
<$>
OA.strOption
(OA.long "layer-input"
<> OA.metavar "GEOJSON FILE" <> OA.help "Input GeoJSON file")
<*>
OA.strOption
(OA.long "layer-output"
<>
OA.metavar "VECTOR FILE"
<> OA.help "Output Mapnik Vector Tile file")
<*>
OA.strOption
(OA.long "layer-name"
<> OA.metavar "VECTOR LAYER NAME" <> OA.help "Name of Layer")’
In the first argument of ‘(<*>)’, namely
‘LayerConfig
<$>
OA.strOption
(OA.long "layer-input"
<> OA.metavar "GEOJSON FILE" <> OA.help "Input GeoJSON file")
<*>
OA.strOption
(OA.long "layer-output"
<>
OA.metavar "VECTOR FILE"
<> OA.help "Output Mapnik Vector Tile file")
<*>
OA.strOption
(OA.long "layer-name"
<> OA.metavar "VECTOR LAYER NAME" <> OA.help "Name of Layer")
<*>
OA.option
OA.auto
(OA.long "layer-zoom"
<> OA.help "Zoom level of layer" <> OA.metavar "INT")’
builder for ‘/nix/store/dd7n8xfp7vs2n4rrbyzsaab2cr357wa7-zellige-0.1.0.0.drv’ failed with exit code 1
error: build of ‘/nix/store/dd7n8xfp7vs2n4rrbyzsaab2cr357wa7-zellige-0.1.0.0.drv’ failed
Thanks for looking into this.
This seems to be a difference between GHC 8.0.2 and 8.2.2 - I get this compile error in 8.0.2 but not in 8.2.2.
I think it's not related to your library - given the difference in Haskell versions creates the problem. It seems like a MacOS problem.
I will try and add your nix stuff though - to the main branch.
Thanks.
You're welcome!
Steps to reproduce (stack 1.6.3):
Actual response: Takes a long time and produces giant dump-hi file or in OSX it errors out with "Main.dump-hi: hGetBuf: invalid argument (Invalid argument)". Linux doesn't crash the build but it does take a long time (our build went from 20mins to 4 mins when I removed generic and just used applicative).
Source code: https://github.com/sitewisely/zellige/blob/vBrokenOptParse/src/Data/Geometry/Types/LayerConfig.hs
The file will be in a directory like: .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/zellige/zellige-tmp/app/Main.dump-hi
If you delete that file and run "stack build" again it does work.
I don't understand the dump-hi file format but it seems like it's recursively producing some variation of the command line parameters that doesn't terminate (at least in 8GB of file).
This could be a stack, cabal or GHC 8.2.2 problem and not a optparse issue.