diff mbox series

[1/5,v3] package/pkg-cargo: allow packages to define download environment

Message ID 19116_1644506970_62052F5A_19116_77_1_cb2a6466cea018c4bf8b8877140a9f389bb7918f.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, the cargo infrastructure forcibly sets the package _DL_ENV
variable, instead of appending to it, which prevents packages from
providing their own download environment variables.

We fix that by using an append-assignment.

Note: when introduced, that variable was explicitly not documented, and
is supposed to only be used by packages infrastructures. However, that
variable exists, and it can be (ab)used by br2-external packages (most
probably to ill effects, but heh!). We anyway leave it undocumented,
like _ROOTFS_PRE_CMD_HOOKS.

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

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

 > From: "Yann E. MORIN" <yann.morin@orange.com>
 > Currently, the cargo infrastructure forcibly sets the package _DL_ENV
 > variable, instead of appending to it, which prevents packages from
 > providing their own download environment variables.

 > We fix that by using an append-assignment.

 > Note: when introduced, that variable was explicitly not documented, and
 > is supposed to only be used by packages infrastructures. However, that
 > variable exists, and it can be (ab)used by br2-external packages (most
 > probably to ill effects, but heh!). We anyway leave it undocumented,
 > like _ROOTFS_PRE_CMD_HOOKS.

 > 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 e74a8358bc..66bea513e0 100644
--- a/package/pkg-cargo.mk
+++ b/package/pkg-cargo.mk
@@ -69,7 +69,7 @@  define inner-cargo-package
 $(2)_DOWNLOAD_DEPENDENCIES += host-rustc
 
 $(2)_DOWNLOAD_POST_PROCESS = cargo
-$(2)_DL_ENV = CARGO_HOME=$$(HOST_DIR)/share/cargo
+$(2)_DL_ENV += CARGO_HOME=$$(HOST_DIR)/share/cargo
 
 # Due to vendoring, it is pretty likely that not all licenses are
 # listed in <pkg>_LICENSE.