summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-09 11:20:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-11 10:26:06 +0000
commit0d0984e1e616c9f1c211b7b980ba2ca54c096e6e (patch)
tree1dcc5055444c172a1f432c7e032f41027230ee8f
parent1117f74385fe60d7eaeaef13ce5927e4798d6992 (diff)
downloadpoky-0d0984e1e616c9f1c211b7b980ba2ca54c096e6e.tar.gz
nativesdk/sdk: Update sdk dummy providers
When we migrated rpm v5 -> v4, we lost the ability to drop "per file" dependencies from the rpm backend for things like "/bin/bash" and "/usr/bin/env" which meant the sdks were becomming 'bloated'. This restores the functionality using a dummy package, similarly to the way the buildtools perl issue was addressed. It also removes the non-functional old code so as not to confuse people in future. I ran into this problem trying to filter dependencies to only rpms a build directly depends upon and it turns out we have some determinism issues in this area so this is something key to fix. (From OE-Core rev: 9d490dc01dcedb216129b22cbe17a6c99efc4f5c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/populate_sdk_base.bbclass6
-rw-r--r--meta/classes/sstate.bbclass3
-rw-r--r--meta/lib/oe/package_manager.py1
-rw-r--r--meta/lib/oe/sdk.py18
-rw-r--r--meta/recipes-core/meta/dummy-sdk-package.inc24
-rw-r--r--meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb27
-rw-r--r--meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb15
-rw-r--r--meta/recipes-core/meta/target-sdk-provides-dummy.bb11
-rw-r--r--meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb1
9 files changed, 65 insertions, 41 deletions
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 424c63cbfc..acb91d7d63 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -20,6 +20,9 @@ def complementary_globs(featurevar, d):
20SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-pkgs', '', d)}" 20SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-pkgs', '', d)}"
21SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}' 21SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
22 22
23PACKAGE_ARCHS_append_task-populate-sdk = " sdk-provides-dummy-target"
24SDK_PACKAGE_ARCHS += "sdk-provides-dummy-${SDKPKGSUFFIX}"
25
23inherit rootfs_${IMAGE_PKGTYPE} 26inherit rootfs_${IMAGE_PKGTYPE}
24 27
25SDK_DIR = "${WORKDIR}/sdk" 28SDK_DIR = "${WORKDIR}/sdk"
@@ -34,7 +37,8 @@ SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
34 37
35TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}" 38TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}"
36TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= "" 39TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
37TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')}" 40TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
41 ${@multilib_pkg_extend(d, 'target-sdk-provides-dummy')}"
38TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= "" 42TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
39TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}" 43TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
40 44
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6e41b56861..65f51430ee 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -28,6 +28,9 @@ SSTATE_EXTRAPATH[vardepvalue] = ""
28SSTATE_DUPWHITELIST = "${DEPLOY_DIR_IMAGE}/ ${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/" 28SSTATE_DUPWHITELIST = "${DEPLOY_DIR_IMAGE}/ ${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/noarch/"
29# Avoid docbook/sgml catalog warnings for now 29# Avoid docbook/sgml catalog warnings for now
30SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml" 30SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
31# sdk-provides-dummy-nativesdk and nativesdk-buildtools-perl-dummy overlap for different SDKMACHINE
32SSTATE_DUPWHITELIST += "${DEPLOY_DIR_RPM}/sdk_provides_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-nativesdk/"
33SSTATE_DUPWHITELIST += "${DEPLOY_DIR_RPM}/buildtools_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/buildtools-dummy-nativesdk/"
31# Archive the sources for many architectures in one deploy folder 34# Archive the sources for many architectures in one deploy folder
32SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}" 35SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}"
33 36
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index ea99165d61..0f85f3fb7c 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -460,7 +460,6 @@ class RpmPM(PackageManager):
460 target_rootfs, 460 target_rootfs,
461 target_vendor, 461 target_vendor,
462 task_name='target', 462 task_name='target',
463 providename=None,
464 arch_var=None, 463 arch_var=None,
465 os_var=None): 464 os_var=None):
466 super(RpmPM, self).__init__(d) 465 super(RpmPM, self).__init__(d)
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index 30e1fb5316..dd02b8c12b 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -93,34 +93,16 @@ class RpmSdk(Sdk):
93 self.host_manifest = RpmManifest(d, self.manifest_dir, 93 self.host_manifest = RpmManifest(d, self.manifest_dir,
94 Manifest.MANIFEST_TYPE_SDK_HOST) 94 Manifest.MANIFEST_TYPE_SDK_HOST)
95 95
96 target_providename = ['/bin/sh',
97 '/bin/bash',
98 '/usr/bin/env',
99 '/usr/bin/perl',
100 'pkgconfig'
101 ]
102
103 self.target_pm = RpmPM(d, 96 self.target_pm = RpmPM(d,
104 self.sdk_target_sysroot, 97 self.sdk_target_sysroot,
105 self.d.getVar('TARGET_VENDOR'), 98 self.d.getVar('TARGET_VENDOR'),
106 'target', 99 'target',
107 target_providename
108 ) 100 )
109 101
110 sdk_providename = ['/bin/sh',
111 '/bin/bash',
112 '/usr/bin/env',
113 '/usr/bin/perl',
114 'pkgconfig',
115 'libGL.so()(64bit)',
116 'libGL.so'
117 ]
118
119 self.host_pm = RpmPM(d, 102 self.host_pm = RpmPM(d,
120 self.sdk_host_sysroot, 103 self.sdk_host_sysroot,
121 self.d.getVar('SDK_VENDOR'), 104 self.d.getVar('SDK_VENDOR'),
122 'host', 105 'host',
123 sdk_providename,
124 "SDK_PACKAGE_ARCHS", 106 "SDK_PACKAGE_ARCHS",
125 "SDK_OS" 107 "SDK_OS"
126 ) 108 )
diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc
new file mode 100644
index 0000000000..ed83dd77da
--- /dev/null
+++ b/meta/recipes-core/meta/dummy-sdk-package.inc
@@ -0,0 +1,24 @@
1SUMMARY = "Dummy packages which handle excluding packages from the sdk, e.g. ensuring perl is excluded from buildtools"
2LICENSE = "MIT"
3
4inherit allarch
5
6python() {
7 # Put the package somewhere separate to ensure it's never used except
8 # when we want it
9 # (note that we have to do this in anonymous python here to avoid
10 # allarch.bbclass disabling itself)
11 d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
12}
13
14ALLOW_EMPTY_${PN} = "1"
15
16PR[vardeps] += "DUMMYPROVIDES"
17
18python populate_packages_prepend() {
19 p = d.getVar("PN")
20 d.appendVar("RPROVIDES_%s" % p, "${DUMMYPROVIDES}")
21 #d.appendVar("RCONFLICTS_%s" % p, "${DUMMYPROVIDES}")
22 #d.appendVar("RREPLACES_%s" % p, "${DUMMYPROVIDES}")
23}
24
diff --git a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
index 0b58a027f3..f5bcb82548 100644
--- a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
+++ b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -1,26 +1,11 @@
1SUMMARY = "Dummy package which ensures perl is excluded from buildtools" 1DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
2LICENSE = "MIT"
3 2
4inherit allarch 3DUMMYPROVIDES = "\
4 nativesdk-perl \
5 nativesdk-perl-module-file-path"
5 6
6PR = "r2" 7PR = "r2"
7 8
8python() { 9require dummy-sdk-package.inc
9 # Put the package somewhere separate to ensure it's never used except
10 # when we want it
11 # (note that we have to do this in anonymous python here to avoid
12 # allarch.bbclass disabling itself)
13 d.setVar('PACKAGE_ARCH', 'buildtools-dummy-${SDKPKGSUFFIX}')
14}
15
16PERLPACKAGES = "nativesdk-perl \
17 nativesdk-perl-module-file-path"
18
19ALLOW_EMPTY_${PN} = "1"
20
21python populate_packages_prepend() {
22 d.appendVar(d.expand('RPROVIDES_${PN}'), '${PERLPACKAGES}')
23 d.appendVar(d.expand('RCONFLICTS_${PN}'), '${PERLPACKAGES}')
24 d.appendVar(d.expand('RREPLACES_${PN}'), '${PERLPACKAGES}')
25}
26 10
11inherit nativesdk
diff --git a/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb b/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
new file mode 100644
index 0000000000..11a727d486
--- /dev/null
+++ b/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
@@ -0,0 +1,15 @@
1DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}"
2
3# Add /bin/sh?
4DUMMYPROVIDES = "\
5 /bin/bash \
6 /usr/bin/env \
7 /usr/bin/perl \
8 pkgconfig \
9 libGL.so()(64bit) \
10 libGL.so \
11"
12
13require dummy-sdk-package.inc
14
15inherit nativesdk
diff --git a/meta/recipes-core/meta/target-sdk-provides-dummy.bb b/meta/recipes-core/meta/target-sdk-provides-dummy.bb
new file mode 100644
index 0000000000..714d15d8ba
--- /dev/null
+++ b/meta/recipes-core/meta/target-sdk-provides-dummy.bb
@@ -0,0 +1,11 @@
1DUMMYARCH = "sdk-provides-dummy-target"
2
3DUMMYPROVIDES = "\
4 /bin/sh \
5 /bin/bash \
6 /usr/bin/env \
7 /usr/bin/perl \
8 pkgconfig \
9"
10
11require dummy-sdk-package.inc
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
index aee4a03718..88e7c648b6 100644
--- a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -25,6 +25,7 @@ RDEPENDS_${PN} = "\
25 nativesdk-cmake \ 25 nativesdk-cmake \
26 nativesdk-postinst-intercept \ 26 nativesdk-postinst-intercept \
27 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'nativesdk-wayland', '', d)} \ 27 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'nativesdk-wayland', '', d)} \
28 nativesdk-sdk-provides-dummy \
28 " 29 "
29 30
30RDEPENDS_${PN}_darwin = "\ 31RDEPENDS_${PN}_darwin = "\