简体   繁体   English

在 Windows 上安装 Haskell,cabal 配置

[英]Installing Haskell on Windows, cabal config

I'm installing Haskell on Windows based on the instructions at https://www.haskell.org/platform/ and looking at step 3, it says, Modify your cabal config file (you can verify the location by running "cabal user-config init") to contain the following lines:我正在根据https://www.haskell.org/platform/上的说明在 Windows 上安装 Haskell 并查看第 3 步,它说,修改您的 cabal 配置文件(您可以通过运行“cabal user- config init") 包含以下几行:

extra-prog-path: C:\Program Files\Haskell Platform\8.0.2\msys\usr\bin
extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\lib
extra-include-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\include

But the auto generated config file contains eg但是自动生成的配置文件包含例如

extra-prog-path: C:\Users\w\AppData\Roaming\cabal\bin

So that's a different value for one of the suggested variables.所以这是建议变量之一的不同值。

Is this intentional?这是故意的吗?

What should I do, paste the lines from step 3 at the start of the file, the end of the file, overwrite the existing lines or skip step 3 altogether?我应该怎么做,将第 3 步中的行粘贴到文件开头、文件末尾,覆盖现有行还是完全跳过第 3 步?

You don't need to overwrite existing lines.您不需要覆盖现有的行。 You can have multiple extra-prog-path entries and they all get used.您可以有多个extra-prog-path条目,并且它们都会被使用。

I have cabal-install version 2.4.1.0.我有 cabal-install 版本 2.4.1.0。 As proposed in https://www.haskell.org/cabal/users-guide/nix-local-build.html and contrary to the installing instructions at https://www.haskell.org/platform/windows.html , I'm using one single extra-prog-path line containing a comma separated list of paths:作为提出https://www.haskell.org/cabal/users-guide/nix-local-build.html在,违反了安装说明https://www.haskell.org/platform/windows.html ,我'正在使用一个单独的extra-prog-path行,其中包含一个逗号分隔的路径列表:

extra-prog-path: C:\\Users\\...\\AppData\\Roaming\\cabal\\bin,C:\\Program Files\\Haskell Platform\\8.6.5\\msys\\usr\\bin

Reason: Like this, at least the command cabal user-config diff gives reasonable results.原因:像这样,至少命令cabal user-config diff给出了合理的结果。

C:\>cabal user-config diff
+ extra-include-dirs: C:\Program Files\Haskell Platform\8.6.5\mingw\include
+ extra-lib-dirs: C:\Program Files\Haskell Platform\8.6.5\mingw\lib
- extra-prog-path: C:\Users\...\AppData\Roaming\cabal\bin
+ extra-prog-path: C:\Users\...\Roaming\cabal\bin,C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin
+ logs-dir: C:\Users\...\AppData\Roaming\cabal\logs

If I'd follow the installing instructions and use two extra-prog-path lines, then cabal user-config diff would ignore the second one.如果我遵循安装说明并使用两个extra-prog-path行,那么cabal user-config diff将忽略第二个。 I'm not sure however if this matters.但是,我不确定这是否重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM