Set proxy in cargo if available

This is needed for cargo to use proxies set by bitbake. It is important
for devtooled builds which does not use vendored sources.
This commit is contained in:
Johan Anderholm
2019-01-11 10:59:40 +01:00
parent 4110f1d92a
commit 9ecc36acb5

View File

@@ -51,6 +51,20 @@ cargo_common_do_configure () {
EOF
fi
if [ -n "${http_proxy}" ]; then
cat <<- EOF >> ${CARGO_HOME}/config
[http]
proxy = "${http_proxy}"
EOF
fi
if [ -n "${https_proxy}" ]; then
cat <<- EOF >> ${CARGO_HOME}/config
[https]
proxy = "${https_proxy}"
EOF
fi
echo "[target.${HOST_SYS}]" >> ${CARGO_HOME}/config
echo "linker = '${RUST_TARGET_CCLD}'" >> ${CARGO_HOME}/config
if [ "${HOST_SYS}" != "${BUILD_SYS}" ]; then