ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 133 forks source link

having trouble building on OpenBSD #241

Closed bonds closed 6 years ago

bonds commented 6 years ago

When I attempt to build hoogle on OpenBSD I get this error:

~/t/haskell-ide-engine (master|✔) ❯❯❯ stack install hoogle                  Sun 2018-02-04 09:51:15 -0800
hoogle-5.0.16: configure
hoogle-5.0.16: build

--  While building custom Setup.hs for package hoogle-5.0.16 using:
      /home/scott/.stack/setup-exe-cache/x86_64-openbsd-maj6-min2/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/scott/tmp/haskell-ide-engine/.stack-work/logs/hoogle-5.0.16.log

    Configuring hoogle-5.0.16...
    Preprocessing library for hoogle-5.0.16..
    Building library for hoogle-5.0.16..
    [ 1 of 28] Compiling General.IString  ( src/General/IString.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/IString.o )
    [ 2 of 28] Compiling General.Str      ( src/General/Str.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Str.o )
    [ 3 of 28] Compiling General.Conduit  ( src/General/Conduit.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Conduit.o )
    [ 4 of 28] Compiling General.Template ( src/General/Template.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Template.o )
    [ 5 of 28] Compiling General.Util     ( src/General/Util.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Util.o )
    [ 6 of 28] Compiling General.Timing   ( src/General/Timing.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Timing.o )
    [ 7 of 28] Compiling General.Log      ( src/General/Log.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Log.o )
    [ 8 of 28] Compiling Input.Download   ( src/Input/Download.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Download.o )
    [ 9 of 28] Compiling Input.Item       ( src/Input/Item.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Item.o )
    [10 of 28] Compiling Input.Haddock    ( src/Input/Haddock.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Haddock.o )
    [11 of 28] Compiling Input.Set        ( src/Input/Set.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Set.o )
    [12 of 28] Compiling Paths_hoogle     ( .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/autogen/Paths_hoogle.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Paths_hoogle.o )
    [13 of 28] Compiling Input.Settings   ( src/Input/Settings.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Settings.o )
    [14 of 28] Compiling Input.Reorder    ( src/Input/Reorder.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Reorder.o )
    [15 of 28] Compiling Input.Cabal      ( src/Input/Cabal.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Input/Cabal.o )
    [16 of 28] Compiling General.Store    ( src/General/Store.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Store.o )
    [17 of 28] Compiling Output.Types     ( src/Output/Types.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Output/Types.o )
    [18 of 28] Compiling Output.Names     ( src/Output/Names.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Output/Names.o )
    [19 of 28] Compiling Output.Items     ( src/Output/Items.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Output/Items.o )
    [20 of 28] Compiling Action.CmdLine   ( src/Action/CmdLine.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Action/CmdLine.o )
    [21 of 28] Compiling General.Web      ( src/General/Web.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/General/Web.o )
    [22 of 28] Compiling Query            ( src/Query.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Query.o )
    [23 of 28] Compiling Output.Tags      ( src/Output/Tags.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Output/Tags.o )
    [24 of 28] Compiling Action.Generate  ( src/Action/Generate.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Action/Generate.o )
    [25 of 28] Compiling Action.Search    ( src/Action/Search.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Action/Search.o )
    [26 of 28] Compiling Action.Server    ( src/Action/Server.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Action/Server.o )
    [27 of 28] Compiling Action.Test      ( src/Action/Test.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Action/Test.o )
    [28 of 28] Compiling Hoogle           ( src/Hoogle.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/Hoogle.o )
    Preprocessing executable 'hoogle' for hoogle-5.0.16..
    Building executable 'hoogle' for hoogle-5.0.16..
    [1 of 1] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/hoogle/hoogle-tmp/Main.o )
    Linking .stack-work/dist/x86_64-openbsd-maj6-min2/Cabal-2.0.1.0/build/hoogle/hoogle ...
    /usr/local/lib/libgmp.so.10.0: warning: warning: vsprintf() is often misused, please use vsnprintf()
    /home/scott/.stack/programs/x86_64-openbsd/ghc-maj6-min2-8.2.2/lib/ghc-8.2.2/rts/libHSrts_thr.a(Linker.thr_o): In function `mkOc':

    /tmp/stack38471/hoogle-5.0.16/rts/Linker.c:1227:0: error:
         warning: warning: strcpy() is almost always misused, please use strlcpy()
    /home/scott/.stack/snapshots/x86_64-openbsd-maj6-min2/nightly-2018-01-15/8.2.2/lib/x86_64-openbsd-ghc-8.2.2/cryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7/libHScryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7.a(cryptonite_sha512.o): In function `cryptonite_sha512t_init':
    (.text+0x928): warning: warning: sprintf() is often misused, please use snprintf()
    /home/scott/.stack/snapshots/x86_64-openbsd-maj6-min2/nightly-2018-01-15/8.2.2/lib/x86_64-openbsd-ghc-8.2.2/cryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7/libHScryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7.a(decaf.o): In function `cryptonite_decaf_448_direct_scalarmul':
    (.text+0x51f7): undefined reference to `cryptonite_decaf_448_point_base'
    /home/scott/.stack/snapshots/x86_64-openbsd-maj6-min2/nightly-2018-01-15/8.2.2/lib/x86_64-openbsd-ghc-8.2.2/cryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7/libHScryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7.a(decaf.o):(.data.rel+0x0): undefined reference to `cryptonite_decaf_448_precomputed_base_as_fe'
    /home/scott/.stack/snapshots/x86_64-openbsd-maj6-min2/nightly-2018-01-15/8.2.2/lib/x86_64-openbsd-ghc-8.2.2/cryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7/libHScryptonite-0.24-3SBIli7ja4rFU9eFjjLmU7.a(decaf.o):(.data.rel.ro+0x0): undefined reference to `cryptonite_decaf_448_precomputed_wnaf_as_fe'
    collect2: ld returned 1 exit status
    `gcc' failed in phase `Linker'. (Exit code: 1)

About my system:

~ ❯❯❯ uname -a                                                              Sun 2018-02-04 09:53:00 -0800
OpenBSD maybe.ggr.com 6.2 GENERIC.MP#2 amd64
~ ❯❯❯ stack --version                                                       Sun 2018-02-04 10:08:27 -0800
Version 1.6.3 x86_64 hpack-0.20.0
~  [1] ❯❯❯ stack ghc -- --version                                           Sun 2018-02-04 10:08:47 -0800
The Glorious Glasgow Haskell Compilation System, version 8.2.2

Could this be an issue in the cryptonite package and not hoogle per se? Should I metion it to the cryptonite folks? Cryptonite builds fine, but perhaps its trying to refer to functionality that's missing or named differently on OpenBSD?

ndmitchell commented 6 years ago

CC @vincenthz - yes - looks like cryptonite to me. Can you run the cryptonite tests? I suspect it only is visible at link time.

vincenthz commented 6 years ago

it has already been fixed in master https://github.com/haskell-crypto/cryptonite/commit/cdc1a1aa174b1c25084704ec6ce32046e528d5e0 .. and you're in luck I'm actually preparing a release now

bonds commented 6 years ago

Thanks @vincenthz! Since there's nothing for hoogle to do about this I'm closing the ticket.