glib gremlin 与 GHC 7.4

发布于 2024-12-28 06:30:36 字数 1474 浏览 3 评论 0原文

我正在遵循此过程,使用 GHC 7.2.2 进行测试以安装 gtk2hs 和相关套件,但我遇到了一些障碍。我使用的是 Mac OS X Lion、通过自制程序安装的 glib 2.30.2 和 ghc 7.4(圣诞节前夕的候选版本)。我想我的 gcc 版本可能是相关的

bash-3.2$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

。在 cabal install gtk 期间尝试安装 glib 依赖项时会出现问题。我尝试了单独的cabal unpack glibcabal install,我得到了这个指针偏执的抱怨。

bash-3.2$ cabal install
Resolving dependencies...
Configuring glib-0.12.2...
Building glib-0.12.2...
Preprocessing library glib-0.12.2...
System/Glib/hsgclosure.c: In function 'gtk2hs_closure_marshal':

System/Glib/hsgclosure.c:110:0:
     warning: passing argument 1 of 'rts_evalIO' from incompatible pointer type

System/Glib/hsgclosure.c:110:0:
     error: void value not ignored as it ought to be

相关文件的相关行是

cap=rts_evalIO(CAP rts_apply(CAP (HaskellObj)runIO_closure, call),&ret);

,但我没有专业知识来解释它。

我在 reddit 讨论的评论中提出了同样的问题这首先引导我进入这个过程,但我想我也可以在这里寻求智慧。

GHC 7.4 是否改变了此类事情的完成方式,或者是否更有可能在设置的早期阶段出现其他问题?这不是明显的这个问题,但在这个层面上,几乎没有什么是显而易见的我。我对正在发生的事情没有一个好的心理模型。

如果有任何灯棚,我将不胜感激。

I'm in the process of following this process, tested with GHC 7.2.2 for installing gtk2hs and related kit, but I've hit a little snag. I'm using Mac OS X Lion, glib 2.30.2 installed via homebrew, and ghc 7.4 (the release candidate from just before Christmas). I suppose my gcc version may be relevant

bash-3.2$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)

The trouble comes when attempting to install the glib dependency during cabal install gtk. I tried a separate cabal unpack glib and cabal install, and I get this pointer-paranoid complaint.

bash-3.2$ cabal install
Resolving dependencies...
Configuring glib-0.12.2...
Building glib-0.12.2...
Preprocessing library glib-0.12.2...
System/Glib/hsgclosure.c: In function 'gtk2hs_closure_marshal':

System/Glib/hsgclosure.c:110:0:
     warning: passing argument 1 of 'rts_evalIO' from incompatible pointer type

System/Glib/hsgclosure.c:110:0:
     error: void value not ignored as it ought to be

The relevant line of the relevant file is

cap=rts_evalIO(CAP rts_apply(CAP (HaskellObj)runIO_closure, call),&ret);

but I have not the expertise to interpret it.

I've asked the same question in a comment on the reddit discussion which led me to the process in the first place, but I thought I might seek wisdom here too.

Has GHC 7.4 changed the way this sort of thing is done, or is it more likely that something else is broken, earlier in the setup? It is not obviously this problem, but at this level, very little is obvious to me. I don't have a good mental model of what's going on.

I'd be grateful for any light shed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

祁梦 2025-01-04 06:30:36

获取 http://code.haskell.org/gtk2hs/

darcs从日志中

Thu Jan 19 22:50:06 PST 2012  Duncan Coutts <[email protected]>
  * Fix the type generator for GHC 7.4
  GHC 7.4 is stricter about FFI imports with newtypes, the newtype
  constructor must be visible at the point of import.

Thu Jan 19 22:42:43 PST 2012  Duncan Coutts <[email protected]>
  * Fix cairo for GHC 7.4
  Changes in Num type class

Thu Jan 19 22:40:20 PST 2012  Duncan Coutts <[email protected]>
  * Fix glib for change in RTS API in GHC 7.4

darcs get http://code.haskell.org/gtk2hs/

from the log:

Thu Jan 19 22:50:06 PST 2012  Duncan Coutts <[email protected]>
  * Fix the type generator for GHC 7.4
  GHC 7.4 is stricter about FFI imports with newtypes, the newtype
  constructor must be visible at the point of import.

Thu Jan 19 22:42:43 PST 2012  Duncan Coutts <[email protected]>
  * Fix cairo for GHC 7.4
  Changes in Num type class

Thu Jan 19 22:40:20 PST 2012  Duncan Coutts <[email protected]>
  * Fix glib for change in RTS API in GHC 7.4
被翻牌 2025-01-04 06:30:36

是的,GHC 7.4 改变了一些事情。 rts_evalIO 定义在includes/RtsAPI.h 中,以前是

Capability * 
rts_evalIO (Capability *, HaskellObj p, /*out*/HaskellObj *ret);

现在,在7.4 中,它是

void rts_evalIO (/* inout */ Capability **,
                 /* in    */ HaskellObj p,
                 /* out */   HaskellObj *ret);

其他rts_eval* 函数也做了类似的改变。简而言之,glib-0.12.2 不能使用 7.4 构建。要么自己破解它以使其编译(我怀疑这非常重要),要么等待并使用 7.2.2,直到发布与 7.4 兼容的新 glib。

Yes, GHC 7.4 has changed some things. rts_evalIO is defined in includes/RtsAPI.h, previously it was

Capability * 
rts_evalIO (Capability *, HaskellObj p, /*out*/HaskellObj *ret);

Now, in 7.4, it is

void rts_evalIO (/* inout */ Capability **,
                 /* in    */ HaskellObj p,
                 /* out */   HaskellObj *ret);

The other rts_eval* functions changed similarly. In short, glib-0.12.2 doesn't build with 7.4. Either hack it yourself to make it compile (highly nontrivial I suspect) or wait and use 7.2.2 until a new glib is released that works with 7.4.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文