构建 libsodium 时如何在 Linux 上解决此构建错误

问题描述

我正在尝试在基于 debian 的 Azure Docker VM 中构建 libsodium-sys 依赖项。 花了几个小时试图修复这个构建错误,但无法弄清楚发生了什么。

我通过安装缺少的依赖项修复了几个构建错误,因为 Azure Docker VM 看起来很普通。执行的命令在错误下方。

error: Failed to run custom build command for `libsodium-sys v0.2.6 (https://github.com/cjdelisle/sodiumoxide?rev=76dc0e6e587b8c8a4bb193ebba9f8ae8f090b81b#76dc0e6e)`

Caused by:
  process didn't exit successfully: `/home/packetcrypt_rs/target/release/build/libsodium-sys-169018138a0de36b/build-script-build` (exit code: 101)
  checking for working alloca.h... yes
  checking for alloca... yes
...
  Making check in builds

  --- stderr
  /bin/bash: line 20: cd: builds: No such file or directory
  make: *** [Makefile:516: check-recursive] Error 1
  thread 'main' panicked at '
  Failed to build libsodium using "make" "check" "-j4"
  ',/root/.cargo/git/checkouts/sodiumoxide-9b8c3ad42446e2d9/76dc0e6/libsodium-sys/build.rs:281:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build Failed,waiting for other jobs to finish...
error: build Failed
root@2d0a725cde47:/home/packetcrypt_rs#

它正在谈论的 Build.rs 文件https://github.com/sodiumoxide/sodiumoxide/blob/master/libsodium-sys/build.rs

执行的命令:

apt get-update
apt-get install pkg-config
apt install apt-utils
apt install file
apt install gcc git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install make
apt install build-essential gcc-multilib -y
rustup target add armv7-unkNown-linux-gnueabihf
git clone https://github.com/cjdelisle/packetcrypt_rs
cd packetcrypt_rs
~/.cargo/bin/cargo build --release

解决方法

原因似乎与此处解释的问题有关:https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1379#note_280986944 由于我不知道的原因,这些是我需要执行以修复它的命令:

rm ~/.bashrc

rm ~/.profile

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...