【问题标题】:Stack build error: while building package aeson. (cabal) ExitFailure 1堆栈构建错误:构建包 aeson 时。 (阴谋集团)退出失败 1
【发布时间】:2020-05-08 07:16:30
【问题描述】:

当我运行“堆栈构建”时出现错误:

--  While building package aeson-1.1.2.0 using:
      /Users/kaspazza/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options ""
    Process exited with code: ExitFailure 1

我的 stack.yaml:

resolver: lts-9.10

packages:
- '.'

extra-deps: []

flags: {}

extra-package-dbs: []

command: stack exec -- which ghc 给出:

/Users/kaspazza/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc

命令:ghc --version

The Glorious Glasgow Haskell Compilation System, version 8.8.3

命令:堆栈构建

aeson   > configure
aeson   > Configuring aeson-1.1.2.0...
aeson   > build    
aeson   > Building aeson-1.1.2.0...
aeson   > Preprocessing library aeson-1.1.2.0...
aeson   > [ 1 of 21] Compiling Data.Aeson.Types.Internal ( Data/Aeson/Types/Internal.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Data/Aeson/Types/Internal.o )
aeson   > [ 2 of 21] Compiling Data.Aeson.Types.Generic ( Data/Aeson/Types/Generic.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Data/Aeson/Types/Generic.o )
aeson   > [ 3 of 21] Compiling Data.Aeson.Parser.UnescapeFFI ( ffi/Data/Aeson/Parser/UnescapeFFI.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Data/Aeson/Parser/UnescapeFFI.o )
aeson   > [ 4 of 21] Compiling Data.Aeson.Parser.Unescape ( Data/Aeson/Parser/Unescape.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Data/Aeson/Parser/Unescape.o )
aeson   > [ 5 of 21] Compiling Data.Aeson.Parser.Internal ( Data/Aeson/Parser/Internal.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Data/Aeson/Parser/Internal.o )
aeson   > <command line>: can't load .so/.DLL for: /Users/kaspazza/.stack/snapshots/x86_64-osx/8b5cff025076e7bab89d6dbb5e562716cf2b67bbcde1528460c4f36feefa23fb/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib (dlopen(/Users/kaspazza/.stack/snapshots/x86_64-osx/8b5cff025076e7bab89d6dbb5e562716cf2b67bbcde1528460c4f36feefa23fb/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib, 5): REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 2 which is not a writable segment (__LINKEDIT) in /Users/kaspazza/.stack/snapshots/x86_64-osx/8b5cff025076e7bab89d6dbb5e562716cf2b67bbcde1528460c4f36feefa23fb/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib)

--  While building package aeson-1.1.2.0 using:
      /Users/kaspazza/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options ""
    Process exited with code: ExitFailure 1
Progress 1/2

命令:cabal install

cabal: Could not resolve dependencies:
[__0] trying: duckling-0.1.6.1 (user goal)
[__1] next goal: snap-server (dependency of duckling)
[__1] rejecting: snap-server-1.1.1.1 (conflict: duckling =>
snap-server>=1.0.1.1 && <1.1)
[__1] skipping: snap-server-1.1.1.0, snap-server-1.1.0.0 (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=1.0.1.1 && <1.1' from 'duckling')
[__1] trying: snap-server-1.0.3.3
[__2] next goal: base (dependency of duckling)
[__2] rejecting: base-4.13.0.0/installed-4.13.0.0 (conflict: snap-server =>
base>=4 && <4.11)
[__2] skipping: base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=4 && <4.11' from 'snap-server')
[__2] rejecting: base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__2] fail (backjumping, conflict set: base, duckling, snap-server)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: snap-server, duckling, base

(我在 Mac 上,我认为问题出在我机器上工具的版本/依赖项上) 任何想法为什么我会收到错误,或者我该如何调试它?

【问题讨论】:

  • 顺便说一句,cabal 失败了,因为正在尝试使用base-4.13 这是ghc-8.8.3 的基础包,而facebook 的duckling 是建立在ghc-8.0.2 之上的,所以阴谋集团很友善编译器版本冲突。 stackaeson 依赖项中失败,而不是在 base
  • 显然有人和你有同样的问题:github.com/facebook/duckling/issues/446删除stack.yaml并运行stack build为他们工作
  • 显然这也是使用ghc-8.6.3 构建的。堆栈的快照13.11 中提供了这样一个版本的ghc。我已经手动检查了依赖项,它似乎没问题。如果愿意,更改stack.yaml 以将解析器设置为lts-13.11。它将下载不同版本的编译器和库。也许它有效
  • @Ismor 是的!终于来了!!非常感谢你!将解析器更改为 lts-13.11 并在我的 stack.yaml 中添加 allow-newer: true (但这是因为设置依赖项)使其工作!
  • @Ismor 您可以添加答案,以便我将其标记为已解决:)

标签: haskell ghc cabal haskell-stack aeson


【解决方案1】:

复制我的评论

显然,这也是使用ghc-8.6.3 构建的。堆栈的快照13.11 中提供了这样一个版本的 ghc。如果您愿意,可以更改 stack.yaml 以将解析器设置为 lts-13.11。它将下载不同版本的编译器和库。也许它有效

来自您的评论

正如您所说,您必须添加 allow-newer: true 以便它可以正确解决依赖关系

【讨论】:

  • 有趣的是,从头开始重新安装 lts-9.10 或删除并使其在 .stack 文件中创建新快照并没有帮助(正如 GitHub 问题上所建议的那样)。所以这是这个版本的问题。 allow-newer: true 是必需的,因为在我的 .cabal 文件中存在版本限制,并且 lts-13.11 中的一些库比 .cabal 文件中的最大版本更新。但是我仍然不知道为什么在重新安装 Haskell 包、堆栈和 cabal 时需要更改 lts 才能工作,因为这些完全相同的代码和库版本在其他机器上工作。
  • 在编译不同的库时存在一些相关问题,不仅仅是 aeson。总是在 macOS 中发生。 github.com/brynedwards/spock-tutorials/issues/1。显然这是由于编译器库和与日期/时间相关的系统库之间存在一些不兼容,所以它既不是阴谋集团,也不是堆栈,它是实际的编译器版本失败了......现在很难,但改变编译器版本似乎有帮助。您是否考虑在小鸭回购中打开一个问题?对许多人会有帮助;)
猜你喜欢
  • 1970-01-01
  • 2011-12-12
  • 1970-01-01
  • 2020-01-23
  • 1970-01-01
  • 2020-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多