在OS X上运行Haskell程序时不允许操作

我正在编写我的第一个
Haskell程序,一个基于Yesod框架的Web应用程序.

我使用cabal configure&&编译了代码. cabal build.当我尝试运行可执行文件时,我收到以下错误:

-bash: dist/build/MyApp/MyApp: Operation not permitted

我在OS X Mountain Lion上安装了64位Haskell平台(2012.2.0.0).我最初安装了32位版本,但得到了同样的错误,所以我卸载了它并尝试了64位版本.

应用程序编译和链接没有错误或警告.

我甚至尝试过http://reviews.cnet.com/8301-13727_7-57374676-263/workarounds-for-quarantine-bug-in-os-x-lion/中描述的修复,但它没有任何区别.

更新:情节变浓.源树实际上是在加密的稀疏包上(我的所有源代码都是).当我将树复制到我的主目录时,它会编译并运行.

mount命令不显示noexec选项:

/dev/disk2s9 on /Volumes/Personal (hfs, local, nodev, nosuid, journaled, noowners, quarantine, mounted by grk)

我不确定隔离选项,但我怀疑它来自Symantec Endpoint Protection(我的雇主要求).我会尝试为稀疏包禁用它.

最佳答案 我在姐妹网站apple.stackexchange.com找到了答案:
https://apple.stackexchange.com/questions/64456/mount-is-adding-a-quarantine-flag-causing-bin-bash-bad-interpreter-operatio

稀疏包实际上标有隔离标志.我卸载了卷并使用以下命令删除了隔离区:

xattr -d com.apple.quarantine Personal.sparsebundle

然后重新安装.问题解决了.

点赞