diff options
| author | Peter Marko <peter.marko@siemens.com> | 2024-06-25 21:36:45 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-07-12 05:47:20 -0700 |
| commit | 27448a7af66de9da19e4ad08dfddd5ba23a0d677 (patch) | |
| tree | 197b0430d75e08020612cd829f711f996e3a743d | |
| parent | 219e85cc07a8d7d6d0c01f6d9e88eb658be6899b (diff) | |
| download | poky-27448a7af66de9da19e4ad08dfddd5ba23a0d677.tar.gz | |
cargo: remove True option to getVar calls
Layer cleanup similar to
https://git.openembedded.org/openembedded-core/commit/?id=26c74fd10614582e177437608908eb43688ab510
(From OE-Core rev: f419d57e9605dc5430df6828c4b618265db1243f)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9a2ed52473a3e4eb662509824ef8e59520ebdefb)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/classes-recipe/cargo_common.bbclass | 4 | ||||
| -rw-r--r-- | meta/classes-recipe/ptest-cargo.bbclass | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 0fb443edbd..19c497b8d6 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass | |||
| @@ -41,7 +41,7 @@ CARGO_SRC_DIR ??= "" | |||
| 41 | CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" | 41 | CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" |
| 42 | 42 | ||
| 43 | # Path to Cargo.lock | 43 | # Path to Cargo.lock |
| 44 | CARGO_LOCK_PATH ??= "${@ os.path.join(os.path.dirname(d.getVar('CARGO_MANIFEST_PATH', True)), 'Cargo.lock')}" | 44 | CARGO_LOCK_PATH ??= "${@ os.path.join(os.path.dirname(d.getVar('CARGO_MANIFEST_PATH')), 'Cargo.lock')}" |
| 45 | 45 | ||
| 46 | CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}" | 46 | CARGO_RUST_TARGET_CCLD ??= "${RUST_TARGET_CCLD}" |
| 47 | cargo_common_do_configure () { | 47 | cargo_common_do_configure () { |
| @@ -171,7 +171,7 @@ python cargo_common_do_patch_paths() { | |||
| 171 | # here is better than letting cargo tell (in case the file is missing) | 171 | # here is better than letting cargo tell (in case the file is missing) |
| 172 | # "Cargo.lock should be modified but --frozen was given" | 172 | # "Cargo.lock should be modified but --frozen was given" |
| 173 | 173 | ||
| 174 | lockfile = d.getVar("CARGO_LOCK_PATH", True) | 174 | lockfile = d.getVar("CARGO_LOCK_PATH") |
| 175 | if not os.path.exists(lockfile): | 175 | if not os.path.exists(lockfile): |
| 176 | bb.fatal(f"{lockfile} file doesn't exist") | 176 | bb.fatal(f"{lockfile} file doesn't exist") |
| 177 | 177 | ||
diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass index c46df362bf..fd1df9d7c9 100644 --- a/meta/classes-recipe/ptest-cargo.bbclass +++ b/meta/classes-recipe/ptest-cargo.bbclass | |||
| @@ -12,10 +12,10 @@ python do_compile_ptest_cargo() { | |||
| 12 | import subprocess | 12 | import subprocess |
| 13 | import json | 13 | import json |
| 14 | 14 | ||
| 15 | cargo = bb.utils.which(d.getVar("PATH"), d.getVar("CARGO", True)) | 15 | cargo = bb.utils.which(d.getVar("PATH"), d.getVar("CARGO")) |
| 16 | cargo_build_flags = d.getVar("CARGO_BUILD_FLAGS", True) | 16 | cargo_build_flags = d.getVar("CARGO_BUILD_FLAGS") |
| 17 | rust_flags = d.getVar("RUSTFLAGS", True) | 17 | rust_flags = d.getVar("RUSTFLAGS") |
| 18 | manifest_path = d.getVar("CARGO_MANIFEST_PATH", True) | 18 | manifest_path = d.getVar("CARGO_MANIFEST_PATH") |
| 19 | project_manifest_path = os.path.normpath(manifest_path) | 19 | project_manifest_path = os.path.normpath(manifest_path) |
| 20 | manifest_dir = os.path.dirname(manifest_path) | 20 | manifest_dir = os.path.dirname(manifest_path) |
| 21 | 21 | ||
| @@ -66,7 +66,7 @@ python do_compile_ptest_cargo() { | |||
| 66 | if not test_bins: | 66 | if not test_bins: |
| 67 | bb.fatal("Unable to find any test binaries") | 67 | bb.fatal("Unable to find any test binaries") |
| 68 | 68 | ||
| 69 | cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES', True) | 69 | cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES') |
| 70 | bb.note(f"Found {len(test_bins)} tests, write their paths into {cargo_test_binaries_file}") | 70 | bb.note(f"Found {len(test_bins)} tests, write their paths into {cargo_test_binaries_file}") |
| 71 | with open(cargo_test_binaries_file, "w") as f: | 71 | with open(cargo_test_binaries_file, "w") as f: |
| 72 | for test_bin in test_bins: | 72 | for test_bin in test_bins: |
| @@ -77,10 +77,10 @@ python do_compile_ptest_cargo() { | |||
| 77 | python do_install_ptest_cargo() { | 77 | python do_install_ptest_cargo() { |
| 78 | import shutil | 78 | import shutil |
| 79 | 79 | ||
| 80 | dest_dir = d.getVar("D", True) | 80 | dest_dir = d.getVar("D") |
| 81 | pn = d.getVar("PN", True) | 81 | pn = d.getVar("PN") |
| 82 | ptest_path = d.getVar("PTEST_PATH", True) | 82 | ptest_path = d.getVar("PTEST_PATH") |
| 83 | cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES', True) | 83 | cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES') |
| 84 | rust_test_args = d.getVar('RUST_TEST_ARGS') or "" | 84 | rust_test_args = d.getVar('RUST_TEST_ARGS') or "" |
| 85 | 85 | ||
| 86 | ptest_dir = os.path.join(dest_dir, ptest_path.lstrip('/')) | 86 | ptest_dir = os.path.join(dest_dir, ptest_path.lstrip('/')) |
