昨天逛论坛看到有佬有求助: 求个可以在serv00或者cloudflare pages上运行的版本 。于是我就小小地折腾了一下,研究了下怎么在serv00上编译rust,踩到了不少坑(后面发现不需要编译rust
),但是既然折腾都折腾了,就在这里规整规整,以利后来人。
克隆仓库
cd ~/domains && git clone https://github.com/rust-lang/rust.git && cd rust
限制并行
serv00主机限制了最大进程为20,这里建议并行为10并退出所有其他正在运行的服务
export MAKEFLAGS="-j10"
添加软链
我编译的时候这里一直报错,后来才发现竟然是目录结构的问题
ln -s /home/$username/domains/rust/build/ /usr/home/$username/domains/rust/build/
开始编译
./x.py install
如果编译中断需要清除缓存重新编译
rm -fr /home/$username/domains/rust/build/cache/
./x.py install
查看版本号
rustc --version