cargo_common: Make output more readable
This commit is contained in:
@@ -30,48 +30,60 @@ CARGO_VENDORING_DIRECTORY ?= "${CARGO_HOME}/bitbake"
|
|||||||
|
|
||||||
cargo_common_do_configure () {
|
cargo_common_do_configure () {
|
||||||
mkdir -p ${CARGO_HOME}/bitbake
|
mkdir -p ${CARGO_HOME}/bitbake
|
||||||
echo "paths = [" > ${CARGO_HOME}/config
|
|
||||||
|
|
||||||
for p in ${EXTRA_OECARGO_PATHS}; do
|
cat <<- EOF > ${CARGO_HOME}/config
|
||||||
printf "\"%s\"\n" "$p"
|
# EXTRA_OECARGO_PATHS
|
||||||
done | sed -e 's/$/,/' >> ${CARGO_HOME}/config
|
paths = [
|
||||||
echo "]" >> ${CARGO_HOME}/config
|
$(for p in ${EXTRA_OECARGO_PATHS}; do echo \"$p\",; done)
|
||||||
|
]
|
||||||
|
EOF
|
||||||
|
|
||||||
# Point cargo at our local mirror of the registry
|
|
||||||
cat <<- EOF >> ${CARGO_HOME}/config
|
cat <<- EOF >> ${CARGO_HOME}/config
|
||||||
|
|
||||||
|
# Local mirror vendored by bitbake
|
||||||
[source.bitbake]
|
[source.bitbake]
|
||||||
directory = "${CARGO_VENDORING_DIRECTORY}"
|
directory = "${CARGO_VENDORING_DIRECTORY}"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ -z "${EXTERNALSRC}" ] && [ ${CARGO_DISABLE_BITBAKE_VENDORING} = "0" ]; then
|
if [ -z "${EXTERNALSRC}" ] && [ ${CARGO_DISABLE_BITBAKE_VENDORING} = "0" ]; then
|
||||||
cat <<- EOF >> ${CARGO_HOME}/config
|
cat <<- EOF >> ${CARGO_HOME}/config
|
||||||
|
|
||||||
[source.crates-io]
|
[source.crates-io]
|
||||||
replace-with = "bitbake"
|
replace-with = "bitbake"
|
||||||
local-registry = "/nonexistant"
|
local-registry = "/nonexistant"
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable multiplexing in order to keep cargo from using http2, which we
|
cat <<- EOF >> ${CARGO_HOME}/config
|
||||||
# can't currently enable because of dependency loops
|
|
||||||
cat <<- EOF >> ${CARGO_HOME}/config
|
|
||||||
[http]
|
|
||||||
multiplexing = false
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# When a sstate-cache is used sometimes the certificates are not available
|
[http]
|
||||||
# at the compile time path anymore. Set it explicitly instead.
|
# Multiplexing can't be enabled because http2 can't be enabled
|
||||||
echo "cainfo = \"${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt\"" \
|
# in curl-native without dependency loops
|
||||||
>> ${CARGO_HOME}/config
|
multiplexing = false
|
||||||
|
|
||||||
|
# Ignore the hard coded and incorrect path to certificates
|
||||||
|
cainfo = "${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
if [ -n "${http_proxy}" ]; then
|
if [ -n "${http_proxy}" ]; then
|
||||||
echo "proxy = \"${http_proxy}\"" >> ${CARGO_HOME}/config
|
echo "proxy = \"${http_proxy}\"" >> ${CARGO_HOME}/config
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[target.${HOST_SYS}]" >> ${CARGO_HOME}/config
|
cat <<- EOF >> ${CARGO_HOME}/config
|
||||||
echo "linker = '${RUST_TARGET_CCLD}'" >> ${CARGO_HOME}/config
|
|
||||||
|
# HOST_SYS
|
||||||
|
[target.${HOST_SYS}]
|
||||||
|
linker = "${RUST_TARGET_CCLD}"
|
||||||
|
EOF
|
||||||
|
|
||||||
if [ "${HOST_SYS}" != "${BUILD_SYS}" ]; then
|
if [ "${HOST_SYS}" != "${BUILD_SYS}" ]; then
|
||||||
echo "[target.${BUILD_SYS}]" >> ${CARGO_HOME}/config
|
cat <<- EOF >> ${CARGO_HOME}/config
|
||||||
echo "linker = '${RUST_BUILD_CCLD}'" >> ${CARGO_HOME}/config
|
|
||||||
|
# BUILD_SYS
|
||||||
|
[target.${BUILD_SYS}]
|
||||||
|
linker = "${RUST_BUILD_CCLD}"
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Put build output in build directory preferred by bitbake instead of
|
# Put build output in build directory preferred by bitbake instead of
|
||||||
|
|||||||
Reference in New Issue
Block a user