Skip to contentSkip to conversation

support/dependencies: always run check-host-tar.mk first

PATCH New Max Filippov 2 participants 3 messages Oct 24, 2017 – Oct 25, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/dependencies: always run check-host-tar.mk first

In case both host lzip and tar are not suitable the buildroot build fails with the following error:

Quoted 1 line
Quoted 1 line
Quoted 1 line

host-lzip 1.19 Extracting

gzip -d -c dl/lzip-1.19.tar.gz | host/bin/tar --strip-components=1 -C

    build/host-lzip-1.19 -xf -

/bin/sh: host/bin/tar: No such file or directory

Make sure that if the tar dependency is present it is always the first one in the DEPENDENCIES_HOST_PREREQ.

---
 support/dependencies/dependencies.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
support/dependencies/dependencies.mk +6 -1
index ef2ae9b7e158..4e8528b91f05 100644
@@ -12,7 +12,12 @@
 define suitable-host-package
 $(shell support/dependencies/check-host-$(1).sh $(2))
 endef
--include $(sort $(wildcard support/dependencies/check-host-*.mk))
+
+# Make sure that if the tar dependency is present it is always the first one in
+# the DEPENDENCIES_HOST_PREREQ, otherwise sources for other dependencies will
+# fail to unpack.
+-include support/dependencies/check-host-tar.mk
+-include $(sort $(filter-out %/check-host-tar.mk,$(wildcard support/dependencies/check-host-*.mk)))
 
 ifeq ($(BR2_CCACHE),y)
 DEPENDENCIES_HOST_PREREQ += host-ccache
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 support/dependencies: always run check-host-tar.mk first

Hi Max,

Quoted 7 lines · Max Filippov

In case both host lzip and tar are not suitable the buildroot build fails with the following error:

Quoted 1 line
Quoted 1 line
Quoted 1 line

host-lzip 1.19 Extracting

gzip -d -c dl/lzip-1.19.tar.gz | host/bin/tar --strip-components=1 -C

    build/host-lzip-1.19 -xf -

/bin/sh: host/bin/tar: No such file or directory

Good catch! We really should have an autobuilder without suitable tar to
capture this kind of issue.

Quoted 2 lines

Make sure that if the tar dependency is present it is always the first one in the DEPENDENCIES_HOST_PREREQ.

However, this is not a proper solution. It will break with top-level parallel
build and it just looks hackish.

The proper way to do it is to add a dependency on host-tar to all the other
host-prereq packages. But that also doesn't scale well... I have to think a bit more about a good solution, but I wanted to flag the issue already.

One thing I though about is to put something like

$(filter-out host-tar,$(DEPENDENCIES_HOST_PREREQ)): host-tar

in check-host-tar.mk, but that only works if check-host-tar.mk is the *last* one to add anything to DEPENDENCIES_HOST_PREREQ...

Regards,
Arnout

Quoted 25 lines
---
 support/dependencies/dependencies.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
support/dependencies/dependencies.mk +6 -1
index ef2ae9b7e158..4e8528b91f05 100644
@@ -12,7 +12,12 @@
 define suitable-host-package
 $(shell support/dependencies/check-host-$(1).sh $(2))
 endef
--include $(sort $(wildcard support/dependencies/check-host-*.mk))
+
+# Make sure that if the tar dependency is present it is always the first one in
+# the DEPENDENCIES_HOST_PREREQ, otherwise sources for other dependencies will
+# fail to unpack.
+-include support/dependencies/check-host-tar.mk
+-include $(sort $(filter-out %/check-host-tar.mk,$(wildcard support/dependencies/check-host-*.mk)))
 
 ifeq ($(BR2_CCACHE),y)
 DEPENDENCIES_HOST_PREREQ += host-ccache
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 support/dependencies: always run check-host-tar.mk first

Hi Arnout,

Quoted 6 lines · Arnout Vandecappelle
Quoted 2 lines · Max Filippov

Make sure that if the tar dependency is present it is always the first one in the DEPENDENCIES_HOST_PREREQ.

However, this is not a proper solution. It will break with top-level parallel
build and it just looks hackish.

Oh, you're right.

Quoted 10 lines

The proper way to do it is to add a dependency on host-tar to all the other
host-prereq packages. But that also doesn't scale well... I have to think a bit more about a good solution, but I wanted to flag the issue already.

One thing I though about is to put something like

$(filter-out host-tar,$(DEPENDENCIES_HOST_PREREQ)): host-tar

in check-host-tar.mk, but that only works if check-host-tar.mk is the *last* one to add anything to DEPENDENCIES_HOST_PREREQ...

Maybe we should treat check-host-tar.mk differently, rename it, make sure it's included last and adds that dependency correctly?

Signature · 2 lines
Thanks.
-- Max