Openembedded Core Discussions
 help / color / mirror / Atom feed
* [OE-Core][PATCH 1/3] cargo: Rename MANIFEST_PATH -> CARGO_MANIFEST_PATH
@ 2023-12-07 13:39 Alex Kiernan
  2023-12-07 13:39 ` [OE-Core][PATCH 2/3] cargo: Move CARGO_MANIFEST_PATH/CARGO_SRC_DIR to cargo_common Alex Kiernan
  2023-12-07 13:39 ` [OE-Core][PATCH 3/3] cargo: Add CARGO_LOCK_PATH for path to Cargo.lock Alex Kiernan
  0 siblings, 2 replies; 8+ messages in thread
From: Alex Kiernan @ 2023-12-07 13:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kiernan

This variable is a piece of recipe configurable interface, scope it with
the class name to make that clear.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

 meta/classes-recipe/cargo.bbclass        | 4 ++--
 meta/classes-recipe/cargo_common.bbclass | 2 +-
 meta/classes-recipe/ptest-cargo.bbclass  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass
index 8c0b92df8d33..96a74e2ef1ec 100644
--- a/meta/classes-recipe/cargo.bbclass
+++ b/meta/classes-recipe/cargo.bbclass
@@ -35,7 +35,7 @@ export RUST_BACKTRACE = "1"
 CARGO_SRC_DIR ??= ""
 
 # The actual path to the Cargo.toml
-MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
+CARGO_MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
 
 RUSTFLAGS ??= ""
 BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
@@ -44,7 +44,7 @@ BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
 # 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}"
+CARGO_BUILD_FLAGS = "-v --frozen --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${CARGO_MANIFEST_PATH}"
 
 # This is based on the content of CARGO_BUILD_FLAGS and generally will need to
 # change if CARGO_BUILD_FLAGS changes.
diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass
index b732a1bd9538..bf298e96c745 100644
--- a/meta/classes-recipe/cargo_common.bbclass
+++ b/meta/classes-recipe/cargo_common.bbclass
@@ -161,7 +161,7 @@ python cargo_common_do_patch_paths() {
     # here is better than letting cargo tell (in case the file is missing)
     # "Cargo.lock should be modified but --frozen was given"
 
-    manifest_path = d.getVar("MANIFEST_PATH", True)
+    manifest_path = d.getVar("CARGO_MANIFEST_PATH", True)
     lockfile = os.path.join(os.path.dirname(manifest_path), "Cargo.lock")
     if not os.path.exists(lockfile):
         bb.fatal(f"{lockfile} file doesn't exist")
diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass
index ff57be852508..c46df362bfee 100644
--- a/meta/classes-recipe/ptest-cargo.bbclass
+++ b/meta/classes-recipe/ptest-cargo.bbclass
@@ -15,7 +15,7 @@ python do_compile_ptest_cargo() {
     cargo = bb.utils.which(d.getVar("PATH"), d.getVar("CARGO", True))
     cargo_build_flags = d.getVar("CARGO_BUILD_FLAGS", True)
     rust_flags = d.getVar("RUSTFLAGS", True)
-    manifest_path = d.getVar("MANIFEST_PATH", True)
+    manifest_path = d.getVar("CARGO_MANIFEST_PATH", True)
     project_manifest_path = os.path.normpath(manifest_path)
     manifest_dir = os.path.dirname(manifest_path)
 
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-08  8:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 13:39 [OE-Core][PATCH 1/3] cargo: Rename MANIFEST_PATH -> CARGO_MANIFEST_PATH Alex Kiernan
2023-12-07 13:39 ` [OE-Core][PATCH 2/3] cargo: Move CARGO_MANIFEST_PATH/CARGO_SRC_DIR to cargo_common Alex Kiernan
2023-12-07 22:39   ` Richard Purdie
2023-12-08  8:15     ` Alex Kiernan
2023-12-08  8:28       ` Richard Purdie
     [not found]     ` <179ECD325A85AE45.16398@lists.openembedded.org>
2023-12-08  8:23       ` Alex Kiernan
2023-12-08  8:30         ` Richard Purdie
2023-12-07 13:39 ` [OE-Core][PATCH 3/3] cargo: Add CARGO_LOCK_PATH for path to Cargo.lock Alex Kiernan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox