diff options
author | Frederic Martinsons <frederic.martinsons@gmail.com> | 2023-08-02 15:16:03 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-09 13:22:00 +0100 |
commit | d4c14304c92d76a2bdb612ffa3ca3477cd06cb6e (patch) | |
tree | 26faa6988732dd4907ec06d1cdcfeb82b8f889c6 /meta/classes-recipe/cargo.bbclass | |
parent | 5020abf3424350bb9fda4bf5477360d996f2d730 (diff) | |
download | poky-d4c14304c92d76a2bdb612ffa3ca3477cd06cb6e.tar.gz |
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.
(From OE-Core rev: 9ff9e6523bd7eb6cdc854adcbd031085c536e0e6)
Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/cargo.bbclass')
-rw-r--r-- | meta/classes-recipe/cargo.bbclass | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 3ef0bbbb44..8c0b92df8d 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" | |||
39 | 39 | ||
40 | RUSTFLAGS ??= "" | 40 | RUSTFLAGS ??= "" |
41 | BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" | 41 | BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" |
42 | CARGO_BUILD_FLAGS = "-v --offline --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" | 42 | # --frozen flag will prevent network access (which is required since only |
43 | # the do_fetch step is authorized to access network) | ||
44 | # and will require an up to date Cargo.lock file. | ||
45 | # This force the package being built to already ship a Cargo.lock, in the end | ||
46 | # this is what we want, at least, for reproducibility of the build. | ||
47 | CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" | ||
43 | 48 | ||
44 | # This is based on the content of CARGO_BUILD_FLAGS and generally will need to | 49 | # This is based on the content of CARGO_BUILD_FLAGS and generally will need to |
45 | # change if CARGO_BUILD_FLAGS changes. | 50 | # change if CARGO_BUILD_FLAGS changes. |