All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][V3 1/5] bitbake: add file-native to ASSUME_PROVIDED
@ 2015-10-20 21:33 Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 2/5] sanity: check that the host has file installed Ross Burton
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ross Burton @ 2015-10-20 21:33 UTC (permalink / raw)
  To: openembedded-core

Various key parts of the core classes (for example, do_package and
do_populate_sysroot) currently require file.  As it's not possible to build a
file-native without invoking do_populate_sysroot mark file-native as
ASSUME_PROVIDED and expect to use the host's binary.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/conf/bitbake.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9ddd1c0..06971da 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -166,6 +166,7 @@ DATETIME = "${DATE}${TIME}"
 ASSUME_PROVIDED = "\
     bzip2-native \
     chrpath-native \
+    file-native \
     git-native \
     grep-native \
     diffstat-native \
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH][V3 2/5] sanity: check that the host has file installed
  2015-10-20 21:33 [PATCH][V3 1/5] bitbake: add file-native to ASSUME_PROVIDED Ross Burton
@ 2015-10-20 21:33 ` Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 3/5] file: don't replace host file when built natively Ross Burton
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2015-10-20 21:33 UTC (permalink / raw)
  To: openembedded-core

Now that file-native is ASSUME_PROVIDED, check that it's actually present.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/sanity.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index d0b5cd0..ae86d26 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -3,7 +3,7 @@
 #
 
 SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \
-    gzip gawk chrpath wget cpio perl"
+    gzip gawk chrpath wget cpio perl file"
 
 def bblayers_conf_file(d):
     return os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf')
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH][V3 3/5] file: don't replace host file when built natively
  2015-10-20 21:33 [PATCH][V3 1/5] bitbake: add file-native to ASSUME_PROVIDED Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 2/5] sanity: check that the host has file installed Ross Burton
@ 2015-10-20 21:33 ` Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 4/5] rpm: add explicit dependency on file-replacement-native for native builds Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 5/5] subversion: " Ross Burton
  3 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2015-10-20 21:33 UTC (permalink / raw)
  To: openembedded-core

To avoid races over the file binaries being replaced mid-build we made
file-native an assume-provided binary and check for it at startup, but target
file still needs a native file binary of the same version to compile the magic
data.

The least invasive way of doing this is to build a native file don't put it on
PATH, and tell the target build where to find the native binary.  We do however
want the native libmagic to be installed normally (as for example rpm and
subversion need it) so we can't use NATIVE_PACKAGE_PATH_SUFFIX as that change
libdir.

[ YOCTO #8144 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-devtools/file/file/host-file.patch | 32 +++++++++++++++++++++++++
 meta/recipes-devtools/file/file_5.24.bb         | 10 +++++++-
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/file/file/host-file.patch

diff --git a/meta/recipes-devtools/file/file/host-file.patch b/meta/recipes-devtools/file/file/host-file.patch
new file mode 100644
index 0000000..a7efbdc
--- /dev/null
+++ b/meta/recipes-devtools/file/file/host-file.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Submitted (http://bugs.gw.com/view.php?id=485)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 3cde199d03b39632361c275cd30fa0612a03138b Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Mon, 19 Oct 2015 10:30:57 +0100
+Subject: [PATCH 2/2] When using the host file, respect FILE_COMPILE
+
+If we're cross-compiling and not using the file binary that was just built,
+execute the binary that we've been told to use (via FILE_COMPILE) when checking
+the version instead of assuming that "file" is correct as the actual compile
+uses FILE_COMPILE so different binaries may be used.
+---
+ magic/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/magic/Makefile.am b/magic/Makefile.am
+index 89ac844..67067fe 100644
+--- a/magic/Makefile.am
++++ b/magic/Makefile.am
+@@ -293,7 +293,7 @@ ${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
+ 	@(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
+ 	    echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
+ 	  else \
+-	    v=$$(file --version | sed -e s/file-// -e q); \
++	    v=$$(${FILE_COMPILE} --version | sed -e s/file-// -e q); \
+ 	    if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
+ 		echo "Cannot use the installed version of file ($$v) to"; \
+ 		echo "cross-compile file ${PACKAGE_VERSION}"; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/file/file_5.24.bb b/meta/recipes-devtools/file/file_5.24.bb
index 08b95d7..d04f121 100644
--- a/meta/recipes-devtools/file/file_5.24.bb
+++ b/meta/recipes-devtools/file/file_5.24.bb
@@ -8,12 +8,13 @@ SECTION = "console/utils"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=6a7382872edb68d33e1a9398b6e03188"
 
-DEPENDS = "zlib file-native"
+DEPENDS = "zlib file-replacement-native"
 DEPENDS_class-native = "zlib-native"
 
 SRC_URI = "git://github.com/file/file.git \
         file://debian-742262.patch \
         file://0001-Add-P-prompt-into-Usage-info.patch \
+        file://host-file.patch \
         "
 
 SRCREV = "3c0874be4d3232d672b20f513451a39cfd7c585a"
@@ -21,6 +22,9 @@ S = "${WORKDIR}/git"
 
 inherit autotools
 
+EXTRA_OEMAKE_append_class-target = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
+EXTRA_OEMAKE_append_class-nativesdk = "-e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
+
 FILES_${PN} += "${datadir}/misc/*.mgc"
 
 do_install_append_class-native() {
@@ -34,3 +38,7 @@ do_install_append_class-nativesdk() {
 }
 
 BBCLASSEXTEND = "native nativesdk"
+PROVIDES_append_class-native = " file-replacement-native"
+# Don't use NATIVE_PACKAGE_PATH_SUFFIX as that hides libmagic from anyone who
+# depends on file-replacement-native.
+bindir_append_class-native = "/file-native"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH][V3 4/5] rpm: add explicit dependency on file-replacement-native for native builds
  2015-10-20 21:33 [PATCH][V3 1/5] bitbake: add file-native to ASSUME_PROVIDED Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 2/5] sanity: check that the host has file installed Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 3/5] file: don't replace host file when built natively Ross Burton
@ 2015-10-20 21:33 ` Ross Burton
  2015-10-20 21:33 ` [PATCH][V3 5/5] subversion: " Ross Burton
  3 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2015-10-20 21:33 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-devtools/rpm/rpm_4.11.2.bb  | 1 +
 meta/recipes-devtools/rpm/rpm_5.4+cvs.bb | 1 +
 meta/recipes-devtools/rpm/rpm_5.4.14.bb  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/rpm/rpm_4.11.2.bb b/meta/recipes-devtools/rpm/rpm_4.11.2.bb
index bc36f99..f4a2110 100644
--- a/meta/recipes-devtools/rpm/rpm_4.11.2.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.11.2.bb
@@ -23,6 +23,7 @@ LICENSE = "GPL-2.0+"
 LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
 
 DEPENDS = "db libxml2 xz findutils file popt nss bzip2 elfutils attr zlib acl gzip python"
+DEPENDS_append_class-native = " file-replacement-native"
 
 SRC_URI += "http://rpm.org/releases/rpm-4.11.x/${BP}.tar.bz2 \
             file://use-pkgconfig-for-python.patch \
diff --git a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
index 8903f3b..951b251 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
@@ -43,6 +43,7 @@ LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
 DEPENDS = "libpcre attr acl popt ossp-uuid file byacc-native"
+DEPENDS_append_class-native = " file-replacement-native"
 
 S = "${WORKDIR}/rpm"
 
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index b450c6f..73b3734 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -41,6 +41,7 @@ LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
 DEPENDS = "libpcre attr acl popt ossp-uuid file byacc-native"
+DEPENDS_append_class-native = " file-replacement-native"
 
 # rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
 # in order to extract the distribution SRPM into a format we can extract...
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH][V3 5/5] subversion: add explicit dependency on file-replacement-native for native builds
  2015-10-20 21:33 [PATCH][V3 1/5] bitbake: add file-native to ASSUME_PROVIDED Ross Burton
                   ` (2 preceding siblings ...)
  2015-10-20 21:33 ` [PATCH][V3 4/5] rpm: add explicit dependency on file-replacement-native for native builds Ross Burton
@ 2015-10-20 21:33 ` Ross Burton
  2016-06-08 20:35   ` Andre McCurdy
  3 siblings, 1 reply; 7+ messages in thread
From: Ross Burton @ 2015-10-20 21:33 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-devtools/subversion/subversion_1.8.13.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-devtools/subversion/subversion_1.8.13.bb b/meta/recipes-devtools/subversion/subversion_1.8.13.bb
index f843b95..9c9bdb1 100644
--- a/meta/recipes-devtools/subversion/subversion_1.8.13.bb
+++ b/meta/recipes-devtools/subversion/subversion_1.8.13.bb
@@ -1,6 +1,7 @@
 SUMMARY = "Subversion (svn) version control system client"
 SECTION = "console/network"
 DEPENDS = "apr-util serf sqlite3 file"
+DEPENDS_append_class-native = " file-replacement-native"
 RDEPENDS_${PN} = "serf"
 LICENSE = "Apache-2"
 HOMEPAGE = "http://subversion.tigris.org"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH][V3 5/5] subversion: add explicit dependency on file-replacement-native for native builds
  2015-10-20 21:33 ` [PATCH][V3 5/5] subversion: " Ross Burton
@ 2016-06-08 20:35   ` Andre McCurdy
  2016-06-09 16:32     ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Andre McCurdy @ 2016-06-08 20:35 UTC (permalink / raw)
  To: Ross Burton; +Cc: OE Core mailing list

On Tue, Oct 20, 2015 at 2:33 PM, Ross Burton <ross.burton@intel.com> wrote:
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
>  meta/recipes-devtools/subversion/subversion_1.8.13.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-devtools/subversion/subversion_1.8.13.bb b/meta/recipes-devtools/subversion/subversion_1.8.13.bb
> index f843b95..9c9bdb1 100644
> --- a/meta/recipes-devtools/subversion/subversion_1.8.13.bb
> +++ b/meta/recipes-devtools/subversion/subversion_1.8.13.bb
> @@ -1,6 +1,7 @@
>  SUMMARY = "Subversion (svn) version control system client"
>  SECTION = "console/network"
>  DEPENDS = "apr-util serf sqlite3 file"
> +DEPENDS_append_class-native = " file-replacement-native"

To make this work, isn't something like:

  EXTRANATIVEPATH_append_class-native = " file-native"

needed too?

Same comment for rpm-native.

>  RDEPENDS_${PN} = "serf"
>  LICENSE = "Apache-2"
>  HOMEPAGE = "http://subversion.tigris.org"
> --
> 2.1.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][V3 5/5] subversion: add explicit dependency on file-replacement-native for native builds
  2016-06-08 20:35   ` Andre McCurdy
@ 2016-06-09 16:32     ` Burton, Ross
  0 siblings, 0 replies; 7+ messages in thread
From: Burton, Ross @ 2016-06-09 16:32 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 393 bytes --]

On 8 June 2016 at 21:35, Andre McCurdy <armccurdy@gmail.com> wrote:

> To make this work, isn't something like:
>
>   EXTRANATIVEPATH_append_class-native = " file-native"
>

God I wish I wrote better commit messages sometimes.

subversion and rpm don't use the file binary but link to libmagic, so
EXTRANATIVEPATH isn't needed (as only the file binary is affected by that).

Ross

[-- Attachment #2: Type: text/html, Size: 888 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-09 16:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-20 21:33 [PATCH][V3 1/5] bitbake: add file-native to ASSUME_PROVIDED Ross Burton
2015-10-20 21:33 ` [PATCH][V3 2/5] sanity: check that the host has file installed Ross Burton
2015-10-20 21:33 ` [PATCH][V3 3/5] file: don't replace host file when built natively Ross Burton
2015-10-20 21:33 ` [PATCH][V3 4/5] rpm: add explicit dependency on file-replacement-native for native builds Ross Burton
2015-10-20 21:33 ` [PATCH][V3 5/5] subversion: " Ross Burton
2016-06-08 20:35   ` Andre McCurdy
2016-06-09 16:32     ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.