haskell - 将 hsc2hs 与 HPack 和 Stack 一起使用
问题描述
我想通过 Stack 和 HPack 使用 hsc2hs。问题是,由于 HPack 不允许我将.hsc
文件列为源文件,.hs
因此对文件的更改.hsc
不会触发stack build
.
我的package.yaml
文件如下:
name: bounce-bench
version: 0.1.0
category: acme
dependencies:
- base
source-dirs:
- src
executables:
sim-ffi:
source-dirs: sim
main: sim-ffi.hs
build-tools: hsc2hs
c-sources:
- csim/Bounce.h
- csim/Bounce.c
include-dirs: csim
使用上述文件,初始成功(包括从stack build
构建),但是,如果更改,后续调用不会执行任何操作。sim-ffi.hs
sim-ffi.hsc
stack build
sim-ffi.hsc
如果我尝试将main
键的值从sim-ffi.hs
to更改sim-ffi.hsc
,我会被明确告知:
Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5: The 'main-is' field must specify a
'.hs' or '.lhs' file (even if it is generated by a preprocessor), or it may
specify a C/C++/obj-C source file.
解决方案
推荐阅读
- python - 如何添加两个字典
- jenkins - 分支中特定文件夹的 Jenkins WebHook URL
- php - PHP 只允许字符串中的特定单词
- django-models - 使用 Django 计算 TextField 字符数
- python-3.x - 即使我初始化了局部和全局变量,也尝试使用未初始化的值错误
- c# - 如何在asp.net c#中将json数据绑定到gridview?
- go - 包源之间的循环依赖
- npm - 如何让 npm 始终获取最后一个预发布版本?
- angular - 尝试在 azure 应用程序中更新 nodejs 版本时出现问题。无法在 azure 中为应用程序执行构建
- selenium - org.openqa.selenium.json.JsonException:预期读取 START_MAP 但有:END。通过 Node 执行测试时读取的最后 0 个字符