From c24dccc8b7a3a90cce3a32fc8bc9066ae42fa2bb Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 2 Dec 2022 17:52:46 +0800 Subject: [PATCH] doc: add dependency doc (#544) --- .../development-environment.md | 31 ++++++++++++++++--- docs/cn/installation/sources/build.md | 15 +++++++++ docs/cn/installation/sources/dependencies.md | 1 + 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/docs/cn/developer-guide/development-environment.md b/docs/cn/developer-guide/development-environment.md index cabd57b522..35f3d9fa20 100644 --- a/docs/cn/developer-guide/development-environment.md +++ b/docs/cn/developer-guide/development-environment.md @@ -36,10 +36,10 @@ docker目录和scripts目录分别为辅助编译的镜像描述目录和脚本 ## 开发镜像 -iLogtail依赖了诸多第三方库(详见[编译依赖](./dependencies.md)),为了简化编译流程ilogtail提供了预编译依赖的镜像辅助编译。开发镜像的地址在`sls-registry.cn-beijing.cr.aliyuncs.com/sls-microservices/ilogtail-build-linux-amd64`,可通过下面命令获取。 +iLogtail依赖了诸多第三方库(详见[编译依赖](./dependencies.md)),为了简化编译流程ilogtail提供了预编译依赖的镜像辅助编译。开发镜像的地址在`sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux`,可通过下面命令获取。 ```shell -docker pull sls-registry.cn-beijing.cr.aliyuncs.com/sls-microservices/ilogtail-build-linux-amd64 +docker pull sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux ``` 开发镜像预先安装了gcc和go编译器,更新了git,为了代码风格统一安装了clang-format、go-tools,为了便于调试也安装了gdb、go-delve等工具。为方便国内开发者,预先设置了GOPROXY="[https://goproxy.cn,direct"](https://goproxy.cn,direct")。 @@ -63,7 +63,7 @@ bin include lib lib64 share ssl 如果需要安装更多工具或编译依赖,可以在开发镜像上镜像叠加,制作自定义的开发镜像。 ```dockerfile -from sls-registry.cn-beijing.cr.aliyuncs.com/sls-microservices/ilogtail-build-linux-amd64 +from sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux yum -y install ... go install ... ``` @@ -82,7 +82,7 @@ go install ... ```json { - "image": "sls-registry.cn-beijing.cr.aliyuncs.com/sls-microservices/ilogtail-build-linux-amd64:latest", + "image": "sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux:latest", "customizations": { "vscode": { "extensions": [ @@ -186,7 +186,7 @@ cp -a ./core/build/plugin/libPluginAdapter.so ./output ```bash docker run --name ilogtail-build -d \ -v `pwd`:/src -w /src \ - sls-registry.cn-beijing.cr.aliyuncs.com/sls-microservices/ilogtail-build-linux-amd64:latest \ + sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux:latest \ bash -c "sleep infinity" ``` @@ -237,3 +237,24 @@ scp libPluginBase.so @:/home/ ```bash cp /logtail_host/home//libPluginBase.so /usr/local/ilogtail ``` + +## 常见问题 + +### 1. 更新代码后编译错误 + +如果发生编译错误,如 + +``` shell +/src/core/common/CompressTools.cpp:18:23: fatal error: zstd/zstd.h: No such file or directory + #include + ^ +compilation terminated. +``` + +请确保本地编译镜像为最新版本。可使用以下命令更新: + +``` shell +docker pull sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux +``` + +若使用VS Code进行开发,请重新编译开发容器镜像。使用Shift + Command + P(Mac)或Ctrl + Shift + P(Win)打开命令面板,输入rebuild,选择`Dev-Containers: Rebuild Without Cache and Reopen in Container`。 diff --git a/docs/cn/installation/sources/build.md b/docs/cn/installation/sources/build.md index 53611abf57..d86d1a7e18 100644 --- a/docs/cn/installation/sources/build.md +++ b/docs/cn/installation/sources/build.md @@ -25,6 +25,21 @@ Makefile描述了整个项目的所有编译目标,主要的包括: VERSION=1.1.1 make dist ``` +如果发生编译错误,如 + +``` shell +/src/core/common/CompressTools.cpp:18:23: fatal error: zstd/zstd.h: No such file or directory + #include + ^ +compilation terminated. +``` + +请确保本地编译镜像为最新版本。可使用以下命令更新: + +``` shell +docker pull sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux +``` + ## 使用镜像编译完整iLogtail 编译完整iLogtail的命令是`make all`,由于all是默认的编译目标,因此也可以直接`make`。该命令首先清理`output`目录,然后调用`./scripts/gen_build_scripts.sh`脚本生成编译用的脚本和镜像描述保存到`./gen`目录,调用 docker 制作镜像,制作的过程即镜像内的编译过程,最后将镜像内的编译结果复制到`output`目录。 diff --git a/docs/cn/installation/sources/dependencies.md b/docs/cn/installation/sources/dependencies.md index a1302a7900..aecbce2602 100644 --- a/docs/cn/installation/sources/dependencies.md +++ b/docs/cn/installation/sources/dependencies.md @@ -22,3 +22,4 @@ | 16 | breakpad ([66571f4838b2306161f072555cb199049bc68142](https://github.com/google/breakpad/tree/66571f4838b2306161f072555cb199049bc68142)) | Windows上崩溃诊断 | | 17 | leveldb ([1.22](https://github.com/google/leveldb/releases/tag/1.22)) | | | 18 | yaml-cpp ([0.7.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.7.0)) | 解析YAML配置 | +| 19 | zstd ([1.5.2](https://github.com/facebook/zstd/releases/tag/v1.5.2)) | zstd压缩发送数据 |