classes/ptest-cargo: use oe.path.join instead of os.path.join
PATCH 1/2 classes/ptest-cargo: use oe.path.join instead of os.path.join
Use oe.path.join() to avoid having to strip leading slashes.
Signed-off-by Ross Burton <[email protected]>
--- meta/classes-recipe/ptest-cargo.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/ptest-cargo.bbclass +1 -1
@@ -85,7 +85,7 @@ python do_install_ptest_cargo() { cargo_test_binaries_file = d.getVar('CARGO_TEST_BINARIES_FILES') rust_test_args = d.getVar('RUST_TEST_ARGS') or "" - ptest_dir = os.path.join(dest_dir, ptest_path.lstrip('/')) + ptest_dir = oe.path.join(dest_dir, ptest_path) os.makedirs(ptest_dir, exist_ok=True) test_bins = []
Signature · 1 line
2.43.0
PATCH 2/2 classes/ptest-cargo: add explanatory comment
Add a comment to avoid someone else in the future wasting their time by having the the idea of stripping the cargo hash from the test binary filenames.
Some packages, notably librsvg, build multiple tests with the same base name that are differentiated by the hash:
primitives-3fd9d71b0a55e20a
reference-00d9b406d910a645
render_crash-c88a2b880ba97e09
rsvg_convert-b43bd2236753f43d
rsvg_convert-eef250e6c0174413
rsvg_convert-f70976dd6cda88b0
rsvg-eec8e799568381a3
Signed-off-by Ross Burton <[email protected]>
--- meta/classes-recipe/ptest-cargo.bbclass | 2 ++ 1 file changed, 2 insertions(+)
meta/classes-recipe/ptest-cargo.bbclass +2 -0
@@ -95,6 +95,8 @@ python do_install_ptest_cargo() { test_paths = [] for test_bin in test_bins: + # Note that we can't strip the hash from the filename as some packages + # (eg librsvg) have multiple binaries with the same prefix. shutil.copy2(test_bin, ptest_dir) test_paths.append(os.path.join(ptest_path, os.path.basename(test_bin)))
Signature · 1 line
2.43.0