2

对接口(Ocaml)的不一致假设表明我重建并且我已经尝试过但无济于事。

我使用 mac port 来管理我的大部分开发工具,并且自从升级到 Mac OS 10.8.2 后,ocaml 和 ocaml-ounit 之间的交互似乎很糟糕。

下面是一个非常小的 shell 转储,但问题是

 Error: Files /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa
        and /opt/local/lib/ocaml/unix.cmxa
        make inconsistent assumptions over implementation Unix

并按照http://www.puredarwin.org/developers/macports/port中的描述强制重建似乎无法解决问题:

要强制升级(重建),请使用:

          port -f upgrade vim

下面是我尝试构建本机二进制文件的 shell 转储(.byte工作正常,但我即将开始一轮分析并想要分析本机执行)以及我尝试将 mac 端口弯曲到我的意愿。

任何有关如何进一步调查此问题的想法将不胜感激。我宁愿不自己从源代码开始构建 ocaml,因为我希望能够将我的项目分发给同事,只需很少的说明就可以启动和运行他们需要做什么,所以我想尽可能使用 vanilla 包。

 > ocaml make.ml PegParserTest.native
 ocamlbuild \
         -libs \
         nums,str,unix,oUnit,graph \
         -cflags \
         -g,-w,+a-4,-warn-error,+a-4,-I,/opt/local/lib/ocaml/site-lib/oUnit,-I,/opt/local/lib/ocaml/site-lib/ocamlgraph \
         -lflags \
         -g,-I,/opt/local/lib/ocaml/site-lib/oUnit,-I,/opt/local/lib/ocaml/site-lib/ocamlgraph \
         PegParserTest.native
 + /opt/local/bin/ocamlopt.opt -g -I /opt/local/lib/ocaml/site-lib/oUnit -I /opt/local/lib/ocaml/site-lib/ocamlgraph nums.cmxa str.cmxa unix.cmxa oUnit.cmxa graph.cmxa BinSearch.cmx ByteInput.cmx ByteOutput.cmx ListUtil.cmx Stringer.cmx Range.cmx Unicode.cmx CaseFold.cmx EditDistance.cmx SourcePosition.cmx Utf8.cmx Grammar.cmx Failures.cmx Opt.cmx StringUtil.cmx Path.cmx UnicodeCategories.cmx UnicodeSeq.cmx GrammarParser.cmx AnnotationChecker.cmx ArrayUtil.cmx BitBucket.cmx CodeUnit.cmx Conv.cmx DefaultProductions.cmx Encodable.cmx Flatten.cmx Trie.cmx FactorLeft.cmx Followers.cmx Inline.cmx PreSimplify.cmx SymmetricBoolMatrix.cmx TailCallOpt.cmx UnionPartition.cmx Simplifier.cmx FileTestSuite.cmx NumberSystem.cmx Regex.cmx PegParser.cmx ScalarCharValue.cmx TestHarnessWrapper.cmx PegParserTest.cmx -o PegParserTest.native
 File "_none_", line 1:
 Error: Files /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa
        and /opt/local/lib/ocaml/unix.cmxa
        make inconsistent assumptions over implementation Unix
 Command exited with code 2.
 Compilation unsuccessful after building 154 targets (153 cached) in 00:00:00.
 
 > sudo port selfupdate 
 --->  Updating MacPorts base sources using rsync
 MacPorts base version 2.1.2 installed,
 MacPorts base version 2.1.2 downloaded.
 --->  Updating the ports tree
 --->  MacPorts base is already the latest version
 
 The ports tree has been updated. To upgrade your installed ports, you should run
   port upgrade outdated
 
 > sudo port upgrade outdated
 --->  Computing dependencies for automake
 ELIDED
 --->  Updating database of binaries: 100.0%
 --->  Scanning binaries for linking errors: 100.0%
 --->  No broken files found.
 
 > port contents ocaml | grep -i unix.cm
   /opt/local/lib/ocaml/threads/threadUnix.cmi
   /opt/local/lib/ocaml/threads/threadUnix.cmx
   /opt/local/lib/ocaml/unix.cma
   /opt/local/lib/ocaml/unix.cmi
   /opt/local/lib/ocaml/unix.cmx
   /opt/local/lib/ocaml/unix.cmxa
   /opt/local/lib/ocaml/unix.cmxs
   /opt/local/lib/ocaml/vmthreads/threadUnix.cmi
   /opt/local/lib/ocaml/vmthreads/unix.cma
 
 > port contents ocaml-ounit | egrep '\.cm'
   /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cma
   /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmi
   /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmx
   /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxa
   /opt/local/lib/ocaml/site-lib/oUnit/oUnit.cmxs
   /opt/local/lib/ocaml/site-lib/oUnit/oUnitDiff.cmi
   /opt/local/lib/ocaml/site-lib/oUnit/oUnitDiff.cmx
 
 > sudo port -f upgrade ocaml-ounit ocaml
 Password:
 --->  Scanning binaries for linking errors: 100.0%
 --->  No broken files found.
4

1 回答 1

2

去核解决了这个问题:

重新安装端口

要重新安装您的端口:

  1. 保存已安装端口的列表:

    已安装端口 -qv > myports.txt

  2. 卸载所有已安装的端口:

    sudo port -f 卸载已安装

  3. 清理任何部分完成的构建:

    sudo 端口全部清除

  4. 浏览 myports.txt 并一一安装您实际想要使用的端口(而不是那些仅需要作为依赖项的端口),记住指定适当的变体:

    sudo port install portname +variant1 +variant2 ...</p>

请注意,如果您指定了非默认变体,您可能需要以不同于 myports.txt 中记录的字母顺序的顺序安装端口。

于 2012-12-24T06:59:02.873 回答