Skip to content

Commit d7f8bcb

Browse files
committed
feat: add cargo_do_fetch step
1 parent 23267b4 commit d7f8bcb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

classes/cargo_bin.bbclass

+8-5
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ CARGO_BUILD_FLAGS = "\
6262
${EXTRA_CARGO_FLAGS} \
6363
"
6464

65-
cargo_bin_do_fetch() {
66-
cargo fetch
67-
}
68-
6965
cargo_bin_do_configure() {
7066
mkdir -p "${B}"
7167
mkdir -p "${CARGO_HOME}"
@@ -99,6 +95,13 @@ cargo_bin_do_configure() {
9995
chmod +x "${WRAPPER_DIR}/linker-native-wrapper.sh"
10096
}
10197

98+
addtask do_cargo_fetch after do_configure before do_compile
99+
do_cargo_fetch[network] = "1"
100+
do_cargo_fetch[dirs]= "${B}"
101+
cargo_bin_do_cargo_fetch() {
102+
cargo fetch --manifest-path ${CARGO_MANIFEST_PATH}
103+
}
104+
102105
cargo_bin_do_compile() {
103106
export TARGET_CC="${WRAPPER_DIR}/cc-wrapper.sh"
104107
export TARGET_CXX="${WRAPPER_DIR}/cxx-wrapper.sh"
@@ -176,4 +179,4 @@ cargo_bin_do_install() {
176179
fi
177180
}
178181

179-
EXPORT_FUNCTIONS do_configure do_compile do_install
182+
EXPORT_FUNCTIONS do_configure do_cargo_fetch do_compile do_install

0 commit comments

Comments
 (0)