Inconsistent assumptions over interface (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 中所述强制重建似乎没有解决问题:
To force an upgrade (rebuild) use:
port -f upgrade vim
下面是我尝试构建 native 二进制文件的 shell 转储(.byte
工作正常,但我即将开始一轮分析并想要分析 native 执行)以及我的尝试让 mac 端口屈服于我的意志。
任何有关如何进一步调查此问题的想法将不胜感激。我不想自己开始从源代码构建 ocaml,因为我希望能够将我的项目分发给同事,并提供最少的说明,告诉他们需要做什么来启动和运行,所以我想尽可能使用普通包。
> 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.
最佳答案
Going nuclear解决了问题:
Reinstall ports
To reinstall your ports:
Save the list of installed ports:
port -qv installed > myports.txt
Uninstall all installed ports:
sudo port -f uninstall installed
Clean any partially-completed builds:
sudo port clean all
Browse myports.txt and install the ports that you actually want to use (as opposed to those that are only needed as dependencies) one by one, remembering to specify the appropriate variants:
sudo port install portname +variant1 +variant2 …
Note that if you have specified variants which are not the default, you may need to install ports in an order other than the alphabetical order recorded in myports.txt.
关于unix - ocaml oUnit 和主 ocaml lib 对 Unix 实现做出不一致的假设,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14014866/