未捕获的exception失败(“input_value:bad bigarray kind”) – Unison在Windows和pipe理开发环境

我在Windows 8.1上使用pipe理开发环境(mgtcommerce / mgt-development-environment-5.6)。 &DockerToolbox for Windows。

我还从https://www.mgt-commerce.com/documentation/mgt-development-windows-file-synchronization下载了build议的OpenSSH&Unison版本,并按照说明创build了sync.bat。

不幸的是,Unison出现以下错误信息:

Uncaught exception Failure("input_value: bad bigarray kind") Raised by primitive operation at file "./remote.ml", line 453, characters 18-45 Called from file "./remote.ml", line 459, characters 23-61 Called from file "./lwt/lwt.ml", line 75, characters 20-23 Re-raised at file "./lwt/lwt.ml", line 135, characters 12-13 Called from file "list.ml", line 73, characters 12-15 Called from file "./lwt/lwt.ml", line 31, characters 2-37 Called from file "./lwt/lwt.ml", line 83, characters 17-46 Called from file "./lwt/win/lwt_unix_impl.ml", line 239, characters 6-40 Called from file "./uitext.ml", line 490, characters 2-113 Called from file "./uitext.ml", line 556, characters 38-66 Called from file "./uitext.ml", line 718, characters 6-47 Called from file "./uitext.ml", line 756, characters 6-125 Called from file "./uitext.ml", line 804, characters 8-47 Called from file "./uitext.ml", line 870, characters 21-43 

它确实没有问题地工作:

  1. 第一次一致是用于docker形象
  2. 与旗帜一起使用的时候

我读了几篇文章,其中大部分都得出这是OCaml不兼容问题的结论。

如何解决这个问题? 其他人也遇到过这个错误吗?

错误消息“input_value:bad bigarray kind”表示你在Unison中遇到了一个众所周知的错误。

同步中涉及的两个Unison进程的主要版本不仅需要匹配(您可能已经知道),OCaml版本4.01和4.02之间的OCaml库也发生了内部更改,与数据封送有关。 很难给你一个确切的链接,因为Google的一些最有希望的结果会返回一个空白的页面,但我希望它们能做到:

https://github.com/bcpierce00/unison/issues/32 http://unison-users.yahoogroups.narkive.com/7FOa6VCg/re-unison-failed-uncaught-exception-failure-input-value-bad-bigarray -类

特别注意在最后一个链接的页面上:

[…]这是一个已知的问题,发生是因为Unison没有针对相同的OCaml版本进行编译。 OCaml 4.01和4.02中的编组使用不同的格式…您将不得不针对相同版本的OCaml编译Unison 2.48.3 […]

我有时自己碰到这个问题,我通过编译我自己的OCaml, Lablgtk的graphics(GTK)接口和Unison来规避它。 我发现编译这些在Linux下相当简单(还没有在其他操作系统上尝试过)。

最后,我能够通过以下设置启动和运行同步:

  • 在Windows 10上:使用mgt-commerce.com提供的unison-files – 版本2.48.3(但我不知道使用的OCaml版本)
  • 在docker镜像中,使用unison-sources 2.48.4和OCaml版本4.01.0重新编译

在Dockerfile中为此使用的命令:

 RUN apt-get update && apt-get install -y \ ocaml \ && curl -L https://github.com/bcpierce00/unison/archive/2.48.4.tar.gz | tar zxv -C /tmp && \ cd /tmp/unison-2.48.4 && \ sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c && \ make && \ cp src/unison src/unison-fsmonitor /usr/bin && \ cd /root && rm -rf /tmp/unison-2.48.4