我将- postgresql-simple
添加到Haskell堆栈项目的package.yaml
依赖项中,然后执行stack build
,得到:
While building package postgresql-libpq-0.9.4.3 (scroll up to its section to see the error) using:
/tmp/stack-89da86d626e343e1/postgresql-libpq-0.9.4.3/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.2.1.0 configure --user --package-db=clear --package-db=global --package-db=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/pkgdb --libdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/lib --bindir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/bin --datadir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/share --libexecdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/libexec --sysconfdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/etc --docdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/doc/postgresql-libpq-0.9.4.3 --htmldir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/doc/postgresql-libpq-0.9.4.3 --haddockdir=/root/.stack/snapshots/x86_64-linux-tinfo6/08a30a38364a81e94295cf97609a35ddfc240f67779f06f0eb2ce22d8a89e805/8.10.4/doc/postgresql-libpq-0.9.4.3 --dependency=Cabal=Cabal-3.2.1.0 --dependency=base=base-4.14.1.0 --dependency=bytestring=bytestring-0.10.12.0 --dependency=unix=unix-2.7.2.2 -f-use-pkg-config --exact-configuration --ghc-option=-fhide-source-paths
Process exited with code: ExitFailure 1
容器安装了progresql,如下所示:
RUN apt-get update && apt-get install -y wget lsb-release
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update && apt-get -y install postgresql
CCD_ 4起作用。
尽管它说scroll up to its section to see the error
,但上面没有错误。
postgresql-libpq > Configuring postgresql-libpq-0.9.4.3...
postgresql-libpq > setup: Missing dependency on a foreign library:
postgresql-libpq > * Missing (or bad) C library: pq
postgresql-libpq > This problem can usually be solved by installing the system package that
postgresql-libpq > provides this library (you may need the "-dev" version). If the library is
postgresql-libpq > already installed but in a non-standard location then you can use the flags
postgresql-libpq > --extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
postgresql-libpq > library file does exist, it may contain errors that are caught by the C
postgresql-libpq > compiler at the preprocessing stage. In this case you can re-run configure
postgresql-libpq > with the verbosity flag -v3 to see the error messages.
这是日志的最顶端
在阅读并再次进行sudo apt install -y libpq-dev
和stack build
之后,它起到了的作用