在安装音乐套件方面存在集团问题

时间:2019-02-19 20:05:42

标签: haskell installation cabal lilypond

我正在尝试通过cabal安装与Haskell一起使用的音乐套件。按照建议下载Lilypond的指示http://music-suite.github.io/docs/ref/,我输入了cabal install lilypond并成功下载了

当我尝试通过cabal安装音乐套件时,问题开始了。这是发生了什么:

mm$ cabal install music-suite
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: music-suite-1.9.0 (user goal)
[__1] trying: musicxml2-1.9.0 (dependency of music-suite)
[__2] trying: base-4.11.1.0/installed-4.1... (dependency of musicxml2)
[__3] trying: music-score-1.9.0 (dependency of music-suite)
[__4] trying: vector-space-points-0.2.1.2 (dependency of music-score)
[__5] next goal: transformers (dependency of music-score)
[__5] rejecting: transformers-0.5.5.0/installed-0.5..., transformers-0.5.6.2,
transformers-0.5.5.0, transformers-0.5.4.0, transformers-0.5.2.0,
transformers-0.5.1.0, transformers-0.5.0.1, transformers-0.5.0.0 (conflict:
music-score => transformers>=0.4.3.0 && <0.5)
[__5] rejecting: transformers-0.4.3.0 (conflict:
base==4.11.1.0/installed-4.1..., transformers => base>=2 && <4.9)
[__5] rejecting: transformers-0.4.2.0, transformers-0.4.1.0,
transformers-0.3.0.0, transformers-0.2.2.1, transformers-0.2.1.0,
transformers-0.2.0.0, transformers-0.1.4.0, transformers-0.1.3.0,
transformers-0.1.1.0, transformers-0.1.0.1, transformers-0.0.1.0,
transformers-0.0.0.0, transformers-0.5.6.1, transformers-0.5.6.0,
transformers-0.5.3.1, transformers-0.5.3.0, transformers-0.5.0.2,
transformers-0.4.0.0, transformers-0.2.2.0, transformers-0.1.0.0 (conflict:
music-score => transformers>=0.4.3.0 && <0.5)
[__5] fail (backjumping, conflict set: base, music-score, transformers)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: music-score, base, transformers,
music-suite, musicxml2, vector-space-points

到底出了什么问题?我该如何解决这个问题?

我试图通过堆栈安装它,但出现此消息:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for music-suite-1.9.0:
abcnotation must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
            is 1.9.0)
lilypond must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
         is 1.9.0)
music-articulation must match ==1.9.0, but the stack configuration has no specified version  (latest matching
                   version is 1.9.0)
music-dynamics must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
               is 1.9.0)
music-dynamics-literal must match ==1.9.0, but the stack configuration has no specified version  (latest matching
                       version is 1.9.0)
music-parts must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
            is 1.9.0)
music-pitch must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
            is 1.9.0)
music-pitch-literal must match ==1.9.0, but the stack configuration has no specified version  (latest matching
                    version is 1.9.0)
music-preludes must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
               is 1.9.0)
music-score must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
            is 1.9.0)
musicxml2 must match ==1.9.0, but the stack configuration has no specified version  (latest matching version
          is 1.9.0)
needed since music-suite is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build
configuration. This can be convenient when dealing with many complicated constraint errors, but results may be
unpredictable.

  * Recommended action: try adding the following to your extra-deps
in /Users/mm/.stack/global-project/stack.yaml:

- abcnotation-1.9.0
- lilypond-1.9.0
- music-articulation-1.9.0
- music-dynamics-1.9.0
- music-dynamics-literal-1.9.0
- music-parts-1.9.0
- music-pitch-1.9.0
- music-pitch-literal-1.9.0
- music-preludes-1.9.0
- music-score-1.9.0
- musicxml2-1.9.0

我已经添加了所有这些依赖项(也在此处http://hackage.haskell.org/package/music-suite-1.9.0/dependencies中列出),但是 在终端上输入The same package name is used in multiple local packagesbase-orphans used in: - PLIndex "base-orphans-0.8" - PLIndex "base-orphans-0.3.3"时收到stack install music-suite

当我删除这些依赖项之一时,我收到一条消息,要求还原它们,并且还出现以下错误:

错误:在构建构建计划时,遇到以下异常:

 In the dependencies for cassava-0.4.4.0:
base-4.12.0.0 from stack configuration does not match >=4.5 && <4.9  (latest matching version is 4.8.2.0)
 needed due to music-suite-1.9.0 -> cassava-0.4.4.0

  In the dependencies for comonad-4.3:
base-4.12.0.0 from stack configuration does not match >=0 && <0 
 needed due to music-suite-1.9.0 -> comonad-4.3

 In the dependencies for directory-1.2.7.1:
base-4.12.0.0 from stack configuration does not match >=4.5 && <4.11  (latest matching version is 4.10.1.0)
 needed due to music-suite-1.9.0 -> directory-1.2.7.1

 In the dependencies for monadplus-1.4.2:
base-4.12.0.0 from stack configuration does not match >=4 && <4.11  (latest matching version is 4.10.1.0)
 needed due to music-suite-1.9.0 -> monadplus-1.4.2

 In the dependencies for music-score-1.9.0:
base-orphans-0.8 from stack configuration does not match >=0.1 && <0.4  (latest matching version is 0.3.3)
 needed due to music-suite-1.9.0 -> music-score-1.9.0

 In the dependencies for process-1.2.3.0:
base-4.12.0.0 from stack configuration does not match >=4.4 && <4.9  (latest matching version is 4.8.2.0)
 needed due to music-suite-1.9.0 -> process-1.2.3.0

 In the dependencies for transformers-0.4.3.0:
base-4.12.0.0 from stack configuration does not match >=2 && <4.9  (latest matching version is 4.8.2.0)
 needed due to music-suite-1.9.0 -> transformers-0.4.3.0

 In the dependencies for vector-space-points-0.2.1.2:
base-4.12.0.0 from stack configuration does not match >=4.0 && <4.12  (latest matching version is 4.11.1.0)
 needed due to music-suite-1.9.0 -> vector-space-points-0.2.1.2

 Some different approaches to resolving this:

   * Set 'allow-newer: true' to ignore all version constraints and build anyway.

   * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working build
configuration. This can be convenient when dealing with many complicated constraint errors, but results may be
unpredictable.

2 个答案:

答案 0 :(得分:0)

问题在于音乐套房已经有好几年没有更新了,并且不能直接用最新的GHC版本构建。

希望我们可以使用“堆栈”,该工具可让您指定要使用的GHC和软件包。但是,我还没有找到与Hackage上的音乐套件包一起使用的构建计划,因此让我们从源代码构建它们:

1)安装堆栈(说明位于https://haskellstack.org上)

2)可选:使用stack new mypackage创建一个新程序包(或者您可以使用自己的程序包)

3)在包文件夹中,创建或编辑“ stack.yaml”文件,使其包含:

resolver: lts-13.8

packages:
- .
- music-suite
- music-parts
- music-score
- music-articulation
- music-pitch
- music-dynamics
- lilypond
- musicxml2
- monadplus

extra-deps:
- average-0.6.1
- prettify-1.0
- data-interval-1.3.0
- extended-reals-0.2.3.0
- positive-0.4.1
- type-unary-0.3.2
- vector-space-points-0.2.1.2
- applicative-numbers-0.1.3
- ty-0.1.7
- reverse-apply-2.0.1
- roman-numerals-0.5.1.5

allow-newer: true

ghc-options:
   "music-score": -XUndecidableInstances

4)在包文件夹中,使用以下命令获取并修复音乐套件:

git clone https://github.com/music-suite/lilypond
git clone https://github.com/music-suite/music-suite
git clone https://github.com/music-suite/music-score
git clone https://github.com/music-suite/music-dynamics
git clone https://github.com/music-suite/music-parts
git clone https://github.com/music-suite/music-pitch
git clone https://github.com/music-suite/music-articulation
git clone https://github.com/music-suite/musicxml2
git clone https://github.com/hanshoglund/monadplus

echo "instance Semigroup (Partial a b) where (<>) = mplus" >> monadplus/src/Control/Monad/Plus.hs

echo "instance Semigroup RhythmContext where (<>) = mappend" >> music-score/src/Music/Score/Internal/Quantize.hs
echo "instance Semigroup CrescDim where (<>) = mappend" >> music-score/src/Music/Score/Export/DynamicNotation.hs
echo "instance Semigroup DynamicNotation where (<>) = mappend" >> music-score/src/Music/Score/Export/DynamicNotation.hs
echo "instance Semigroup Slur where (<>) = mappend" >> music-score/src/Music/Score/Export/ArticulationNotation.hs
echo "instance Semigroup Mark where (<>) = mappend" >> music-score/src/Music/Score/Export/ArticulationNotation.hs
echo "instance Semigroup ArticulationNotation where (<>) = mappend" >> music-score/src/Music/Score/Export/ArticulationNotation.hs
echo "instance Semigroup (ScScore a) where (<>) = mappend" >> music-score/src/Music/Score/Export/SuperCollider.hs
echo "instance Semigroup SystemBar where (<>) = mappend" >> music-score/src/Music/Score/Export2/StandardNotation.hs
echo "instance Semigroup StaffInfo where (<>) = mappend" >> music-score/src/Music/Score/Export2/StandardNotation.hs
echo "instance Semigroup Chord where (<>) = mappend" >> music-score/src/Music/Score/Export2/StandardNotation.hs
echo "instance Semigroup MovementInfo where (<>) = mappend" >> music-score/src/Music/Score/Export2/StandardNotation.hs
echo "instance Semigroup WorkInfo where (<>) = mappend" >> music-score/src/Music/Score/Export2/StandardNotation.hs

5)现在,您可以使用stack build


一个更简单的解决方案是要求在Hackage上发布更新的音乐套件包。

答案 1 :(得分:0)

您的阴谋错误中的有效负载在这里(我进行了一些编辑,用<...>替换了一些非常重复的内容)

[__5] next goal: transformers (dependency of music-score)
[__5] rejecting: transformers-0.5.5.0, <...> (conflict: music-score => transformers>=0.4.3.0 && <0.5)
[__5] rejecting: transformers-0.4.3.0 (conflict: base==4.11.1.0/installed-4.1..., transformers => base>=2 && <4.9)
[__5] rejecting: transformers-0.4.2.0, <...> (conflict: music-score => transformers>=0.4.3.0 && <0.5)

第2行和第4行共同表示,在transformers包的所有可能的可用版本中,仅 版本0.4.3.0符合music-core中的版本范围的约束。第3行说transformers-0.4.3.0要求base <4.9,而您的base版本太新了,无法满足该限制。

到目前为止,到目前为止,还只是标准约束解决方案,以及对因果关系所见的约束集出现问题的摘要。现在,从一些高级解释来看,阴谋集团没有资格给你。

base是最深入,最硬的库;它随附GHC,并且无法替换,因此更改base版本的唯一选择是安装其他版本的GHC。不幸的是,尽管有表herebase版本号和GHC版本号之间没有原则上的联系。查阅该表,我们可以看到GHC 7.10.3是最后一个在4.9以下发布base版本的版本。

因此,要解决此问题并继续解决下一个问题,您应该安装GHC的版本至少早于7.10.3,然后告诉cabal在执行其约束求解时使用它。您可以通过使新的(旧的)GHC成为PATH中的第一个GHC来实现后者,或者通过使用cabal的-w标志来指定要使用的编译器,如下所示:

cabal install music-suite -w ghc-7.10.3