diff options
-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 78440c810b..2386cc3d77 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('/')) |