Skip to contentSkip to conversation

openssh: openssh-dev shouldn't depend on openssh

PATCH In review Matt Johnston 4 participants 6 messages Sep 29, 2021 – Sep 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openssh: openssh-dev shouldn't depend on openssh

In some situations packages such as openssh-sftp-server are used separately from openssh-sshd. The openssh-dev package is empty but can have conflicts when installed via populate_sdk. Removing the dependency avoids that.

https://github.com/openbmc/openbmc/issues/3819 is an example of the problem.

---
 meta/recipes-connectivity/openssh/openssh_8.7p1.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/openssh/openssh_8.7p1.bb +2 -0
index 07cd6b74cd..3ebdd62de3 100644
@@ -165,6 +165,8 @@ RDEPENDS:${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pa
 RRECOMMENDS:${PN}-sshd:append:class-target = "\
     ${@bb.utils.filter('PACKAGECONFIG', 'rng-tools', d)} \
 "
+# openssh-dev shouldn't pull in openssh-sshd etc
+RDEPENDS:${PN}-dev = ""
 
 # gdb would make attach-ptrace test pass rather than skip but not worth the build dependencies
 RDEPENDS:${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make sed sudo coreutils"
Signature · 1 line
2.30.2
#1 lore raw
Quoted 18 lines · Matt Johnston

In some situations packages such as openssh-sftp-server are used separately from openssh-sshd. The openssh-dev package is empty but can have conflicts when installed via populate_sdk. Removing the dependency avoids that.

https://github.com/openbmc/openbmc/issues/3819 is an example of the problem.

---
 meta/recipes-connectivity/openssh/openssh_8.7p1.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/openssh/openssh_8.7p1.bb +0 -0
index 07cd6b74cd..3ebdd62de3 100644

meta/recipes-connectivity/openssh/openssh_8.7p1.bb RDEPENDS:${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pa · line 169

Quoted 5 lines
meta/recipes-connectivity/openssh/openssh_8.7p1.bb +2 -0
@@ -165,6 +165,8 @@ RDEPENDS:${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pa
 RRECOMMENDS:${PN}-sshd:append:class-target = "\
     ${@bb.utils.filter('PACKAGECONFIG', 'rng-tools', d)} \
 "
+# openssh-dev shouldn't pull in openssh-sshd etc
+RDEPENDS:${PN}-dev = ""

At that point what is the point of the -dev package? I think you could make this argument about a lot of the -dev packages and I'm not sure I'd want to see every recipe doing this.

What are you using the -dev package for and do you need it at all?

[As an aside, I do think the -dev package dependencies need rethinking but that is a lot more work which nobody seems very interested in]

Cheers,

Richard

#2 lore raw
Quoted 7 lines · Richard Purdie
Quoted 1 line

+RDEPENDS:${PN}-dev = ""

At that point what is the point of the -dev package? I think you could make this argument about a lot of the -dev packages and I'm not sure I'd want to see every recipe doing this.

What are you using the -dev package for and do you need it at all?

The -dev package isn't needed for anything, but it gets pulled in when "populate_sdk" is built. That does a glob over all -dev packages for any built package.

Cheers,
Matt

Quoted 8 lines

[As an aside, I do think the -dev package dependencies need rethinking but that is a lot more work which nobody seems very interested in]

Cheers,

Richard

#3 lore raw

I think a better way out may be to make openssh and dropbear coinstallable?

Alex

Quoted 41 lines · Matt Johnston
Quoted 3 lines · Richard Purdie
Quoted 1 line

+RDEPENDS:${PN}-dev = ""

At that point what is the point of the -dev package? I think you could

make

Quoted 1 line

this argument about a lot of the -dev packages and I'm not sure I'd want

to

Quoted 3 lines

see every recipe doing this.

What are you using the -dev package for and do you need it at all?

The -dev package isn't needed for anything, but it gets pulled in when "populate_sdk" is built. That does a glob over all -dev packages for any built package.

Cheers,
Matt

Quoted 2 lines

[As an aside, I do think the -dev package dependencies need rethinking

but

Quoted 6 lines

that is a lot more work which nobody seems very interested in]

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#156452):
https://lists.openembedded.org/g/openembedded-core/message/156452
Mute This Topic: https://lists.openembedded.org/mt/85941131/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
In reply to Matt Johnston
Quoted 7 lines · Matt Johnston
Quoted 6 lines · Richard Purdie
Quoted 1 line

+RDEPENDS:${PN}-dev = ""

At that point what is the point of the -dev package? I think you could make this argument about a lot of the -dev packages and I'm not sure I'd want to see every recipe doing this.

Quoted 5 lines
Quoted 1 line

What are you using the -dev package for and do you need it at all?

The -dev package isn't needed for anything, but it gets pulled in when "populate_sdk" is built. That does a glob over all -dev packages for any built package.

The dev package's SHOULD depend on the regular package by default. There are VERY VERY few instances where the dev package is "useful" without the corresponding run-time package in a 'normal' use-case. (There are always exceptions and corner cases, but they're just that exceptions and corner cases in my experience and lead to massive confusion by developers if exploited.)

populate_sdk, the entire purpose of this is to install the -dev package (and it's dependencies) for anything in your root filesystem. This says that you root filesystem contains "openssh", thus openssh-dev will be installed.

If your root filesystem does NOT have openssh in it, then we need to answer the question why was the -dev version added?

You mention above it's "any built package", but that should not be the case. It should be for any package installed into the corresponding root filesystem.

i.e. bitbake core-image-minimal -c do_populate_sdk

This should NOT install -dev packages for things not located in core-image-minimal. If it does, then there is another problem, that was not the intended design. The intention when the do_populate_sdk was written was construct the rootfs, parse what was install and add -dev packages + their dependencies.

--Mark

Quoted 23 lines

Cheers,
Matt

Quoted 8 lines

[As an aside, I do think the -dev package dependencies need rethinking but that is a lot more work which nobody seems very interested in]

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156452): https://lists.openembedded.org/g/openembedded-core/message/156452
Mute This Topic: https://lists.openembedded.org/mt/85941131/3616948
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
Quoted 6 lines · Mark Hatle

If your root filesystem does NOT have openssh in it, then we need to answer the question why was the -dev version added?

You mention above it's "any built package", but that should not be the case. It should be for any package installed into the corresponding root filesystem.

In this case "openssh" isn't installed in the root filesystem, only "openssh-sftp-server".

Quoted 5 lines

This should NOT install -dev packages for things not located in core-image-minimal. If it does, then there is another problem, that was not the intended design. The intention when the do_populate_sdk was written was construct the rootfs, parse what was install and add -dev packages + their dependencies.

populate_sdk resolves the globs for installed packages with "oe-pkgdata-util glob /tmp/installedpkgs *-dev"
which falls back to using the PN ("openssh") to find a match for openssh- sftp-server.
That behaviour is useful for libraries like libboost-thread1.77.0 -> boost-dev, so I guess it's best left as-is.

Cheers,
Matt

Quoted 1 line