From: Frederic Martinsons Date: Wed, 2 Aug 2023 13:16:03 +0000 (+0200) Subject: cargo.bbclass: Use --frozen flag for cargo operations X-Git-Tag: uninative-4.2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ff9e6523bd7eb6cdc854adcbd031085c536e0e6;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git cargo.bbclass: Use --frozen flag for cargo operations It supersed the --offline flag and guarantee that Cargo.lock file will not be modified during the build. Signed-off-by: Frederic Martinsons Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 3ef0bbbb44e..8c0b92df8d3 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass @@ -39,7 +39,12 @@ MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" RUSTFLAGS ??= "" BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" -CARGO_BUILD_FLAGS = "-v --offline --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" +# --frozen flag will prevent network access (which is required since only +# the do_fetch step is authorized to access network) +# and will require an up to date Cargo.lock file. +# This force the package being built to already ship a Cargo.lock, in the end +# this is what we want, at least, for reproducibility of the build. +CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" # This is based on the content of CARGO_BUILD_FLAGS and generally will need to # change if CARGO_BUILD_FLAGS changes.