edgedb 基于python开发,同时源码重包含了好多子项目,以下进行简单的源码编译

clone 代码

需要递归处理,加上recursive,比较慢稍等

git clone --recursive https://github.com/edgedb/edgedb.git

效果

正克隆到 'edgedb'...
remote: Enumerating objects: 165, done.
remote: Counting objects: 100% (165/165), done.
remote: Compressing objects: 100% (129/129), done.
remote: Total 48698 (delta 68), reused 66 (delta 36), pack-reused 48533
接收对象中: 100% (48698/48698), 13.53 MiB | 767.00 KiB/s, done.
处理 delta 中: 100% (33738/33738), done.
子模组 'edb/server/pgproto' (https://github.com/MagicStack/py-pgproto.git) 已为路径 'edb/server/pgproto' 注册
子模组 'postgres' (https://github.com/edgedb/postgres.git) 已为路径 'postgres' 注册
正克隆到 'edb/server/pgproto'...
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 207 (delta 14), reused 22 (delta 9), pack-reused 175
接收对象中: 100% (207/207), 67.21 KiB | 0 bytes/s, done.
处理 delta 中: 100% (133/133), done.
子模组路径 'edb/server/pgproto':检出 'aca615c71d7060555b629323a1aa6bb1af7b50f2'
正克隆到 'postgres'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
接收对象中: 4% (31265/714724), 11.86 MiB | 100.00 KiB/s
接收对象中: 4% (31588/714724), 11.96 MiB | 94.00 KiB/s

构建

  • 环境准备

    使用venv 进行python3 环境的准备

python3 -m venv edgedb
source edgedb/bin/active
  • 构建

    比较慢,稍等

cd edgedb
make
  • 效果
find edb -name '*.pyx' | xargs touch
python setup.py build_ext --inplace
warning: no files found matching '*.py' under directory 'examples'
warning: no files found matching '*.pem' under directory 'tests'
edgedb/pgproto/pgproto.c: 在函数‘__pyx_f_6edgedb_7pgproto_7pgproto_i64_to_hex’中:
edgedb/pgproto/pgproto.c:10446:28: 警告:‘char’转换自‘int’时可能改变值 [-Wconversion]
__pyx_v_i = (__pyx_v_i - 1);
^
edgedb/pgproto/pgproto.c: 在函数‘__pyx_f_6edgedb_7pgproto_7pgproto_pg_uuid_bytes_from_str’中:
edgedb/pgproto/pgproto.c:10744:55: 警告:‘uint8_t’转换自‘int’时可能改变值 [-Wconversion]
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
^
edgedb/pgproto/pgproto.c:10955:30: 警告:‘uint8_t’转换自‘int’时可能改变值 [-Wconversion]
__pyx_v_j = (__pyx_v_j + 1);
^ ........
  • install local

    稍等,有点慢,因为server 依赖pg 数据库。。。

pip install .
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Processing /opt/edgedb
Collecting asyncpg~=0.18.2 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/25/eb/9674bb30b80403ee3110dcbd54d71080dfc71d0774760955353aaa5c1627/asyncpg-0.18.3-cp36-cp36m-manylinux1_x86_64.whl (2.4MB)
100% |████████████████████████████████| 2.4MB 91.0MB/s
Collecting click~=6.7 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
100% |████████████████████████████████| 71kB 63.2MB/s
Collecting httptools>=0.0.13 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/1b/03/215969db11abe8741e9c266a4cbe803a372bd86dd35fa0084c4df6d4bd00/httptools-0.0.13.tar.gz (104kB)
100% |████████████████████████████████| 112kB 84.5MB/s
Collecting immutables>=0.9 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/e3/91/bc4b34993ef77aabfd1546a657563576bdd437205fa24d4acaf232707452/immutables-0.9-cp36-cp36m-manylinux1_x86_64.whl (91kB)
100% |████████████████████████████████| 92kB 1.3MB/s
Collecting parsing~=1.6.1 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/fc/19/05dff0134f244265c7cee60f5075ce9236c69b28c8a9767fa5354d15d246/parsing-1.6.1-py3-none-any.whl
Collecting prompt_toolkit>=2.0.0 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/f7/a7/9b1dd14ef45345f186ef69d175bdd2491c40ab1dfa4b2b3e4352df719ed7/prompt_toolkit-2.0.9-py3-none-any.whl (337kB)
100% |████████████████████████████████| 337kB 90.4MB/s
Collecting psutil~=5.6.1 (from edgedb-server==1.0a2.dev29+g946bbdf)
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/2f/b8/11ec5006d2ec2998cb68349b8d1317c24c284cf918ecd6729739388e4c56/psutil-5.6.1.tar.gz (427kB)
100% |████████████████████████████████| Installing collected packages: asyncpg, click, httptools, immutables, six, parsing, wcwidth, prompt-toolkit, psutil, Pygments, setproctitle, uvloop, promise, rx, graphql-core, edgedb, edgedb-server
Running setup.py install for httptools ... done
Running setup.py install for psutil ... done
Running setup.py install for setproctitle ... done
Running setup.py install for promise ... done
Running setup.py install for edgedb ... done
Running setup.py install for edgedb-server ... /
  • 查看安装
pip list

效果

Package Version
-------------- --------------------
asyncpg 0.18.3
click 6.7
edgedb 0.6.1
edgedb-server 1.0a2.dev29+g946bbdf
graphql-core 2.1
httptools 0.0.13
immutables 0.9
parsing 1.6.1
pip 10.0.1
promise 2.2.1
prompt-toolkit 2.0.9
psutil 5.6.1
Pygments 2.3.1
Rx 1.6.1
setproctitle 1.1.10
setuptools 39.0.1
setuptools-scm 3.2.0
six 1.12.0
uvloop 0.12.2
wcwidth 0.1.7
  • 生成的console 命令
ls  -sial  bin

效果

140985 4 drwxr-xr-x 2 root root 4096 4月 23 17:13 .
134239 4 drwxr-xr-x 15 root root 4096 4月 23 17:06 ..
141201 4 -rw-r--r-- 1 root root 2191 4月 23 16:58 activate
141513 4 -rw-r--r-- 1 root root 1247 4月 23 16:58 activate.csh
141512 4 -rw-r--r-- 1 root root 2411 4月 23 16:58 activate.fish
141194 4 -rwxr-xr-x 1 root root 241 4月 23 16:58 easy_install
141195 4 -rwxr-xr-x 1 root root 241 4月 23 16:58 easy_install-3.6
142182 4 -rwxr-xr-x 1 root root 450 4月 23 17:13 edgedb
142183 4 -rwxr-xr-x 1 root root 464 4月 23 17:13 edgedb-server
141507 4 -rwxr-xr-x 1 root root 223 4月 23 16:58 pip
141508 4 -rwxr-xr-x 1 root root 223 4月 23 16:58 pip3
141509 4 -rwxr-xr-x 1 root root 223 4月 23 16:58 pip3.6
142018 4 -rwxr-xr-x 1 root root 226 4月 23 17:04 pygmentize
140988 0 lrwxrwxrwx 1 root root 7 4月 23 16:58 python -> python3
140987 0 lrwxrwxrwx 1 root root 16 4月 23 16:58 python3 -> /usr/bin/python3
  • 运行

    直接是不可以运行的,需要配置参数,配置可以参考如下

[Unit]
Description=Next generation object-relational database
Documentation=https://edgedb.com/
After=syslog.target
After=network.target [Service]
Type=notify User=edgedb
Group=edgedb Environment=EDGEDATA=/var/lib/edgedb/1-alpha1/data/
RuntimeDirectory=edgedb ExecStart=/usr/lib64/edgedb-1-alpha1/bin/edgedb-server -D ${EDGEDATA} --runstate-dir=%t/edgedb
ExecReload=/bin/kill -HUP ${MAINPID}
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0 [Install]
WantedBy=multi-user.target

几个错误

  • setuptools_scm 问题
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools_scm~=3.2.0')

解决方法:

pip  install setuptools_scm~=3.2.0

说明

通过学习源码的编译我们可以进一步了解edgedb 的工作原理,对于启动可以进一步学习源码,了解启动的处理逻辑,目前直接运行edgedb-server
是有问题的,实际上因为后端是使用的pg 需要配置类似pg 的相关参数,实际我们可以解决systemd 的管理文件

参考资料

https://github.com/edgedb/edgedb

 
 
 
 

edgedb 内部pg 数据存储的探索 (四) 源码编译的更多相关文章

  1. edgedb 内部pg 数据存储的探索 (三) 源码包setup.py 文件

    edgedb 是基于python开发的,同时集成了cython 以下为包的setup.py 配置,从里面我们可以看到关于edgedb 的一些依赖 以及构建过程 setup.py 源码 整体配置不算很多 ...

  2. edgedb 内部pg 数据存储的探索 (一)基本环境搭建

    edgedb 是基于pg 上的对象关系数据库,已经写过使用docker 运行的demo,为了探索内部的原理,做了一下尝试,开启pg 访问 后边会进一步的学习 环境准备 为了测试,使用yum 安装 安装 ...

  3. edgedb 内部pg 数据存储的探索 (二) 创建数据库命令说明

    前面已经创建好了一个简单可以访问pg 的edgedb 环境,现在测试几个数据库操作命令在pg 的存储 创建数据库 连接环境 注意账户是按照上次创建的环境配置 edgedb -u edgedb 创建数据 ...

  4. edgedb 内部pg 数据存储的探索 (五) 运行进程列表信息

    做为一个简单的记录,方便后期分析学习 当前包含了一个timescale 的extension 可以不用关注 信息 ps -ef |grep edgedb edgedb 10559 24858 0 4月 ...

  5. nRF5 SDK for Mesh(四) 源码编译

    官方文档教程编译源码: http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk%2Fdita%2Fs ...

  6. 65、Spark Streaming:数据接收原理剖析与源码分析

    一.数据接收原理 二.源码分析 入口包org.apache.spark.streaming.receiver下ReceiverSupervisorImpl类的onStart()方法 ### overr ...

  7. java io系列15之 DataOutputStream(数据输出流)的认知、源码和示例

    本章介绍DataOutputStream.我们先对DataOutputStream有个大致认识,然后再深入学习它的源码,最后通过示例加深对它的了解. 转载请注明出处:http://www.cnblog ...

  8. 安卓图表引擎AChartEngine(四) - 源码示例 嵌入Acitivity中的折线图

    前面几篇博客中都是调用ChartFactory.get***Intent()方法,本节讲的内容调用ChartFactory.get***View()方法,这个方法调用的结果可以嵌入到任何一个Activ ...

  9. Android源码浅析(四)——我在Android开发中常用到的adb命令,Linux命令,源码编译命令

    Android源码浅析(四)--我在Android开发中常用到的adb命令,Linux命令,源码编译命令 我自己平时开发的时候积累的一些命令,希望对你有所帮助 adb是什么?: adb的全称为Andr ...

随机推荐

  1. input 特殊字符限制

    ng-pattern="/^[A-Za-z0-9_,\.\u4e00-\u9fa5\s]+$/"

  2. Mysql 存储过程查询结果赋值到变量的方法

    drop table if exists test_tbl; create table test_tbl (name varchar(20), status int(2)); insert into ...

  3. RN android真机调试找不到设备

    待完成…… 1.adb驱动安装 2.手机设置 3.添加adb_usb.ini文件

  4. Openresty 操作Cookie

    Openresty 操作cookie共有两种方法: 1.直接操作 1.1 获取Cookie 获取所有cookie: ngx.var.http_cookie, 这里获取的是一个字符串,如果不存在则返回n ...

  5. 牛客网小a的旅行计划

    地址:https://ac.nowcoder.com/acm/contest/223/B 此题是一道套公式题目,不难,ans=(pow(4,n+1)-4*pow(3,n+1)+6*pow(2,n+1) ...

  6. Springboot添加定时任务

    请参考这篇文章:https://blog.csdn.net/ysp_0607/article/details/71430281

  7. python sheet写入数据

    import pandas as pd from pandas import DataFrame import openpyxl from openpyxl import load_workbook ...

  8. 2018-计算机系机试(第二批)-A-最大数

    单点时限: 1.0 sec 内存限制: 256 MB 输入 n 个整数,输出其中最大数的值. 例如:3 个整数 1 ,2 和 6 的最大值是 6 . 输入格式 每一行的第一个数是 n (1≤n≤20 ...

  9. svn linux 服务器的搭建

    1 查询是否安装了svn: rpm -qa subversion 2:如果没有那么: yum -y install  subversion 3:建立一个存储路经:mkdir -p /applicati ...

  10. Spring源码学习笔记1

    1.Spring中最核心的两个类 1)DefaultListableBeanFactory XmlBeanFactory继承自DefaultListableBeanFactory,DefaultLis ...