From fa0aebc070249000c108a08bd449088c98a6d8ea Mon Sep 17 00:00:00 2001 From: Johan Anderholm Date: Tue, 29 Jan 2019 20:50:03 +0100 Subject: [PATCH] Disable http2 in cargo Since 1.31.0 cargo requires curl to support http2. Enabling http2 in curl results in a dependency loop. This commit disables the use of multiplexing and http2. --- classes/cargo_common.bbclass | 17 +++++------ recipes-devtools/cargo/cargo.inc | 2 ++ .../cargo/cargo/0001-Disable-http2.patch | 30 +++++++++++++++++++ recipes-devtools/rust/libstd-rs.inc | 2 +- 4 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 recipes-devtools/cargo/cargo/0001-Disable-http2.patch diff --git a/classes/cargo_common.bbclass b/classes/cargo_common.bbclass index ae4daf8..7eaa9d0 100644 --- a/classes/cargo_common.bbclass +++ b/classes/cargo_common.bbclass @@ -51,18 +51,15 @@ cargo_common_do_configure () { EOF fi - if [ -n "${http_proxy}" ]; then - cat <<- EOF >> ${CARGO_HOME}/config + # Disable multiplexing in order to keep cargo from using http2, which we + # can't currently enable because of dependency loops + cat <<- EOF >> ${CARGO_HOME}/config [http] - proxy = "${http_proxy}" - EOF - fi + multiplexing = false + EOF - if [ -n "${https_proxy}" ]; then - cat <<- EOF >> ${CARGO_HOME}/config - [https] - proxy = "${https_proxy}" - EOF + if [ -n "${http_proxy}" ]; then + echo "proxy = \"{http_proxy}\"" >> ${CARGO_HOME}/config fi echo "[target.${HOST_SYS}]" >> ${CARGO_HOME}/config diff --git a/recipes-devtools/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc index d37d787..450a476 100644 --- a/recipes-devtools/cargo/cargo.inc +++ b/recipes-devtools/cargo/cargo.inc @@ -11,6 +11,8 @@ LIC_FILES_CHKSUM = " \ file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \ " +SRC_URI += "file://0001-Disable-http2.patch" + S = "${RUSTSRC}/src/tools/cargo" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" diff --git a/recipes-devtools/cargo/cargo/0001-Disable-http2.patch b/recipes-devtools/cargo/cargo/0001-Disable-http2.patch new file mode 100644 index 0000000..9d38b7a --- /dev/null +++ b/recipes-devtools/cargo/cargo/0001-Disable-http2.patch @@ -0,0 +1,30 @@ +From a66e33d612d2207154de20e24701b0c30056fe7a Mon Sep 17 00:00:00 2001 +From: Johan Anderholm +Date: Sun, 27 Jan 2019 10:19:00 +0100 +Subject: [PATCH] Disable http2 + +http2 requires that curl is build with nghttp2 which in turn depends on +many dependencies and ultimately a dependency loop in the case of +curl-native. As long as multiplexing is disabled in cargo this should +be fine. + +Upstream-Status: Inappropriate +--- + Cargo.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Cargo.toml b/Cargo.toml +index d2d48ff7..d5dff47d 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -22,7 +22,7 @@ bytesize = "1.0" + crates-io = { path = "src/crates-io", version = "0.21" } + crossbeam-utils = "0.6" + crypto-hash = "0.3.1" +-curl = { version = "0.4.19", features = ['http2'] } ++curl = { version = "0.4.19" } + curl-sys = "0.4.15" + env_logger = "0.6.0" + pretty_env_logger = { version = "0.2", optional = true } +-- +2.17.1 diff --git a/recipes-devtools/rust/libstd-rs.inc b/recipes-devtools/rust/libstd-rs.inc index 44bc56f..5298c00 100644 --- a/recipes-devtools/rust/libstd-rs.inc +++ b/recipes-devtools/rust/libstd-rs.inc @@ -26,6 +26,6 @@ do_install () { # With the incremental build support added in 1.24, the libstd deps directory also includes dependency # files that get installed. Those are really only needed to incrementally rebuild the libstd library # itself and don't need to be installed. - rm ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/*.d + rm -f ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/*.d cp ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} }