Open traderp opened 4 years ago
Thanks for your issue. @traderp
Yes, I do some tests. happend the same error. The reason of this error is out of memory error.
In my test, I use 1GB RAM container to compile td, It's error. stopped in 51% and thrown an exception.
So in order to ensure that td can be compiled, I have not limited the memory.
### if want use 1G RAM to compile td, please use this line.
# docker run --rm -dit --name debian --memory 1g debian:stretch
### else run this.
docker run --rm -dit --name debian debian:stretch
docker stats debian --no-stream
docker exec -i debian bash << 'EOF'
# -----
apt update
apt install -y curl git
apt install -y g++ gperf cmake zlib1g zlib1g-dev openssl libssl-dev
cd
git clone https://github.com/tdlib/td.git
cd td
git checkout -b v1.5.0
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cp libtdjson.so* /usr/lib
cd
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
git clone https://github.com/fewensa/rtdlib
cd rtdlib
cargo build
cargo test
EOF
### not have any limit
# docker run --rm -dit --name deb1 debian:stretch
docker run --rm -dit --name deb1 --memory 1g debian:stretch
docker cp debian:/usr/lib/libtdjson.so /tmp
docker cp /tmp/libtdjson.so deb1:/usr/lib
docker exec -i deb1 bash << 'EOF'
# ---
apt update
apt install -y curl git g++
cd
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
git clone https://github.com/fewensa/rtdlib
cd rtdlib
### (signal: 9, SIGKILL: kill)
cargo build
cargo test
EOF
I think this question is a matter of choice. Now in rtdlib, in order to provide easy-to-use APIs, each struct provides many methods ( example: InputFile, ) and builder struct ( example: RTDInputFileIdBuilder ). But I know, some struct don't need these, especially builder don't need every struct. even so, I can't figure out which is needed and which is not. to many struct for td, In order to reduce compile-time memory, a better strategy is needed to reduce the number of rtdlib struct.
We may need more tests to understand the problem.
I just read td's README and learned that in order to build on a low memory machine, you have to use a helper script. This may be a limitation of td itself, perhaps providing a docker image with pre-build td and then building on that image would help
Thanks for your help, I didn't find it before, I will test it as soon.
-------- Original Message -------- On Aug 18, 2020, 11:51, Yongsheng Xu wrote:
I just read td's README and learned that in order to build on a low memory machine, you have to use a helper script. This may be a limitation of td itself, perhaps providing a docker image with pre-build td and then building on that image would help image
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
In a Debian Docker container where tdlib 1.5 is built from source and installed in
/usr/lib
:The build only fails on one host and not the other (exact build sequence including building tdlib). Both hosts use an up-to-date Linux LTS kernel. The host that fails is a VPS with 1GB of RAM.