lingnand / VIMonad

Bringing VIM philosophy to window management
vimonad.lynnard.me
70 stars 3 forks source link

won't build on OpenBSD #8

Closed bonds closed 7 years ago

bonds commented 7 years ago

VIMonad looks awesome, so I thought I'd try it on my laptop. I was able to build xmonad, but xmonad-contrib isn't cooperating:

~/s/V/XMonadContrib (master|…) ❯❯❯ cabal install
Resolving dependencies...
Configuring BerkeleyDB-0.8.7...
Building BerkeleyDB-0.8.7...
Failed to install BerkeleyDB-0.8.7
Build log ( /home/scott/.cabal/logs/BerkeleyDB-0.8.7.log ):
Configuring BerkeleyDB-0.8.7...
Building BerkeleyDB-0.8.7...
Preprocessing library BerkeleyDB-0.8.7...
Db.hsc: In function 'main':
Db.hsc:158: error: 'DB_BUFFER_SMALL' undeclared (first use in this function)
Db.hsc:158: error: (Each undeclared identifier is reported only once
Db.hsc:158: error: for each function it appears in.)
Db.hsc:159: error: 'DB_DONOTINDEX' undeclared (first use in this function)
Db.hsc:160: error: 'DB_KEYEMPTY' undeclared (first use in this function)
Db.hsc:161: error: 'DB_KEYEXIST' undeclared (first use in this function)
Db.hsc:162: error: 'DB_LOCK_DEADLOCK' undeclared (first use in this function)
Db.hsc:163: error: 'DB_LOCK_NOTGRANTED' undeclared (first use in this function)
Db.hsc:164: error: 'DB_LOG_BUFFER_FULL' undeclared (first use in this function)
Db.hsc:165: error: 'DB_NOSERVER' undeclared (first use in this function)
Db.hsc:167: error: 'DB_NOSERVER_HOME' undeclared (first use in this function)
Db.hsc:168: error: 'DB_NOSERVER_ID' undeclared (first use in this function)
Db.hsc:170: error: 'DB_NOTFOUND' undeclared (first use in this function)
Db.hsc:171: error: 'DB_OLD_VERSION' undeclared (first use in this function)
Db.hsc:172: error: 'DB_PAGE_NOTFOUND' undeclared (first use in this function)
Db.hsc:173: error: 'DB_REP_DUPMASTER' undeclared (first use in this function)
Db.hsc:174: error: 'DB_REP_HANDLE_DEAD' undeclared (first use in this function)
Db.hsc:175: error: 'DB_REP_HOLDELECTION' undeclared (first use in this function)
Db.hsc:176: error: 'DB_REP_IGNORE' undeclared (first use in this function)
Db.hsc:177: error: 'DB_REP_ISPERM' undeclared (first use in this function)
Db.hsc:178: error: 'DB_REP_JOIN_FAILURE' undeclared (first use in this function)
Db.hsc:179: error: 'DB_REP_LEASE_EXPIRED' undeclared (first use in this function)
Db.hsc:180: error: 'DB_REP_LOCKOUT' undeclared (first use in this function)
Db.hsc:181: error: 'DB_REP_NEWSITE' undeclared (first use in this function)
Db.hsc:182: error: 'DB_REP_NOTPERM' undeclared (first use in this function)
Db.hsc:183: error: 'DB_REP_UNAVAIL' undeclared (first use in this function)
Db.hsc:184: error: 'DB_RUNRECOVERY' undeclared (first use in this function)
Db.hsc:185: error: 'DB_SECONDARY_BAD' undeclared (first use in this function)
Db.hsc:186: error: 'DB_VERIFY_BAD' undeclared (first use in this function)
Db.hsc:187: error: 'DB_VERSION_MISMATCH' undeclared (first use in this function)
Db.hsc:493: error: 'DB_CREATE' undeclared (first use in this function)
Db.hsc:494: error: 'DB_DURABLE_UNKNOWN' undeclared (first use in this function)
Db.hsc:495: error: 'DB_FORCE' undeclared (first use in this function)
Db.hsc:496: error: 'DB_MULTIVERSION' undeclared (first use in this function)
Db.hsc:497: error: 'DB_NOMMAP' undeclared (first use in this function)
Db.hsc:498: error: 'DB_RDONLY' undeclared (first use in this function)
Db.hsc:499: error: 'DB_RECOVER' undeclared (first use in this function)
Db.hsc:500: error: 'DB_THREAD' undeclared (first use in this function)
Db.hsc:501: error: 'DB_TRUNCATE' undeclared (first use in this function)
Db.hsc:502: error: 'DB_TXN_NOSYNC' undeclared (first use in this function)
Db.hsc:503: error: 'DB_TXN_NOWAIT' undeclared (first use in this function)
Db.hsc:504: error: 'DB_TXN_NOT_DURABLE' undeclared (first use in this function)
Db.hsc:505: error: 'DB_TXN_WRITE_NOSYNC' undeclared (first use in this function)
Db.hsc:506: error: 'DB_TXN_SYNC' undeclared (first use in this function)
Db.hsc:507: error: 'DB_TXN_WAIT' undeclared (first use in this function)
Db.hsc:508: error: 'DB_IGNORE_LEASE' undeclared (first use in this function)
Db.hsc:509: error: 'DB_AUTO_COMMIT' undeclared (first use in this function)
Db.hsc:510: error: 'DB_READ_COMMITTED' undeclared (first use in this function)
Db.hsc:511: error: 'DB_DEGREE_2' undeclared (first use in this function)
Db.hsc:512: error: 'DB_READ_UNCOMMITTED' undeclared (first use in this function)
Db.hsc:513: error: 'DB_DIRTY_READ' undeclared (first use in this function)
Db.hsc:514: error: 'DB_TXN_SNAPSHOT' undeclared (first use in this function)
Db.hsc:515: error: 'DB_CXX_NO_EXCEPTIONS' undeclared (first use in this function)
Db.hsc:516: error: 'DB_USE_ENVIRON' undeclared (first use in this function)
Db.hsc:517: error: 'DB_USE_ENVIRON_ROOT' undeclared (first use in this function)
Db.hsc:518: error: 'DB_INIT_CDB' undeclared (first use in this function)
Db.hsc:519: error: 'DB_INIT_LOCK' undeclared (first use in this function)
Db.hsc:520: error: 'DB_INIT_LOG' undeclared (first use in this function)
Db.hsc:521: error: 'DB_INIT_MPOOL' undeclared (first use in this function)
Db.hsc:522: error: 'DB_INIT_REP' undeclared (first use in this function)
Db.hsc:523: error: 'DB_INIT_TXN' undeclared (first use in this function)
Db.hsc:524: error: 'DB_LOCKDOWN' undeclared (first use in this function)
Db.hsc:525: error: 'DB_PRIVATE' undeclared (first use in this function)
Db.hsc:526: error: 'DB_RECOVER_FATAL' undeclared (first use in this function)
Db.hsc:527: error: 'DB_REGISTER' undeclared (first use in this function)
Db.hsc:528: error: 'DB_SYSTEM_MEM' undeclared (first use in this function)
Db.hsc:529: error: 'DB_EXCL' undeclared (first use in this function)
Db.hsc:530: error: 'DB_FCNTL_LOCKING' undeclared (first use in this function)
Db.hsc:531: error: 'DB_NO_AUTO_COMMIT' undeclared (first use in this function)
Db.hsc:532: error: 'DB_RDWRMASTER' undeclared (first use in this function)
Db.hsc:533: error: 'DB_WRITEOPEN' undeclared (first use in this function)
Db.hsc:534: error: 'DB_MULTIPLE' undeclared (first use in this function)
Db.hsc:535: error: 'DB_MULTIPLE_KEY' undeclared (first use in this function)
Db.hsc:536: error: 'DB_RMW' undeclared (first use in this function)
Db.hsc:537: error: 'DB_LOCK_NOWAIT' undeclared (first use in this function)
Db.hsc:538: error: 'DB_AFTER' undeclared (first use in this function)
Db.hsc:539: error: 'DB_APPEND' undeclared (first use in this function)
Db.hsc:540: error: 'DB_BEFORE' undeclared (first use in this function)
Db.hsc:541: error: 'DB_CONSUME' undeclared (first use in this function)
Db.hsc:542: error: 'DB_CONSUME_WAIT' undeclared (first use in this function)
Db.hsc:543: error: 'DB_CURRENT' undeclared (first use in this function)
Db.hsc:544: error: 'DB_FIRST' undeclared (first use in this function)
Db.hsc:545: error: 'DB_GET_BOTH' undeclared (first use in this function)
Db.hsc:546: error: 'DB_GET_BOTHC' undeclared (first use in this function)
Db.hsc:547: error: 'DB_GET_BOTH_RANGE' undeclared (first use in this function)
Db.hsc:548: error: 'DB_GET_RECNO' undeclared (first use in this function)
Db.hsc:549: error: 'DB_JOIN_ITEM' undeclared (first use in this function)
Db.hsc:550: error: 'DB_KEYFIRST' undeclared (first use in this function)
Db.hsc:551: error: 'DB_KEYLAST' undeclared (first use in this function)
Db.hsc:552: error: 'DB_LAST' undeclared (first use in this function)
Db.hsc:553: error: 'DB_NEXT' undeclared (first use in this function)
Db.hsc:554: error: 'DB_NEXT_DUP' undeclared (first use in this function)
Db.hsc:555: error: 'DB_NEXT_NODUP' undeclared (first use in this function)
Db.hsc:556: error: 'DB_NODUPDATA' undeclared (first use in this function)
Db.hsc:557: error: 'DB_NOOVERWRITE' undeclared (first use in this function)
Db.hsc:558: error: 'DB_NOSYNC' undeclared (first use in this function)
Db.hsc:559: error: 'DB_POSITION' undeclared (first use in this function)
Db.hsc:560: error: 'DB_PREV' undeclared (first use in this function)
Db.hsc:561: error: 'DB_PREV_DUP' undeclared (first use in this function)
Db.hsc:562: error: 'DB_PREV_NODUP' undeclared (first use in this function)
Db.hsc:563: error: 'DB_SET' undeclared (first use in this function)
Db.hsc:564: error: 'DB_SET_RANGE' undeclared (first use in this function)
Db.hsc:565: error: 'DB_SET_RECNO' undeclared (first use in this function)
Db.hsc:566: error: 'DB_UPDATE_SECONDARY' undeclared (first use in this function)
Db.hsc:567: error: 'DB_WRITECURSOR' undeclared (first use in this function)
Db.hsc:568: error: 'DB_WRITELOCK' undeclared (first use in this function)
Db.hsc:569: error: 'DB_DUP' undeclared (first use in this function)
Db.hsc:570: error: 'DB_DUPSORT' undeclared (first use in this function)
Db.hsc:618: error: 'DB_LOCK_NORUN' undeclared (first use in this function)
Db.hsc:619: error: 'DB_LOCK_DEFAULT' undeclared (first use in this function)
Db.hsc:620: error: 'DB_LOCK_EXPIRE' undeclared (first use in this function)
Db.hsc:621: error: 'DB_LOCK_MAXLOCKS' undeclared (first use in this function)
Db.hsc:622: error: 'DB_LOCK_MAXWRITE' undeclared (first use in this function)
Db.hsc:623: error: 'DB_LOCK_MINLOCKS' undeclared (first use in this function)
Db.hsc:624: error: 'DB_LOCK_MINWRITE' undeclared (first use in this function)
Db.hsc:625: error: 'DB_LOCK_OLDEST' undeclared (first use in this function)
Db.hsc:626: error: 'DB_LOCK_RANDOM' undeclared (first use in this function)
Db.hsc:627: error: 'DB_LOCK_YOUNGEST' undeclared (first use in this function)
Db.hsc:909: error: 'DB_LOCK_READ' undeclared (first use in this function)
Db.hsc:910: error: 'DB_LOCK_WRITE' undeclared (first use in this function)
Db.hsc:911: error: 'DB_LOCK_IWRITE' undeclared (first use in this function)
Db.hsc:912: error: 'DB_LOCK_IREAD' undeclared (first use in this function)
Db.hsc:913: error: 'DB_LOCK_IWR' undeclared (first use in this function)
compiling dist/build/Database/Berkeley/Db_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/Database/Berkeley/Db_hsc_make.c -o dist/build/Database/Berkeley/Db_hsc_make.o -fno-pie -nopie -fno-stack-protector -D__GLASGOW_HASKELL__=710 -Dopenbsd_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dopenbsd_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -IDatabase/Berkeley/ -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc/bytes_6VWy06pWzJq9evDvK2d4w6/include -I/usr/local/include -I/usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM/include -I/usr/local/lib/ghc/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include -I/usr/local/lib/ghc/include -I/usr/local/lib/ghc/include/
cabal: Error: some packages failed to install:
BerkeleyDB-0.8.7 failed during the building phase. The exception was:
ExitFailure 1
xmonad-contrib-0.12 depends on BerkeleyDB-0.8.7 which failed to install.

I tried ripping out the code that depends on BerkeleyDB, the CIM stuff, to see if I could build it without that feature, but soon realized the surgery wouldn't require more knowledge of the code that I currently have.

So, just in case you're interested, I thought I'd share.

bonds commented 7 years ago

I'm running OpenBSD 6.0-stable amd64, GHC 7.10.3, cabal lib 1.22.8.0, BerkeleyDB 4.6.21p3v0.

bonds commented 7 years ago

I tried both cabal install and stack init; stack install. I tried setting the BerkeleyDB haskell module to a lower version, e.g. 0.7, 0.6, etc. none of those built either.

lingnand commented 7 years ago

Can you verify you've had BerkeleyDB installed in your system? Which system prefix did you install it to?

From the error it looks like the names can't be found (but they are actually in the file); can you download the package from here https://hackage.haskell.org/package/BerkeleyDB and try installing from that local copy?

bonds commented 7 years ago

BerkeleyDB is installed. Its in /usr/local, see below:

~ ❯❯❯ pkg_info -c db
Information for inst:db-4.6.21p3v0

Comment:
Berkeley DB package, revision 4

~ ❯❯❯ which db4_dump
/usr/local/bin/db4_dump

I just downloaded the tarball, extracted, and ran cabal build and got the same sort of errors.

lingnand commented 7 years ago

OK, let me take a look over the weekend and then get back to you.

lingnand commented 7 years ago

Tested on Mac OS (unfortunately don't have access on an OpenBSD) without any problem. Can you do cabal --verbose build?

bonds commented 7 years ago

Here you are:

~/s/V/XMonadContrib (master|…) ❯❯❯ cabal --verbose build
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
/usr/local/bin/ghc --numeric-version
looking for tool ghc-pkg near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
/usr/local/bin/ghc-pkg --version
/usr/local/bin/ghc --supported-languages
/usr/local/bin/ghc --info
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Could not resolve dependencies:
trying: xmonad-contrib-0.12 (user goal)
next goal: BerkeleyDB (dependency of xmonad-contrib-0.12)
Dependency tree exhaustively searched.
Configuring xmonad-contrib-0.12...
cabal: At least the following dependencies are missing:
BerkeleyDB -any

And the install version:

~/s/V/XMonadContrib (master|…) ❯❯❯ cabal --verbose install
/home/scott/.stack/snapshots/x86_64-openbsd/lts-6.18/7.10.3/bin/cpphs --version
/usr/bin/gcc -dumpversion
/usr/local/bin/haddock --version
/home/scott/.stack/snapshots/x86_64-openbsd/lts-6.18/7.10.3/bin/happy --version
/usr/local/bin/hpc version
looking for tool hsc2hs near compiler in /usr/local/bin
found hsc2hs in /usr/local/bin/hsc2hs
/usr/local/bin/hsc2hs --version
/home/scott/.stack/snapshots/x86_64-openbsd/lts-6.18/7.10.3/bin/HsColour -version
/usr/local/bin/ghc -c /tmp/21179751702107712385.c -o /tmp/1737286352011530961.o
/usr/bin/ld -x -r /tmp/1737286352011530961.o -o /tmp/16952195921476773586.o
/usr/bin/pkg-config --version
/bin/tar --help
Reading available packages...
Choosing modular solver.
Resolving dependencies...
Ready to install BerkeleyDB-0.8.7
Extracting
/home/scott/.cabal/packages/hackage.haskell.org/BerkeleyDB/0.8.7/BerkeleyDB-0.8.7.tar.gz
Waiting for install task to finish...
to /tmp/cabal-tmp-8064...
Updating BerkeleyDB.cabal with the latest revision from the index.
Configuring BerkeleyDB-0.8.7...
creating /tmp/cabal-tmp-8064/BerkeleyDB-0.8.7/dist/setup
creating /tmp/cabal-tmp-8064/BerkeleyDB-0.8.7/dist
creating /tmp/cabal-tmp-8064/BerkeleyDB-0.8.7/dist/setup
/home/scott/.cabal/setup-exe-cache/setup-Simple-Cabal-1.22.5.0-x86_64-openbsd-ghc-7.10.3
configure --verbose=2 --ghc --prefix=/home/scott/.cabal
--bindir=/home/scott/.cabal/bin --libdir=/home/scott/.cabal/lib
--libsubdir=x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7-CYjj0jT2ofQ2a8LSUpEda4
--libexecdir=/home/scott/.cabal/libexec --datadir=/home/scott/.cabal/share
--datasubdir=x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7
--docdir=/home/scott/.cabal/share/doc/x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7
--htmldir=/home/scott/.cabal/share/doc/x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7/html
--haddockdir=/home/scott/.cabal/share/doc/x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7/html
--sysconfdir=/home/scott/.cabal/etc --user
--extra-prog-path=/home/scott/.cabal/bin
--dependency=extensible-exceptions=extensible-exceptions-0.1.1.4-8159918b63d70675389129eaecbf720a
--dependency=bytestring=bytestring-0.10.6.0-8a126a308e25adafa4b7221965acccd5
--dependency=base=base-4.8.2.0-8dd7859ce039df9f3d3f4ff9dbf4bb93
--disable-tests --exact-configuration --disable-benchmarks
Redirecting build log to {handle:
/home/scott/.cabal/logs/BerkeleyDB-0.8.7.log}
Building BerkeleyDB-0.8.7...
creating /tmp/cabal-tmp-8064/BerkeleyDB-0.8.7/dist/setup
/home/scott/.cabal/setup-exe-cache/setup-Simple-Cabal-1.22.5.0-x86_64-openbsd-ghc-7.10.3
build --verbose=2
Redirecting build log to {handle:
/home/scott/.cabal/logs/BerkeleyDB-0.8.7.log}
Failed to install BerkeleyDB-0.8.7
Build log ( /home/scott/.cabal/logs/BerkeleyDB-0.8.7.log ):
Configuring BerkeleyDB-0.8.7...
Dependency base ==4.8.2.0: using base-4.8.2.0
Dependency bytestring ==0.10.6.0: using bytestring-0.10.6.0
Dependency extensible-exceptions ==0.1.1.4: using
extensible-exceptions-0.1.1.4
Using Cabal-1.22.5.0 compiled by ghc-7.10
Using compiler: ghc-7.10.3
Using install prefix: /home/scott/.cabal
Binaries installed in: /home/scott/.cabal/bin
Libraries installed in:
/home/scott/.cabal/lib/x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7-CYjj0jT2ofQ2a8LSUpEda4
Private binaries installed in: /home/scott/.cabal/libexec
Data files installed in:
/home/scott/.cabal/share/x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7
Documentation installed in:
/home/scott/.cabal/share/doc/x86_64-openbsd-ghc-7.10.3/BerkeleyDB-0.8.7
Configuration files installed in: /home/scott/.cabal/etc
No alex found
Using ar found on system at: /usr/bin/ar
No c2hs found
Using cpphs version 1.20.2 found on system at:
/home/scott/.stack/snapshots/x86_64-openbsd/lts-6.18/7.10.3/bin/cpphs
Using gcc version 4.2.1 found on system at: /usr/bin/gcc
Using ghc version 7.10.3 found on system at: /usr/local/bin/ghc
Using ghc-pkg version 7.10.3 found on system at: /usr/local/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.16.1 found on system at: /usr/local/bin/haddock
Using happy version 1.19.5 found on system at:
/home/scott/.stack/snapshots/x86_64-openbsd/lts-6.18/7.10.3/bin/happy
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: /usr/local/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/local/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/home/scott/.stack/snapshots/x86_64-openbsd/lts-6.18/7.10.3/bin/HsColour
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.27.1 found on system at: /usr/bin/pkg-config
Using strip version 2.17 found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
Component build order: library
creating dist/build
creating dist/build/autogen
Building BerkeleyDB-0.8.7...
/usr/local/bin/ghc-pkg init dist/package.conf.inplace
Preprocessing library BerkeleyDB-0.8.7...
creating dist/build/Database/Berkeley
creating dist/build/Database
creating dist/build/Database/Berkeley
/usr/local/bin/hsc2hs '--cc=/usr/bin/gcc' '--ld=/usr/bin/gcc' '--cflag=-D__GLASGOW_HASKELL__=710' '--cflag=-Dopenbsd_BUILD_OS=1' '--cflag=-Dx86_64_BUILD_ARCH=1' '--cflag=-Dopenbsd_HOST_OS=1' '--cflag=-Dx86_64_HOST_ARCH=1' '--cflag=-IDatabase/Berkeley/' '--cflag=-Idist/build/autogen' '--cflag=-include' '--cflag=dist/build/autogen/cabal_macros.h' '--lflag=-ldb' '--cflag=-I/usr/local/lib/ghc/bytes_6VWy06pWzJq9evDvK2d4w6/include' '--cflag=-I/usr/local/include' '--cflag=-I/usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM/include' '--cflag=-I/usr/local/lib/ghc/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include' '--cflag=-I/usr/local/lib/ghc/include' '--lflag=-L/home/scott/.cabal/lib/x86_64-openbsd-ghc-7.10.3/extensible-exceptions-0.1.1.4-FEBYnjUcabpEXD3JqlYlJc' '--lflag=-Wl,-R,/home/scott/.cabal/lib/x86_64-openbsd-ghc-7.10.3/extensible-exceptions-0.1.1.4-FEBYnjUcabpEXD3JqlYlJc' '--lflag=-L/usr/local/lib/ghc/bytes_6VWy06pWzJq9evDvK2d4w6' '--lflag=-Wl,-R,/usr/local/lib/ghc/bytes_6VWy06pWzJq9evDvK2d4w6' '--lflag=-L/usr/local/lib/ghc/deeps_6vMKxt5sPFR0XsbRWvvq59' '--lflag=-Wl,-R,/usr/local/lib/ghc/deeps_6vMKxt5sPFR0XsbRWvvq59' '--lflag=-L/usr/local/lib/ghc/array_67iodizgJQIIxYVTp4emlA' '--lflag=-Wl,-R,/usr/local/lib/ghc/array_67iodizgJQIIxYVTp4emlA' '--lflag=-L/usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM' '--lflag=-L/usr/local/lib' '--lflag=-Wl,-R,/usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM' '--lflag=-Wl,-R,/usr/local/lib' '--lflag=-liconv' '--lflag=-L/usr/local/lib/ghc/integ_2aU3IZNMF9a7mQ0OzsZ0dS' '--lflag=-Wl,-R,/usr/local/lib/ghc/integ_2aU3IZNMF9a7mQ0OzsZ0dS' '--lflag=-L/usr/local/lib/ghc/ghcpr_8TmvWUcS1U1IKHT0levwg3' '--lflag=-Wl,-R,/usr/local/lib/ghc/ghcpr_8TmvWUcS1U1IKHT0levwg3' '--lflag=-L/usr/local/lib/ghc/rts' '--lflag=-Wl,-R,/usr/local/lib/ghc/rts' '--lflag=-lm' -o dist/build/Database/Berkeley/Db.hs Database/Berkeley/Db.hsc
Db.hsc: In function 'main':
Db.hsc:158: error: 'DB_BUFFER_SMALL' undeclared (first use in this function)
Db.hsc:158: error: (Each undeclared identifier is reported only once
Db.hsc:158: error: for each function it appears in.)
Db.hsc:159: error: 'DB_DONOTINDEX' undeclared (first use in this function)
Db.hsc:160: error: 'DB_KEYEMPTY' undeclared (first use in this function)
Db.hsc:161: error: 'DB_KEYEXIST' undeclared (first use in this function)
Db.hsc:162: error: 'DB_LOCK_DEADLOCK' undeclared (first use in this function)
Db.hsc:163: error: 'DB_LOCK_NOTGRANTED' undeclared (first use in this function)
Db.hsc:164: error: 'DB_LOG_BUFFER_FULL' undeclared (first use in this function)
Db.hsc:165: error: 'DB_NOSERVER' undeclared (first use in this function)
Db.hsc:167: error: 'DB_NOSERVER_HOME' undeclared (first use in this function)
Db.hsc:168: error: 'DB_NOSERVER_ID' undeclared (first use in this function)
Db.hsc:170: error: 'DB_NOTFOUND' undeclared (first use in this function)
Db.hsc:171: error: 'DB_OLD_VERSION' undeclared (first use in this function)
Db.hsc:172: error: 'DB_PAGE_NOTFOUND' undeclared (first use in this function)
Db.hsc:173: error: 'DB_REP_DUPMASTER' undeclared (first use in this function)
Db.hsc:174: error: 'DB_REP_HANDLE_DEAD' undeclared (first use in this function)
Db.hsc:175: error: 'DB_REP_HOLDELECTION' undeclared (first use in this function)
Db.hsc:176: error: 'DB_REP_IGNORE' undeclared (first use in this function)
Db.hsc:177: error: 'DB_REP_ISPERM' undeclared (first use in this function)
Db.hsc:178: error: 'DB_REP_JOIN_FAILURE' undeclared (first use in this function)
Db.hsc:179: error: 'DB_REP_LEASE_EXPIRED' undeclared (first use in this function)
Db.hsc:180: error: 'DB_REP_LOCKOUT' undeclared (first use in this function)
Db.hsc:181: error: 'DB_REP_NEWSITE' undeclared (first use in this function)
Db.hsc:182: error: 'DB_REP_NOTPERM' undeclared (first use in this function)
Db.hsc:183: error: 'DB_REP_UNAVAIL' undeclared (first use in this function)
Db.hsc:184: error: 'DB_RUNRECOVERY' undeclared (first use in this function)
Db.hsc:185: error: 'DB_SECONDARY_BAD' undeclared (first use in this function)
Db.hsc:186: error: 'DB_VERIFY_BAD' undeclared (first use in this function)
Db.hsc:187: error: 'DB_VERSION_MISMATCH' undeclared (first use in this function)
Db.hsc:493: error: 'DB_CREATE' undeclared (first use in this function)
Db.hsc:494: error: 'DB_DURABLE_UNKNOWN' undeclared (first use in this function)
Db.hsc:495: error: 'DB_FORCE' undeclared (first use in this function)
Db.hsc:496: error: 'DB_MULTIVERSION' undeclared (first use in this function)
Db.hsc:497: error: 'DB_NOMMAP' undeclared (first use in this function)
Db.hsc:498: error: 'DB_RDONLY' undeclared (first use in this function)
Db.hsc:499: error: 'DB_RECOVER' undeclared (first use in this function)
Db.hsc:500: error: 'DB_THREAD' undeclared (first use in this function)
Db.hsc:501: error: 'DB_TRUNCATE' undeclared (first use in this function)
Db.hsc:502: error: 'DB_TXN_NOSYNC' undeclared (first use in this function)
Db.hsc:503: error: 'DB_TXN_NOWAIT' undeclared (first use in this function)
Db.hsc:504: error: 'DB_TXN_NOT_DURABLE' undeclared (first use in this function)
Db.hsc:505: error: 'DB_TXN_WRITE_NOSYNC' undeclared (first use in this function)
Db.hsc:506: error: 'DB_TXN_SYNC' undeclared (first use in this function)
Db.hsc:507: error: 'DB_TXN_WAIT' undeclared (first use in this function)
Db.hsc:508: error: 'DB_IGNORE_LEASE' undeclared (first use in this function)
Db.hsc:509: error: 'DB_AUTO_COMMIT' undeclared (first use in this function)
Db.hsc:510: error: 'DB_READ_COMMITTED' undeclared (first use in this function)
Db.hsc:511: error: 'DB_DEGREE_2' undeclared (first use in this function)
Db.hsc:512: error: 'DB_READ_UNCOMMITTED' undeclared (first use in this function)
Db.hsc:513: error: 'DB_DIRTY_READ' undeclared (first use in this function)
Db.hsc:514: error: 'DB_TXN_SNAPSHOT' undeclared (first use in this function)
Db.hsc:515: error: 'DB_CXX_NO_EXCEPTIONS' undeclared (first use in this function)
Db.hsc:516: error: 'DB_USE_ENVIRON' undeclared (first use in this function)
Db.hsc:517: error: 'DB_USE_ENVIRON_ROOT' undeclared (first use in this function)
Db.hsc:518: error: 'DB_INIT_CDB' undeclared (first use in this function)
Db.hsc:519: error: 'DB_INIT_LOCK' undeclared (first use in this function)
Db.hsc:520: error: 'DB_INIT_LOG' undeclared (first use in this function)
Db.hsc:521: error: 'DB_INIT_MPOOL' undeclared (first use in this function)
Db.hsc:522: error: 'DB_INIT_REP' undeclared (first use in this function)
Db.hsc:523: error: 'DB_INIT_TXN' undeclared (first use in this function)
Db.hsc:524: error: 'DB_LOCKDOWN' undeclared (first use in this function)
Db.hsc:525: error: 'DB_PRIVATE' undeclared (first use in this function)
Db.hsc:526: error: 'DB_RECOVER_FATAL' undeclared (first use in this function)
Db.hsc:527: error: 'DB_REGISTER' undeclared (first use in this function)
Db.hsc:528: error: 'DB_SYSTEM_MEM' undeclared (first use in this function)
Db.hsc:529: error: 'DB_EXCL' undeclared (first use in this function)
Db.hsc:530: error: 'DB_FCNTL_LOCKING' undeclared (first use in this function)
Db.hsc:531: error: 'DB_NO_AUTO_COMMIT' undeclared (first use in this function)
Db.hsc:532: error: 'DB_RDWRMASTER' undeclared (first use in this function)
Db.hsc:533: error: 'DB_WRITEOPEN' undeclared (first use in this function)
Db.hsc:534: error: 'DB_MULTIPLE' undeclared (first use in this function)
Db.hsc:535: error: 'DB_MULTIPLE_KEY' undeclared (first use in this function)
Db.hsc:536: error: 'DB_RMW' undeclared (first use in this function)
Db.hsc:537: error: 'DB_LOCK_NOWAIT' undeclared (first use in this function)
Db.hsc:538: error: 'DB_AFTER' undeclared (first use in this function)
Db.hsc:539: error: 'DB_APPEND' undeclared (first use in this function)
Db.hsc:540: error: 'DB_BEFORE' undeclared (first use in this function)
Db.hsc:541: error: 'DB_CONSUME' undeclared (first use in this function)
Db.hsc:542: error: 'DB_CONSUME_WAIT' undeclared (first use in this function)
Db.hsc:543: error: 'DB_CURRENT' undeclared (first use in this function)
Db.hsc:544: error: 'DB_FIRST' undeclared (first use in this function)
Db.hsc:545: error: 'DB_GET_BOTH' undeclared (first use in this function)
Db.hsc:546: error: 'DB_GET_BOTHC' undeclared (first use in this function)
Db.hsc:547: error: 'DB_GET_BOTH_RANGE' undeclared (first use in this function)
Db.hsc:548: error: 'DB_GET_RECNO' undeclared (first use in this function)
Db.hsc:549: error: 'DB_JOIN_ITEM' undeclared (first use in this function)
Db.hsc:550: error: 'DB_KEYFIRST' undeclared (first use in this function)
Db.hsc:551: error: 'DB_KEYLAST' undeclared (first use in this function)
Db.hsc:552: error: 'DB_LAST' undeclared (first use in this function)
Db.hsc:553: error: 'DB_NEXT' undeclared (first use in this function)
Db.hsc:554: error: 'DB_NEXT_DUP' undeclared (first use in this function)
Db.hsc:555: error: 'DB_NEXT_NODUP' undeclared (first use in this function)
Db.hsc:556: error: 'DB_NODUPDATA' undeclared (first use in this function)
Db.hsc:557: error: 'DB_NOOVERWRITE' undeclared (first use in this function)
Db.hsc:558: error: 'DB_NOSYNC' undeclared (first use in this function)
Db.hsc:559: error: 'DB_POSITION' undeclared (first use in this function)
Db.hsc:560: error: 'DB_PREV' undeclared (first use in this function)
Db.hsc:561: error: 'DB_PREV_DUP' undeclared (first use in this function)
Db.hsc:562: error: 'DB_PREV_NODUP' undeclared (first use in this function)
Db.hsc:563: error: 'DB_SET' undeclared (first use in this function)
Db.hsc:564: error: 'DB_SET_RANGE' undeclared (first use in this function)
Db.hsc:565: error: 'DB_SET_RECNO' undeclared (first use in this function)
Db.hsc:566: error: 'DB_UPDATE_SECONDARY' undeclared (first use in this function)
Db.hsc:567: error: 'DB_WRITECURSOR' undeclared (first use in this function)
Db.hsc:568: error: 'DB_WRITELOCK' undeclared (first use in this function)
Db.hsc:569: error: 'DB_DUP' undeclared (first use in this function)
Db.hsc:570: error: 'DB_DUPSORT' undeclared (first use in this function)
Db.hsc:618: error: 'DB_LOCK_NORUN' undeclared (first use in this function)
Db.hsc:619: error: 'DB_LOCK_DEFAULT' undeclared (first use in this function)
Db.hsc:620: error: 'DB_LOCK_EXPIRE' undeclared (first use in this function)
Db.hsc:621: error: 'DB_LOCK_MAXLOCKS' undeclared (first use in this function)
Db.hsc:622: error: 'DB_LOCK_MAXWRITE' undeclared (first use in this function)
Db.hsc:623: error: 'DB_LOCK_MINLOCKS' undeclared (first use in this function)
Db.hsc:624: error: 'DB_LOCK_MINWRITE' undeclared (first use in this function)
Db.hsc:625: error: 'DB_LOCK_OLDEST' undeclared (first use in this function)
Db.hsc:626: error: 'DB_LOCK_RANDOM' undeclared (first use in this function)
Db.hsc:627: error: 'DB_LOCK_YOUNGEST' undeclared (first use in this function)
Db.hsc:909: error: 'DB_LOCK_READ' undeclared (first use in this function)
Db.hsc:910: error: 'DB_LOCK_WRITE' undeclared (first use in this function)
Db.hsc:911: error: 'DB_LOCK_IWRITE' undeclared (first use in this function)
Db.hsc:912: error: 'DB_LOCK_IREAD' undeclared (first use in this function)
Db.hsc:913: error: 'DB_LOCK_IWR' undeclared (first use in this function)
compiling dist/build/Database/Berkeley/Db_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/Database/Berkeley/Db_hsc_make.c -o dist/build/Database/Berkeley/Db_hsc_make.o -fno-pie -nopie -fno-stack-protector -D__GLASGOW_HASKELL__=710 -Dopenbsd_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dopenbsd_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -IDatabase/Berkeley/ -Idist/build/autogen -include dist/build/autogen/cabal_macros.h -I/usr/local/lib/ghc/bytes_6VWy06pWzJq9evDvK2d4w6/include -I/usr/local/include -I/usr/local/lib/ghc/base_HQfYBxpPvuw8OunzQu6JGM/include -I/usr/local/lib/ghc/integ_2aU3IZNMF9a7mQ0OzsZ0dS/include -I/usr/local/lib/ghc/include -I/usr/local/lib/ghc/include/
cabal: Error: some packages failed to install:
BerkeleyDB-0.8.7 failed during the building phase. The exception was:
ExitFailure 1
xmonad-contrib-0.12 depends on BerkeleyDB-0.8.7 which failed to install.
bonds commented 7 years ago

Thanks, I appreciate it!

lingnand commented 7 years ago

Sorry for coming back to this so late - can you check in your <db.h> if you have the constants being complained about?

bonds commented 7 years ago

ok, I checked out the code from the repo darcs get http://code.haskell.org/BerkeleyDB/ and built, getting the same errors. There is no db.h:

~/s/BerkeleyDB ❯❯❯ ls -R Database/
Berkeley

Database/Berkeley:
Db.hsc       db_helper.c  db_helper.h
~/s/BerkeleyDB ❯❯❯

Taking the first undeclared constant and searching the codebase we see this:

~/s/BerkeleyDB ❯❯❯ ag DB_BUFFER_SMALL
Database/Berkeley/Db.hsc
119:    DB_BUFFER_SMALL         |    -- ^ User memory too small for return.
158:dbErrFromNum (#const DB_BUFFER_SMALL) = DB_BUFFER_SMALL
~/s/BerkeleyDB ❯❯❯
lingnand commented 7 years ago

The db.h is from your BerkeleyDB installation (not related to haskell). The haskell code is trying to read these preprocessor constants but fails.

bonds commented 7 years ago

Gotcha. I'll grab the BerkeleyDB code used by the OpenBSD port and take a look.

On 11/21, Lingnan Dai wrote:

The db.h is from your BerkeleyDB installation (not related to haskell). The haskell code is trying to read these preprocessor constants but fails.

— You are receiving this because you authored the thread. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

  1. https://github.com/lynnard/VIMonad/issues/8#issuecomment-262115353
  2. https://github.com/notifications/unsubscribe-auth/AADQusUZSzlCpmu69hB2U63e7cmYndmHks5rAj0WgaJpZM4KacnB
bonds commented 7 years ago

Looks like the OpenBSD port grabs the source from:

http://download.oracle.com/berkeley-db/db-4.6.21.tar.gz

and then applies 4 patches to it:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/databases/db/v4/Makefile?rev=1.67&content-type=text/plain

The first 'undeclared' constant from the above list does show up:

~/D/d/db-4.6.21 ❯❯❯ ag DB_BUFFER_SMALL | ag "#define"
build_brew/db.h:1445:#define        DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
build_s60/db.h:1434:#define DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
build_vxworks/db.h:1443:#define     DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
build_wince/db.h:1482:#define       DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
build_windows/db.h:1482:#define     DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
dbinc/db.in:1455:#define    DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
~/D/d/db-4.6.21 ❯❯❯
lingnand commented 7 years ago

Can you check the installed header file in your system rather than those in the build directory?

bonds commented 7 years ago

Yes.

~ ❯❯❯ sudo find / -name "db.h"
Password:
/usr/local/include/db4/db.h
/usr/src/include/db.h
/usr/src/lib/libc/hidden/db.h
/usr/src/usr.sbin/bind/lib/dns/include/dns/db.h
/usr/src/usr.sbin/ypserv/makedbm/db.h
/usr/include/db.h
~ ❯❯❯ grep DB_BUFFER_SMALL /usr/local/include/db4/db.h
#define DB_BUFFER_SMALL         (-30999)/* User memory too small for return. */
lingnand commented 7 years ago

Can you check /usr/include/db.h?

bonds commented 7 years ago

It does NOT include those defines, see:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/include/db.h?rev=1.12&content-type=text/x-cvsweb-markup

On 12/08, Lingnan Dai wrote:

Can you check /usr/include/db.h?

— You are receiving this because you authored the thread. Reply to this email directly, [1]view it on GitHub, or [2]mute the thread.

References

  1. https://github.com/lynnard/VIMonad/issues/8#issuecomment-265892468
  2. https://github.com/notifications/unsubscribe-auth/AADQurEq2jOLqu94epAi5NnuwwwV-0d9ks5rGJlegaJpZM4KacnB
lingnand commented 7 years ago

I'm afraid that's the problem here... I'll see if I can remove this dependency altogether - but for the moment I'm closing this since it's not clear how to move on for OpenBSD with only small fix.

bonds commented 7 years ago

Makes sense. Thanks for giving this some thought!