summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2025-02-21 14:58:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-25 12:17:22 +0000
commit5fe47418ba48a9cdb2eae30823e9b16ffe13215e (patch)
tree8dd3d6b81e8f247aad1bd8b880315ccce04d3772
parentcf8b4459a52d0952bceb91dabad09ff2fff55ea0 (diff)
downloadpoky-5fe47418ba48a9cdb2eae30823e9b16ffe13215e.tar.gz
cargo_common: use 'config.toml' instead of plain 'config'
cargo configuration has been renamed from plain 'config' to 'config.toml' in rust-1.38. Using the old name is still supported but creates warnings like | $ cargo | warning: `/sdk.../home/cargo/config` is deprecated in favor of `config.toml` | note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml` Use the new name. (From OE-Core rev: 94b7d1a6cdb44949f8a96213ff2e45fafd759442) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/cargo_common.bbclass20
1 files changed, 10 insertions, 10 deletions
diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass
index c528ae7f39..c9eb2d09a5 100644
--- a/meta/classes-recipe/cargo_common.bbclass
+++ b/meta/classes-recipe/cargo_common.bbclass
@@ -47,14 +47,14 @@ CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}"
47cargo_common_do_configure () { 47cargo_common_do_configure () {
48 mkdir -p ${CARGO_HOME}/bitbake 48 mkdir -p ${CARGO_HOME}/bitbake
49 49
50 cat <<- EOF > ${CARGO_HOME}/config 50 cat <<- EOF > ${CARGO_HOME}/config.toml
51 # EXTRA_OECARGO_PATHS 51 # EXTRA_OECARGO_PATHS
52 paths = [ 52 paths = [
53 $(for p in ${EXTRA_OECARGO_PATHS}; do echo \"$p\",; done) 53 $(for p in ${EXTRA_OECARGO_PATHS}; do echo \"$p\",; done)
54 ] 54 ]
55 EOF 55 EOF
56 56
57 cat <<- EOF >> ${CARGO_HOME}/config 57 cat <<- EOF >> ${CARGO_HOME}/config.toml
58 58
59 # Local mirror vendored by bitbake 59 # Local mirror vendored by bitbake
60 [source.bitbake] 60 [source.bitbake]
@@ -62,7 +62,7 @@ cargo_common_do_configure () {
62 EOF 62 EOF
63 63
64 if [ ${CARGO_DISABLE_BITBAKE_VENDORING} = "0" ]; then 64 if [ ${CARGO_DISABLE_BITBAKE_VENDORING} = "0" ]; then
65 cat <<- EOF >> ${CARGO_HOME}/config 65 cat <<- EOF >> ${CARGO_HOME}/config.toml
66 66
67 [source.crates-io] 67 [source.crates-io]
68 replace-with = "bitbake" 68 replace-with = "bitbake"
@@ -70,7 +70,7 @@ cargo_common_do_configure () {
70 EOF 70 EOF
71 fi 71 fi
72 72
73 cat <<- EOF >> ${CARGO_HOME}/config 73 cat <<- EOF >> ${CARGO_HOME}/config.toml
74 74
75 [http] 75 [http]
76 # Multiplexing can't be enabled because http2 can't be enabled 76 # Multiplexing can't be enabled because http2 can't be enabled
@@ -82,7 +82,7 @@ cargo_common_do_configure () {
82 82
83 EOF 83 EOF
84 84
85 cat <<- EOF >> ${CARGO_HOME}/config 85 cat <<- EOF >> ${CARGO_HOME}/config.toml
86 86
87 # HOST_SYS 87 # HOST_SYS
88 [target.${RUST_HOST_SYS}] 88 [target.${RUST_HOST_SYS}]
@@ -90,7 +90,7 @@ cargo_common_do_configure () {
90 EOF 90 EOF
91 91
92 if [ "${RUST_HOST_SYS}" != "${RUST_BUILD_SYS}" ]; then 92 if [ "${RUST_HOST_SYS}" != "${RUST_BUILD_SYS}" ]; then
93 cat <<- EOF >> ${CARGO_HOME}/config 93 cat <<- EOF >> ${CARGO_HOME}/config.toml
94 94
95 # BUILD_SYS 95 # BUILD_SYS
96 [target.${RUST_BUILD_SYS}] 96 [target.${RUST_BUILD_SYS}]
@@ -99,7 +99,7 @@ cargo_common_do_configure () {
99 fi 99 fi
100 100
101 if [ "${RUST_TARGET_SYS}" != "${RUST_BUILD_SYS}" -a "${RUST_TARGET_SYS}" != "${RUST_HOST_SYS}" ]; then 101 if [ "${RUST_TARGET_SYS}" != "${RUST_BUILD_SYS}" -a "${RUST_TARGET_SYS}" != "${RUST_HOST_SYS}" ]; then
102 cat <<- EOF >> ${CARGO_HOME}/config 102 cat <<- EOF >> ${CARGO_HOME}/config.toml
103 103
104 # TARGET_SYS 104 # TARGET_SYS
105 [target.${RUST_TARGET_SYS}] 105 [target.${RUST_TARGET_SYS}]
@@ -110,7 +110,7 @@ cargo_common_do_configure () {
110 # Put build output in build directory preferred by bitbake instead of 110 # Put build output in build directory preferred by bitbake instead of
111 # inside source directory unless they are the same 111 # inside source directory unless they are the same
112 if [ "${B}" != "${S}" ]; then 112 if [ "${B}" != "${S}" ]; then
113 cat <<- EOF >> ${CARGO_HOME}/config 113 cat <<- EOF >> ${CARGO_HOME}/config.toml
114 114
115 [build] 115 [build]
116 # Use out of tree build destination to avoid polluting the source tree 116 # Use out of tree build destination to avoid polluting the source tree
@@ -118,7 +118,7 @@ cargo_common_do_configure () {
118 EOF 118 EOF
119 fi 119 fi
120 120
121 cat <<- EOF >> ${CARGO_HOME}/config 121 cat <<- EOF >> ${CARGO_HOME}/config.toml
122 122
123 [term] 123 [term]
124 progress.when = 'always' 124 progress.when = 'always'
@@ -129,7 +129,7 @@ cargo_common_do_configure () {
129python cargo_common_do_patch_paths() { 129python cargo_common_do_patch_paths() {
130 import shutil 130 import shutil
131 131
132 cargo_config = os.path.join(d.getVar("CARGO_HOME"), "config") 132 cargo_config = os.path.join(d.getVar("CARGO_HOME"), "config.toml")
133 if not os.path.exists(cargo_config): 133 if not os.path.exists(cargo_config):
134 return 134 return
135 135