From 9ecc36acb5f2a3e40970c6c3f0607bca5987a1a7 Mon Sep 17 00:00:00 2001 From: Johan Anderholm Date: Fri, 11 Jan 2019 10:59:40 +0100 Subject: [PATCH] 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. --- classes/cargo_common.bbclass | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/classes/cargo_common.bbclass b/classes/cargo_common.bbclass index cc37c63..ae4daf8 100644 --- a/classes/cargo_common.bbclass +++ b/classes/cargo_common.bbclass @@ -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