>此外,我试图查看安装后我的 stack 正在使用的 ghc 版本,这导致缺少相同的属性'ghc822'错误. $ stack ghc---version错误:缺少属性"ghc822",位于(string):1:54(使用"--show-trace"显示详细的位置信息) 解决方案正如palik所言,更改了解析器版本-在我的情况下是更改 解析器:lts-11.3 到 解析器:lts-9.1 stack.yaml 中的是一种解决方法.我不知道更深层的问题是什么,但是有兴趣知道.I am attempting to build my haskell project on NixOS.Running $ stack build gives the following error.$ stack builderror: attribute ‘ghc822’ missing, at (string):1:53(use ‘--show-trace’ to show detailed location information)What does this error mean and how could I proceed? When I run $ stack build --show-trace as suggested, I get the following output, which I do not understand either.$ stack build --show-traceInvalid option `--show-trace'Usage: stack build [TARGET] [--dry-run] [--pedantic] [--fast] [--ghc-options OPTIONS] [--flag PACKAGE:[-]FLAG] ([--dependencies-only] | [--only-snapshot] | [--only-dependencies]) ([--file-watch] | [--file-watch-poll]) [--exec CMD [ARGS]] [--only-configure] [--trace] [--profile] [--no-strip] [--[no-]library-profiling] [--[no-]executable-profiling] [--[no-]library-stripping] [--[no-]executable-stripping] [--[no-]haddock] [--haddock-arguments HADDOCK_ARGS] [--[no-]open] [--[no-]haddock-deps] [--[no-]haddock-internal] [--[no-]haddock-hyperlink-source] [--[no-]copy-bins] [--[no-]copy-compiler-tool] [--[no-]prefetch] [--[no-]keep-going] [--[no-]force-dirty] [--[no-]test] [--[no-]rerun-tests] [--ta|--test-arguments TEST_ARGS] [--coverage] [--no-run-tests] [--[no-]bench] [--ba|--benchmark-arguments BENCH_ARGS] [--no-run-benchmarks] [--[no-]reconfigure] [--[no-]cabal-verbose] [--[no-]split-objs] [--skip ARG] [--help] Build the package(s) in this directory/configurationI tried changing my channel to nixos-17.09 instead of nixos-unstable (and running nix-channel --update), but still get the same error.Output of $ nix-channel --list is shown below.$ nix-channel --liststack https://nixos.org/channels/nixos-17.09nixos https://nixos.org/channels/nixos-17.09The output of $ nix-env -qaPA 'nixos.haskell.compiler' shows ghc822 to be found.$ nix-env -qaPA 'nixos.haskell.compiler'warning: name collision in input Nix expressions, skipping ‘/home/matthew/.nix-defexpr/channels_root/nixos’nixos.haskell.compiler.ghc6102Binary ghc-6.10.2-binarynixos.haskell.compiler.ghc704 ghc-7.0.4nixos.haskell.compiler.ghc704Binary ghc-7.0.4-binarynixos.haskell.compiler.ghc7102 ghc-7.10.2nixos.haskell.compiler.integer-simple.ghc7102 ghc-7.10.2nixos.haskell.compiler.ghc7103 ghc-7.10.3nixos.haskell.compiler.integer-simple.ghc7103 ghc-7.10.3nixos.haskell.compiler.integer-simple.ghc742 ghc-7.4.2nixos.haskell.compiler.ghc742 ghc-7.4.2nixos.haskell.compiler.ghc742Binary ghc-7.4.2-binarynixos.haskell.compiler.ghc763 ghc-7.6.3nixos.haskell.compiler.ghc783 ghc-7.8.3nixos.haskell.compiler.integer-simple.ghc783 ghc-7.8.3nixos.haskell.compiler.ghc784 ghc-7.8.4nixos.haskell.compiler.integer-simple.ghc784 ghc-7.8.4nixos.haskell.compiler.ghc801 ghc-8.0.1nixos.haskell.compiler.integer-simple.ghc801 ghc-8.0.1nixos.haskell.compiler.ghc802 ghc-8.0.2nixos.haskell.compiler.integer-simple.ghc802 ghc-8.0.2nixos.haskell.compiler.integer-simple.ghc821 ghc-8.2.1nixos.haskell.compiler.ghc821 ghc-8.2.1nixos.haskell.compiler.integer-simple.ghc822 ghc-8.2.2nixos.haskell.compiler.ghc822 ghc-8.2.2nixos.haskell.compiler.integer-simple.ghcHEAD ghc-8.3.20170808nixos.haskell.compiler.ghcHEAD ghc-8.3.20170808nixos.haskell.compiler.ghcjs ghcjs-0.2.0nixos.haskell.compiler.ghcjsHEAD ghcjs-0.2.020170323nixos.haskell.compiler.jhc jhc-0.8.2nixos.haskell.compiler.uhc uhc-1.1.9.4I installed ghc8.2.2 via $ nix-env -iA nixos.haskell.compiler.ghc822, and $ ghc --version now returns$ ghc --versionThe Glorious Glasgow Haskell Compilation System, version 8.2.2However, I still get the error error: attribute ‘ghc822’ missing, at (string):1:54 when attempting to run $ stack build.Also, I attempted to see what ghc version my stack is using after this install, and this led to the same attribute ‘ghc822’ missing error.$ stack ghc -- --versionerror: attribute ‘ghc822’ missing, at (string):1:54(use ‘--show-trace’ to show detailed location information) 解决方案 As palik commented, changing the resolver version -- in my case changingresolver: lts-11.3toresolver: lts-9.1in stack.yaml is a work-around. I do not know what the deeper issue is but would be interested to know. 这篇关于堆栈生成错误:缺少属性"ghc822",位于(string):1:53的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的..
09-09 02:03