diff mbox series

[3/5,v3] package/pkg-cargo: host-rustc is also a build dependency

Message ID 11363_1644506973_62052F5D_11363_173_9_da4c09036712600e0ab76db801a5a5c693bfa267.1644506959.git.yann.morin@orange.com
State Accepted
Headers show
Series [1/5,v3] package/pkg-cargo: allow packages to define download environment | expand

Commit Message

Yann E. MORIN Feb. 10, 2022, 3:29 p.m. UTC
From: "Yann E. MORIN" <yann.morin@orange.com>

Currently, host-rustc is a download dependency, because we need cargo
for the vendoring during the download step.

However, when using a package in override-srcdir, there is no download
step, so host-rustc is not pulled in as a dependency which breaks
running the build of a single package from scratch:
    $ make clean
    $ make my-rust-package
    [...]
    [...] cargo build --offline --release --manifest-path Cargo.toml --locked
    /bin/sh: cargo: command not found

We fix that by adding host-rustc as a standard dependency too.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/pkg-cargo.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Peter Korsgaard March 7, 2022, 9:07 p.m. UTC | #1
>>>>>   <yann.morin@orange.com> writes:

 > From: "Yann E. MORIN" <yann.morin@orange.com>
 > Currently, host-rustc is a download dependency, because we need cargo
 > for the vendoring during the download step.

 > However, when using a package in override-srcdir, there is no download
 > step, so host-rustc is not pulled in as a dependency which breaks
 > running the build of a single package from scratch:
 >     $ make clean
 >     $ make my-rust-package
 >     [...]
 >     [...] cargo build --offline --release --manifest-path Cargo.toml --locked
 >     /bin/sh: cargo: command not found

 > We fix that by adding host-rustc as a standard dependency too.

 > Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
 > Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 > Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed, thanks.
diff mbox series

Patch

diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
index 8b246abfed..6f5125f1d4 100644
--- a/package/pkg-cargo.mk
+++ b/package/pkg-cargo.mk
@@ -65,8 +65,10 @@  HOST_PKG_CARGO_ENV = \
 
 define inner-cargo-package
 
-# We need host-rustc to run cargo
+# We need host-rustc to run cargo at download time (for vendoring),
+# and at build and install time.
 $(2)_DOWNLOAD_DEPENDENCIES += host-rustc
+$(2)_DEPENDENCIES += host-rustc
 
 $(2)_DOWNLOAD_POST_PROCESS = cargo
 $(2)_DL_ENV += CARGO_HOME=$$(HOST_DIR)/share/cargo