[RFC,v2,1/1] package/pkg-download: don't export the download command variables

Message ID 20250213180908.3963679-1-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [RFC,v2,1/1] package/pkg-download: don't export the download command variables
Related show

Commit Message

Dario Binacchi Feb. 13, 2025, 6:09 p.m. UTC
Exporting the download variables can cause unfortunate name clashes, as
occurred with the SCP variable used by Binman for compiling U-Boot [1].
Do not globally export the package download commands anymore; instead,
pass them to the dl-wrapper environment.

[1] https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/T/
Cc: Julien Olivain <ju.o@free.fr>
Suggested-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

Changes v1 -> v2:
- Drop the -C option

 package/pkg-download.mk | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

Comments

Julien Olivain Feb. 13, 2025, 9:23 p.m. UTC | #1
Hi Dario, All,

On 13/02/2025 19:09, Dario Binacchi wrote:
> Exporting the download variables can cause unfortunate name clashes, as
> occurred with the SCP variable used by Binman for compiling U-Boot [1].
> Do not globally export the package download commands anymore; instead,
> pass them to the dl-wrapper environment.
> 
> [1] 
> https://lore.kernel.org/buildroot/a023971c7c8bfa4826a9a8721500c7ff@free.fr/T/
> Cc: Julien Olivain <ju.o@free.fr>
> Suggested-by: Peter Korsgaard <peter@korsgaard.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

I applied the patch to master. I did few minor changes, see:
https://gitlab.com/buildroot.org/buildroot/-/commit/56cc6fa2c71eff27efcb66d60f254da04439ac18

Thank you for your patience and perseverance!

Best regards,

Julien.

To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.

Patch

diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index ca01ff67a59e..20173805c60e 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -7,16 +7,6 @@ 
 #
 ################################################################################
 
-# Download method commands
-export CURL := $(call qstrip,$(BR2_CURL))
-export WGET := $(call qstrip,$(BR2_WGET))
-export SVN := $(call qstrip,$(BR2_SVN))
-export CVS := $(call qstrip,$(BR2_CVS))
-export BZR := $(call qstrip,$(BR2_BZR))
-export GIT := $(call qstrip,$(BR2_GIT))
-export HG := $(call qstrip,$(BR2_HG))
-export SCP := $(call qstrip,$(BR2_SCP))
-export SFTP := $(call qstrip,$(BR2_SFTP))
 export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES))
 
 # Version of the format of the archives we generate in the corresponding
@@ -118,6 +108,15 @@  define DOWNLOAD
 	$(Q)$(DOWNLOAD_SET_UMASK) $(EXTRA_ENV) \
 	$($(PKG)_DL_ENV) \
 	TAR="$(TAR)" \
+	CURL="$(call qstrip,$(BR2_CURL))" \
+	WGET="$(call qstrip,$(BR2_WGET))" \
+	SVN="$(call qstrip,$(BR2_SVN))" \
+	CVS="$(call qstrip,$(BR2_CVS))" \
+	BZR="$(call qstrip,$(BR2_BZR))" \
+	GIT="$(call qstrip,$(BR2_GIT))" \
+	HG="$(call qstrip,$(BR2_HG))" \
+	SCP="$(call qstrip,$(BR2_SCP))" \
+	SFTP="$(call qstrip,$(BR2_SFTP))" \
 	BR_NO_CHECK_HASH_FOR="$(if $(BR2_DOWNLOAD_FORCE_CHECK_HASHES),,$(BR_NO_CHECK_HASH_FOR))" \
 		flock $($(PKG)_DL_DIR)/.lock $(DL_WRAPPER) \
 		-c '$($(PKG)_DL_VERSION)' \