This is an automated email from the ASF dual-hosted git repository. jiacai2050 pushed a commit to branch feat-tips in repository https://gitbox.apache.org/repos/asf/horaedb-docs.git
commit 5ec951cc6f1c126a484fca583eba5f2919a32166 Author: jiacai2050 <[email protected]> AuthorDate: Wed Oct 30 22:43:53 2024 +0800 add compile tips --- content/cn/docs/dev/compile_run.md | 35 +++++++++++++++++++++++++---------- content/en/docs/dev/compile_run.md | 35 +++++++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/content/cn/docs/dev/compile_run.md b/content/cn/docs/dev/compile_run.md index 5801889..13af08a 100644 --- a/content/cn/docs/dev/compile_run.md +++ b/content/cn/docs/dev/compile_run.md @@ -12,11 +12,9 @@ weight: 10 假设我们的开发环境是 Ubuntu20.04, 可以执行如下命令来安装所需的依赖。 ```shell -sudo apt install git curl gcc g++ libssl-dev pkg-config cmake protobuf-compiler +sudo apt install git curl gcc g++ libssl-dev pkg-config protobuf-compiler ``` -需要注意的是,项目的编译对 cmake 有版本要求。如果你的开发环境是旧的 Linux 发行版,有必要手动安装这些依赖项的高版本。 - ## macOS 如果你的开发环境是 `MacOS` ,可以使用如下命令手动安装这些依赖项的高版本。 @@ -27,13 +25,7 @@ sudo apt install git curl gcc g++ libssl-dev pkg-config cmake protobuf-compiler xcode-select --install ``` -2. 安装 cmake: - -```shell -brew install cmake -``` - -3. 安装 protobuf: +2. 安装 protobuf: ```shell brew install protobuf @@ -63,3 +55,26 @@ cargo build ```bash ./target/debug/horaedb-server --config ./docs/minimal.toml ``` + +# 常见问题 + +在 macOS 上编译时,可能会遇到下面的错误: + +``` +IO error: while open a file for lock: /var/folders/jx/grdtrdms0zl3hy6zp251vjh80000gn/T/.tmpmFOAF9/manifest/LOCK: Too many open files + +or + +error: could not compile `regex-syntax` (lib) +warning: build failed, waiting for other jobs to finish... +LLVM ERROR: IO failure on output stream: File too large +error: could not compile `syn` (lib) + +``` + +可以通过下面的命令来解决: + +```bash +ulimit -n unlimited +ulimit -f unlimited +``` diff --git a/content/en/docs/dev/compile_run.md b/content/en/docs/dev/compile_run.md index d744d23..449f571 100644 --- a/content/en/docs/dev/compile_run.md +++ b/content/en/docs/dev/compile_run.md @@ -12,11 +12,9 @@ In order to compile HoraeDB, some relevant dependencies(including the `Rust` too Assuming the development environment is Ubuntu20.04, execute the following command to install the required dependencies: ```shell -sudo apt install git curl gcc g++ libssl-dev pkg-config cmake protobuf-compiler +sudo apt install git curl gcc g++ libssl-dev pkg-config protobuf-compiler ``` -It should be noted that the compilation of the project requires a higher version of CMake; if your development environment is an older Linux distribution, you will need to manually install the dependencies for a higher version. - ## macOS If the development environment is MacOS, execute the following command to install the required dependencies. @@ -27,13 +25,7 @@ If the development environment is MacOS, execute the following command to instal xcode-select --install ``` -2. Install cmake: - -```shell -brew install cmake -``` - -3. Install protobuf: +2. Install protobuf: ```shell brew install protobuf @@ -62,3 +54,26 @@ Then you can run HoraeDB using the default configuration file provided in the co ```bash ./target/debug/horaedb-server --config ./docs/minimal.toml ``` + +# Tips + +When compiling on macOS, you may encounter following errors: + +``` +IO error: while open a file for lock: /var/folders/jx/grdtrdms0zl3hy6zp251vjh80000gn/T/.tmpmFOAF9/manifest/LOCK: Too many open files + +or + +error: could not compile `regex-syntax` (lib) +warning: build failed, waiting for other jobs to finish... +LLVM ERROR: IO failure on output stream: File too large +error: could not compile `syn` (lib) + +``` + +To fix those, you should adjust ulimit as follows: + +```bash +ulimit -n unlimited +ulimit -f unlimited +``` --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
