On Fri, 2024-09-27 at 15:20 +0200, Claus Stovgaard wrote:
> SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY is a new variable to
> enable installation of recommended complementary packages in the
> classic
> sdk. Use it to get populate_sdk behave like Kirkstone and earlier.
> 
> As installing complementary recommended packages is known to cause
> bugs
> it was disabled. Though it can be usefull when having dummy packages
> with DEPENDS to create SDK's. Use this variable with caution.
> 
> Signed-off-by: Claus Stovgaard <claus.stovga...@gmail.com>

I got a comment on IRC about splitting it up into documentation part
for yocto-doc mailing list and implementation, so will wait some days
more, and then split it up and send as normal patches if there is no
other comments.


/Claus


> ---
>  documentation/ref-manual/variables.rst        | 7 +++++++
>  meta/classes-recipe/populate_sdk_base.bbclass | 1 +
>  meta/conf/documentation.conf                  | 1 +
>  meta/lib/oe/package_manager/__init__.py       | 4 ++--
>  meta/lib/oe/package_manager/deb/sdk.py        | 4 +++-
>  meta/lib/oe/package_manager/ipk/sdk.py        | 4 +++-
>  meta/lib/oe/package_manager/rpm/sdk.py        | 6 ++++--
>  7 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/documentation/ref-manual/variables.rst
> b/documentation/ref-manual/variables.rst
> index 32c9e7407d..44ec6d59a6 100644
> --- a/documentation/ref-manual/variables.rst
> +++ b/documentation/ref-manual/variables.rst
> @@ -7658,6 +7658,13 @@ system and gives an overview of their function
> and contents.
>  
>           $ bitbake -c populate_sdk imagename
>  
> +   :term:`SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY`
> +      Set to '0' to install recommended complementary packages as
> part of populate_sdk.
> +      Used to make the clasical sdk behave like Kirkstone and
> earlier yocto releases.
> +      Complementary recommended packages was disabled for default
> because of long standing
> +      bugs where RDEPENDS from -dev packages causes problems in sdk.
> Example with conflict
> +      for main openssh and dropbear packages. Use with caution.
> +
>     :term:`SDKMACHINE`
>        The machine for which the SDK is built. In other words, the
> SDK is built
>        such that it runs on the target you specify with the
> :term:`SDKMACHINE`
> diff --git a/meta/classes-recipe/populate_sdk_base.bbclass
> b/meta/classes-recipe/populate_sdk_base.bbclass
> index 16013d5872..09e9c5b61c 100644
> --- a/meta/classes-recipe/populate_sdk_base.bbclass
> +++ b/meta/classes-recipe/populate_sdk_base.bbclass
> @@ -37,6 +37,7 @@ def complementary_globs(featurevar, d):
>  SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs src-pkgs
> ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-
> pkgs', '', d)}"
>  SDKIMAGE_INSTALL_COMPLEMENTARY =
> '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
>  SDKIMAGE_INSTALL_COMPLEMENTARY[vardeps] += "SDKIMAGE_FEATURES"
> +SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY ??= "1"
>  
>  PACKAGE_ARCHS:append:task-populate-sdk = " sdk-provides-dummy-
> target"
>  SDK_PACKAGE_ARCHS += "sdk-provides-dummy-${SDKPKGSUFFIX}"
> diff --git a/meta/conf/documentation.conf
> b/meta/conf/documentation.conf
> index 3f130120c0..84e2fef688 100644
> --- a/meta/conf/documentation.conf
> +++ b/meta/conf/documentation.conf
> @@ -376,6 +376,7 @@ SDK_DIR[doc] = "The parent directory used by the
> OpenEmbedded build system when
>  SDK_NAME[doc] = "The base name for SDK output files."
>  SDK_OUTPUT[doc] = "The location used by the OpenEmbedded build
> system when creating SDK output."
>  SDKIMAGE_FEATURES[doc] = "Equivalent to IMAGE_FEATURES. However,
> this variable applies to the SDK generated from an image using the
> command 'bitbake -c populate_sdk imagename'."
> +SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY[doc] = "Set to
> something else than '1' to install recommended complementary packages
> as part of sdk. Used to make populate_sdk behave like Kirkstone and
> earlier"
>  SDKMACHINE[doc] = "Specifies the architecture (i.e. i686 or x86_64)
> for which to build SDK and ADT items."
>  SECTION[doc] = "The section in which packages should be categorized.
> Package management utilities can make use of this variable."
>  SELECTED_OPTIMIZATION[doc] = "The variable takes the value of
> FULL_OPTIMIZATION unless DEBUG_BUILD = '1'. In this case, the value
> of DEBUG_OPTIMIZATION is used."
> diff --git a/meta/lib/oe/package_manager/__init__.py
> b/meta/lib/oe/package_manager/__init__.py
> index d3b2317894..50e78c4017 100644
> --- a/meta/lib/oe/package_manager/__init__.py
> +++ b/meta/lib/oe/package_manager/__init__.py
> @@ -344,7 +344,7 @@ class PackageManager(object, metaclass=ABCMeta):
>                           "'%s' returned %d:\n%s" %
>                           (' '.join(cmd), e.returncode,
> e.output.decode("utf-8")))
>  
> -    def install_complementary(self, globs=None):
> +    def install_complementary(self, globs=None,
> hard_depends_only=True):
>          """
>          Install complementary packages based upon the list of
> currently installed
>          packages e.g. locales, *-dev, *-dbg, etc. Note: every
> backend needs to
> @@ -399,7 +399,7 @@ class PackageManager(object, metaclass=ABCMeta):
>                  bb.note("Installing complementary packages ... %s
> (skipped already provided packages %s)" % (
>                      ' '.join(install_pkgs),
>                      ' '.join(skip_pkgs)))
> -                self.install(install_pkgs, hard_depends_only=True)
> +                self.install(install_pkgs,
> hard_depends_only=hard_depends_only)
>              except subprocess.CalledProcessError as e:
>                  bb.fatal("Could not compute complementary packages
> list. Command "
>                           "'%s' returned %d:\n%s" %
> diff --git a/meta/lib/oe/package_manager/deb/sdk.py
> b/meta/lib/oe/package_manager/deb/sdk.py
> index 6f3005053e..6232c47f4a 100644
> --- a/meta/lib/oe/package_manager/deb/sdk.py
> +++ b/meta/lib/oe/package_manager/deb/sdk.py
> @@ -65,7 +65,9 @@ class PkgSdk(Sdk):
>          bb.note("Installing TARGET packages")
>          self._populate_sysroot(self.target_pm, self.target_manifest)
>  
> -       
> self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_
> COMPLEMENTARY'))
> +        hard_depends_only =
> (self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY') ==
> '1')
> +       
> self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_
> COMPLEMENTARY'),
> +            hard_depends_only)
>  
>          self.target_pm.run_pre_post_installs()
>  
> diff --git a/meta/lib/oe/package_manager/ipk/sdk.py
> b/meta/lib/oe/package_manager/ipk/sdk.py
> index 3acd55f548..e8663523df 100644
> --- a/meta/lib/oe/package_manager/ipk/sdk.py
> +++ b/meta/lib/oe/package_manager/ipk/sdk.py
> @@ -61,7 +61,9 @@ class PkgSdk(Sdk):
>          bb.note("Installing TARGET packages")
>          self._populate_sysroot(self.target_pm, self.target_manifest)
>  
> -       
> self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_
> COMPLEMENTARY'))
> +        hard_depends_only =
> (self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY') ==
> '1')
> +       
> self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_
> COMPLEMENTARY'),
> +            hard_depends_only)
>  
>          env_bkp = os.environ.copy()
>          os.environ['PATH'] =
> self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
> diff --git a/meta/lib/oe/package_manager/rpm/sdk.py
> b/meta/lib/oe/package_manager/rpm/sdk.py
> index ea79fe050b..a3f505c023 100644
> --- a/meta/lib/oe/package_manager/rpm/sdk.py
> +++ b/meta/lib/oe/package_manager/rpm/sdk.py
> @@ -65,8 +65,10 @@ class PkgSdk(Sdk):
>          bb.note("Installing TARGET packages")
>          self._populate_sysroot(self.target_pm, self.target_manifest)
>  
> -       
> self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_
> COMPLEMENTARY'))
> -
> +        hard_depends_only =
> (self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY_HARD_DEPENDS_ONLY') ==
> '1')
> +       
> self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_
> COMPLEMENTARY'),
> +            hard_depends_only)
> +        
>          env_bkp = os.environ.copy()
>          os.environ['PATH'] =
> self.d.expand("${COREBASE}/scripts/nativesdk-intercept") + \
>                               os.pathsep + os.environ["PATH"]

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205148): 
https://lists.openembedded.org/g/openembedded-core/message/205148
Mute This Topic: https://lists.openembedded.org/mt/108685995/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to