hasura graphql-engine 源码构建问题
基于centos 7 构建
安装haskell 构建工具
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
依赖包问题
- gmp
yum install -y gmp-devel
- pcre
yum install -y pcre-devel
- mysql
The program 'mysql_config' is required but it could not be found
yum install -y mariadb-devel
- error "AES/PCLMUL instructions not enabled"
禁用aesni
cabal build all --constraint="cryptonite -support_aesni"
- pg
注意版本问题,此方法可能会太低了
The program 'pg_config' is required but it could not be found
yum install -y postgresql-devel
- Missing (or bad) C library: odbc
yum install -y unixODBC-devel
- 可能需要的安装
yum install -y libstdc++-devel libstdc++-static gcc-c++ ncurses-devel
构建
git clone https://github.com/hasura/graphql-engine.git
cd graphql-engine/server
cabal build all --constraint="cryptonite -support_aesni"
一些问题
适合内存不够用的场景,通过swap 解决,就是构建会比较慢,实际推荐使用一台配置比较好的机器构建(cpu,内存,以及磁盘)
dd if=/dev/zero of=/var/swapfile bs=1G count=10
mkswap /var/swapfile
swapon /var/swapfile
/etc/fstab
/var/swapfile swap swap defaults 0 0
vim /etc/sysctl.conf
vm.swappiness = 60
sysctl -p
性能相关参数
默认没有开启profile 我们可以通过手工开启,方便性能优化
server/graphql-engine.cabal
flag profiling
description: Configures the project to be profiling-compatible
default: True
manual: True
说明
以上是一个构建实践说明,推荐还是使用高版本的系统haskell 构建问题是不少,因为对于haskell 不是很了解,性能参数上边的还需要研究下
参考资料
https://gmplib.org/
https://www.haskell.org/ghcup/install/
https://github.com/hasura/graphql-engine
https://github.com/haskell-crypto/cryptonite
https://github.com/input-output-hk/cardano-node/issues/1747
https://www.haskell.org/ghcup/install/
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/config
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/profiling.html#prof-compiler-options
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/debug-info.html#implementor-s-notes-dwarf-annotations
https://github.com/fpco/ghc-prof-flamegraph
https://www.fpcomplete.com/blog/2015/04/ghc-prof-flamegraph/
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/profiling.html
https://www.tweag.io/blog/2020-01-30-haskell-profiling/
http://cnhaskell.com/chp/25.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2020-07-04 sql 数据定时发送webhook golang 服务
2020-07-04 hcl v2 golang使用参考
2019-07-04 chef test-kitchen Could not load the 'vagrant' driver from the load path 问题解决
2018-07-04 prisma graphql 工具基本使用
2018-07-04 postgraphile 基本试用
2015-07-04 图片加载js类库
2015-07-04 js 触摸类库