[英]Haskell stack build error: While building package postgresql-libpq-0.9.4.3
[英]Haskell Stack does not build postgresql-libpq on Nixos
将postgresql-libpq添加到我的项目的 cabal 文件后,堆栈构建失败并显示以下内容:
Configuring postgresql-libpq-0.9.1.1...
setup: The program 'pg_config' is required but it could not be found.
我在 Nixos 上,并且pg_config已经安装并且在我的 PATH 上:
$ whereis pg_config
pg_config: /nix/store/5bc6hzqkyw8dpi91sqznd3ik42mllwyz-system-path/bin/pg_config
我正在使用堆栈 1.0.2,即使在不稳定频道上的nixos-rebuild 开关 --upgrade之后,它似乎也不会更新。 这是我的错误还是其他原因?
我在 nixos 上遇到了这个问题,当我的stack.yaml
的 nix 块更改为以下内容时,我stack.yaml
了这个问题。
nix:
pure: true
enable: true
packages: [ postgresql ]
我遇到了同样的问题,阅读 Michael Snoyman 链接的文档对我有帮助。 您需要将其添加到您的 stack.yaml 中:
nix:
enable: true
pure: false
我正在构建不属于我的包,因此我没有编辑特定于项目的配置,而是将这些行添加到我的全局配置中: ~/.stack/config.yaml
。 或者,您可以使用命令行选项:
stack --nix --no-nix-pure build
作为“非纯”构建的替代方案,您应该能够在nix-shell
指定所有系统依赖nix-shell
以强制重现性,但我没有尝试过。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.