zstd: fix host headers installation
PATCH 1/2 zstd: fix host headers installation
If host-zstd builds when $(HOST_DIR)/include has not been created yet, the install-includes target does not create this directory. Instead, the install command copies the headers over $(HOST_DIR)/include, thus creating a regular file instead of a directory. This leads to the following installation failure:
Installing includes
install: cannot create directory ?.../host/usr/include/?: File exists Makefile:166: recipe for target 'install-pc' failed make[1]: *** [install-pc] Error 1
Add a patch to fix that.
--- ...ate-include-directory-before-headers.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 package/zstd/0002-lib-Makefile-create-include-directory-before-headers.patch
package/zstd/0002-lib-Makefile-create-include-directory-before-headers.patch new file +45 -0
@@ -0,0 +1,45 @@ +From 9a0643b633c00e86db059e3790bdea7155fb6dc9 Mon Sep 17 00:00:00 2001 +From: Baruch Siach <[email protected]> +Date: Tue, 8 May 2018 20:43:28 +0300 +Subject: [PATCH] lib/Makefile: create include directory before headers + installation + +Make sure that $(INCLUDEDIR) exists before copying the headers there. +Otherwise, the contest of header files is copied over +$(DESTDIR)$(INCLUDEDIR), making it a regular file. + +While at it, remove $(DESTDIR)$(INCLUDEDIR) from the list of directories +to create in the install-pc target. The install-pc target does not need +this directory. + +Signed-off-by: Baruch Siach <[email protected]> +--- +Upstream status: https://github.com/facebook/zstd/pull/1123 + + lib/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/Makefile b/lib/Makefile +index f64f192d4724..d8178c7a58a0 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -163,7 +163,7 @@ install: install-pc install-static install-shared install-includes + @echo zstd static and shared library installed + + install-pc: libzstd.pc +- @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ $(DESTDIR)$(INCLUDEDIR)/ ++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ + @$(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/ + + install-static: libzstd.a +@@ -178,6 +178,7 @@ install-shared: libzstd + + install-includes: + @echo Installing includes ++ @$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/ + @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR) + @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR) + @$(INSTALL_DATA) deprecated/zbuff.h $(DESTDIR)$(INCLUDEDIR) # prototypes generate deprecation warnings +-- +2.17.0 +
Signature · 1 line
2.17.0
PATCH 2/2 zstd: bump to version 1.3.4
--- package/zstd/zstd.hash | 2 +- package/zstd/zstd.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
package/zstd/zstd.hash +1 -1
@@ -1,5 +1,5 @@ # Locally computed -sha256 a77c47153ee7de02626c5b2a097005786b71688be61e9fb81806a011f90b297b zstd-v1.3.3.tar.gz +sha256 92e41b6e8dd26bbd46248e8aa1d86f1551bc221a796277ae9362954f26d605a9 zstd-v1.3.4.tar.gz # License files (locally computed as well) sha256 2c1a7fa704df8f3a606f6fc010b8b5aaebf403f3aeec339a12048f1ba7331a0b LICENSE
package/zstd/zstd.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -ZSTD_VERSION = v1.3.3 +ZSTD_VERSION = v1.3.4 ZSTD_SITE = $(call github,facebook,zstd,$(ZSTD_VERSION)) ZSTD_INSTALL_STAGING = YES ZSTD_LICENSE = BSD-3-Clause or GPL-2.0
Signature · 1 line
2.17.0
PATCH 2/2 zstd: bump to version 1.3.4
Hello Baruch,
Quoted 23 lines · Baruch Siach
Cc Andrey Smirnov <[email protected]>Signed-off-by Baruch Siach <[email protected]>--- package/zstd/zstd.hash | 2 +- package/zstd/zstd.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)package/zstd/zstd.hash +1
-1@@ -1,5 +1,5 @@ # Locally computed -sha256 a77c47153ee7de02626c5b2a097005786b71688be61e9fb81806a011f90b297b zstd-v1.3.3.tar.gz +sha256 92e41b6e8dd26bbd46248e8aa1d86f1551bc221a796277ae9362954f26d605a9 zstd-v1.3.4.tar.gz # License files (locally computed as well) sha256 2c1a7fa704df8f3a606f6fc010b8b5aaebf403f3aeec339a12048f1ba7331a0b LICENSEpackage/zstd/zstd.mk +0
-0
package/zstd/zstd.mk line 10
Quoted 8 lines
package/zstd/zstd.mk +1
-1@@ -4,7 +4,7 @@ # ################################################################################ -ZSTD_VERSION = v1.3.3 +ZSTD_VERSION = v1.3.4 ZSTD_SITE = $(call github,facebook,zstd,$(ZSTD_VERSION)) ZSTD_INSTALL_STAGING = YES ZSTD_LICENSE = BSD-3-Clause or GPL-2.0
Regards,
Peter
Thomas Petazzoni
AppliedPATCH 2/2 zstd: bump to version 1.3.4
In reply to Baruch SiachHello,
Quoted 6 lines · Baruch Siach
Cc Andrey Smirnov <[email protected]>Signed-off-by Baruch Siach <[email protected]>--- package/zstd/zstd.hash | 2 +- package/zstd/zstd.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/2 zstd: fix host headers installation
In reply to Baruch SiachHello Baruch,
Quoted 62 lines · Baruch Siach
If host-zstd builds when $(HOST_DIR)/include has not been created yet, the install-includes target does not create this directory. Instead, the install command copies the headers over $(HOST_DIR)/include, thus creating a regular file instead of a directory. This leads to the following installation failure:
Installing includes
install: cannot create directory ?.../host/usr/include/?: File exists Makefile:166: recipe for target 'install-pc' failed make[1]: *** [install-pc] Error 1Add a patch to fix that.
Cc Peter Seiderer <[email protected]>Cc Andrey Smirnov <[email protected]>Signed-off-by Baruch Siach <[email protected]>--- ...ate-include-directory-before-headers.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+)run_test_pkg_libtsm.sh create mode 100644 package/zstd/0002-lib-Makefile-create-include-directory-before-headers.patchpackage/zstd/0002-lib-Makefile-create-include-directory-before-headers.patch new file +35
-0@@ -0,0 +1,45 @@ +From 9a0643b633c00e86db059e3790bdea7155fb6dc9 Mon Sep 17 00:00:00 2001 +From: Baruch Siach <[email protected]> +Date: Tue, 8 May 2018 20:43:28 +0300 +Subject: [PATCH] lib/Makefile: create include directory before headers + installation + +Make sure that $(INCLUDEDIR) exists before copying the headers there. +Otherwise, the contest of header files is copied over +$(DESTDIR)$(INCLUDEDIR), making it a regular file. + +While at it, remove $(DESTDIR)$(INCLUDEDIR) from the list of directories +to create in the install-pc target. The install-pc target does not need +this directory. + +Signed-off-by: Baruch Siach <[email protected]> +--- +Upstream status: https://github.com/facebook/zstd/pull/1123 +run_test_pkg_libtsm.sh + lib/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/Makefile b/lib/Makefile +index f64f192d4724..d8178c7a58a0 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -163,7 +163,7 @@ install: install-pc install-static install-shared install-includes + @echo zstd static and shared library installed + + install-pc: libzstd.pc +- @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ $(DESTDIR)$(INCLUDEDIR)/ ++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ + @$(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/ + + install-static: libzstd.a +@@ -178,6 +178,7 @@ install-shared: libzstd
package/zstd/0002-lib-Makefile-create-include-directory-before-headers.patch line 45
Quoted 10 lines
package/zstd/0002-lib-Makefile-create-include-directory-before-headers.patch new file +10
-0+ + install-includes: + @echo Installing includes ++ @$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/ + @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR) + @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR) + @$(INSTALL_DATA) deprecated/zbuff.h $(DESTDIR)$(INCLUDEDIR) # prototypes generate deprecation warnings +-- +2.17.0 +
Thanks for catching this (a follow up patch or a v2 version doing the same for the libs as suggested on the upstream pull request would be nice), neverless:
Regards,
Peter
PATCH 1/2 zstd: fix host headers installation
In reply to Baruch SiachBaruch, All,
On 2018-05-08 21:26 +0300, Baruch Siach spake thusly:
Quoted 6 lines
If host-zstd builds when $(HOST_DIR)/include has not been created yet, the install-includes target does not create this directory. Instead, the install command copies the headers over $(HOST_DIR)/include, thus creating a regular file instead of a directory. This leads to the following installation failure:
Quoted 6 lines
Installing includes
install: cannot create directory ?.../host/usr/include/?: File exists Makefile:166: recipe for target 'install-pc' failed make[1]: *** [install-pc] Error 1Add a patch to fix that.
I'm OK that we fix zstd and send them the patch.
However, for the target/staging skeleton, we explcitly create the include directory:
https://git.buildroot.org/buildroot/tree/package/skeleton-init-common/skeleton-init-common.mk#n34
Why don't we do the same for the host skeleton too?
Regards,
Yann E. MORIN.
Quoted 66 lines
Cc Peter Seiderer <[email protected]>Cc Andrey Smirnov <[email protected]>Signed-off-by Baruch Siach <[email protected]>--- ...ate-include-directory-before-headers.patch | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 package/zstd/0002-lib-Makefile-create-include-directory-before-headers.patchpackage/zstd/0002-lib-Makefile-create-include-directory-before-headers.patch new file +45
-0@@ -0,0 +1,45 @@ +From 9a0643b633c00e86db059e3790bdea7155fb6dc9 Mon Sep 17 00:00:00 2001 +From: Baruch Siach <[email protected]> +Date: Tue, 8 May 2018 20:43:28 +0300 +Subject: [PATCH] lib/Makefile: create include directory before headers + installation + +Make sure that $(INCLUDEDIR) exists before copying the headers there. +Otherwise, the contest of header files is copied over +$(DESTDIR)$(INCLUDEDIR), making it a regular file. + +While at it, remove $(DESTDIR)$(INCLUDEDIR) from the list of directories +to create in the install-pc target. The install-pc target does not need +this directory. + +Signed-off-by: Baruch Siach <[email protected]> +--- +Upstream status: https://github.com/facebook/zstd/pull/1123 + + lib/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/Makefile b/lib/Makefile +index f64f192d4724..d8178c7a58a0 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -163,7 +163,7 @@ install: install-pc install-static install-shared install-includes + @echo zstd static and shared library installed + + install-pc: libzstd.pc +- @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ $(DESTDIR)$(INCLUDEDIR)/ ++ @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ + @$(INSTALL_DATA) libzstd.pc $(DESTDIR)$(PKGCONFIGDIR)/ + + install-static: libzstd.a +@@ -178,6 +178,7 @@ install-shared: libzstd + + install-includes: + @echo Installing includes ++ @$(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/ + @$(INSTALL_DATA) zstd.h $(DESTDIR)$(INCLUDEDIR) + @$(INSTALL_DATA) common/zstd_errors.h $(DESTDIR)$(INCLUDEDIR) + @$(INSTALL_DATA) deprecated/zbuff.h $(DESTDIR)$(INCLUDEDIR) # prototypes generate deprecation warnings +-- +2.17.0 +Signature · 6 lines
2.17.0 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'