gvfs: use native ssh client
cover gvfs: use native ssh client
While rebasing the NI LinuxRT distro to kirkstone, I noticed that my pyrex container fails gvfs:do_configure with a meson error about not finding an ssh client.
| Program ssh found: NO | | ../gvfs-1.50.0/meson.build:462:2: ERROR: Assert failed: SFTP backend requested but a ssh client is required
After some investigation, it seems that gvfs is configured to use the ssh client implementation in the build machine's PATH. If no native implementation is provided in the native sysroot, it will default to using the host machine's implementation.
My new kirkstone pyrex container happened to not install an ssh client, and so would fail. Since ssh isn't a requirement to run BB or OE, I don't think it's appropriate to use the host's ssh.
This patchset adds the native bbclass to openssh, when the user includes meta-oe in his layerstack, and then provides the openssh-native content to gvfs through its DEPENDS. This is sufficient to resolve the error on my kirkstone pyrex container.
NOTE: It's a little odd to me that the OE-core openssh recipe doesn't already inherit native.bbclass - when it *does* inherit nativesdk.bbclass. I would be open to moving the openssh changes in this PR to OE-core directly, if someone can ACK that it would be more appropriate to do so.
Alex Stewart (3):
openssh: add native BBCLASSEXTEND
gvfs: stylize DEPENDS
gvfs: use native ssh client
.../recipes-connectivity/openssh/openssh_%.bbappend | 2 ++ meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 meta-gnome/recipes-connectivity/openssh/openssh_%.bbappend
Signature · 1 line
2.38.1
PATCH 1/3 openssh: add native BBCLASSEXTEND
A native ssh client binary is needed when compiling gvfs with the sftp option enabled.
Add the native bbclass to openssh, so that openssh-native can be used by gvfs.
--- meta-gnome/recipes-connectivity/openssh/openssh_%.bbappend | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 meta-gnome/recipes-connectivity/openssh/openssh_%.bbappend
meta-gnome/recipes-connectivity/openssh/openssh_%.bbappend new file +2 -0
@@ -0,0 +1,2 @@ +# An ssh native client binary is needed by the gvfs do_configure. +BBCLASSEXTEND += "native"
Signature · 1 line
2.38.1
PATCH 2/3 gvfs: stylize DEPENDS
In reply to Alex StewartUse multiline styling in the gvfs DEPENDS variable assignment, so that diffs are easier to understand.
Also alpha-sort the DEPENDS, since their order isn't meaningful.
--- meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb +9 -2
@@ -5,8 +5,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=05df38dd77c35ec8431f212410a3329e" GNOMEBASEBUILDCLASS = "meson" inherit gnomebase gsettings bash-completion gettext upstream-version-is-even features_check useradd -DEPENDS += "libsecret glib-2.0 glib-2.0-native libgudev shadow-native \ - gsettings-desktop-schemas dbus" +DEPENDS += "\ + dbus \ + glib-2.0 \ + glib-2.0-native \ + gsettings-desktop-schemas \ + libgudev \ + libsecret \ + shadow-native \ +" RDEPENDS:${PN} += "gsettings-desktop-schemas"
Signature · 1 line
2.38.1
PATCH 3/3 gvfs: use native ssh client
In reply to Alex StewartWhen the sftp option is enabled in gvfs, meson tries to find a valid ssh binary in the build host's PATH during do_configure. If a -native implementation is not found, meson will try to satisfy the binary using the build machine's hosttools directly - which is generally undesirable.
DEPEND on openssh-native, so that an ssh client implementation is always in the PATH during configuration.
--- meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 1 + 1 file changed, 1 insertion(+)
meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb +1 -0
@@ -12,6 +12,7 @@ DEPENDS += "\ gsettings-desktop-schemas \ libgudev \ libsecret \ + openssh-native \ shadow-native \ "
Signature · 1 line
2.38.1
Hi,
Quoted 7 lines · Alex Stewart
When the
sftpoption is enabled in gvfs, meson tries to find a validsshbinary in the build host's PATH duringdo_configure. If a -native implementation is not found, meson will try to satisfy the binary using the build machine's hosttools directly - which is generally undesirable.DEPEND on openssh-native, so that an ssh client implementation is always in the PATH during configuration.
This sounds wrong. Why doesn't meson look into the sysroot and add the dependency to target "openssh" (or "virtual/ssh-client")?
If the path to the binary will be hard coded, then that needs to be fixed to be the path in expected target system rootfs.
Cheers,
-Mikko
Quoted 30 lines
Signed-off-by Alex Stewart <[email protected]>--- meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 1 + 1 file changed, 1 insertion(+)meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb +1
-0@@ -12,6 +12,7 @@ DEPENDS += "\ gsettings-desktop-schemas \ libgudev \ libsecret \ + openssh-native \ shadow-native \ "Signature · 11 lines
2.38.1 -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#99888): https://lists.openembedded.org/g/openembedded-devel/message/99888 Mute This Topic: https://lists.openembedded.org/mt/95382229/7159507 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
Quoted 8 lines · Mikko Rapeli
Hi,
Quoted 5 lines · Alex Stewart
When the
sftpoption is enabled in gvfs, meson tries to find a validsshbinary in the build host's PATH duringdo_configure. If a -native implementation is not found, meson will try to satisfy the binary using the build machine's hosttools directly - which is generally undesirable.
Quoted 7 lines
Quoted 2 lines
DEPEND on openssh-native, so that an ssh client implementation is always in the PATH during configuration.
This sounds wrong. Why doesn't meson look into the sysroot and add the dependency to target "openssh" (or "virtual/ssh-client")?
If the path to the binary will be hard coded, then that needs to be fixed to be the path in expected target system rootfs.
I guessed it might have something to do with ssh not being defined within this meson.cross binaries list (or maybe the .native version) [1]. I tried adding it, along with a DEPENDS on openssh, but that didn't seem to work either.
I'm not very familiar with meson configurations. If you have some guidance on a better design, I'd be happy to give it a shot.
[1] https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/meson.bbclass#n65
Quoted 25 lines
Cheers,
-Mikko
Quoted 20 lines
Signed-off-by Alex Stewart <[email protected]>--- meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 1 + 1 file changed, 1 insertion(+)meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb +1
-0@@ -12,6 +12,7 @@ DEPENDS += "\ gsettings-desktop-schemas \ libgudev \ libsecret \ + openssh-native \ shadow-native \ "Signature · 1 line
2.38.1
Signature · 5 lines
Alex Stewart Software Engineer - NI Real-Time OS NI (National Instruments) [email protected]
Hi,
Quoted 24 lines · Alex Stewart
While rebasing the NI LinuxRT distro to kirkstone, I noticed that my pyrex container fails gvfs:do_configure with a meson error about not finding an
sshclient.| Program ssh found: NO | | ../gvfs-1.50.0/meson.build:462:2: ERROR: Assert failed: SFTP backend requested but a ssh client is requiredAfter some investigation, it seems that gvfs is configured to use the
sshclient implementation in the build machine's PATH. If no native implementation is provided in the native sysroot, it will default to using the host machine's implementation.My new kirkstone pyrex container happened to not install an ssh client, and so would fail. Since ssh isn't a requirement to run BB or OE, I don't think it's appropriate to use the host's ssh.
This patchset adds the native bbclass to openssh, when the user includes meta-oe in his layerstack, and then provides the openssh-native content to gvfs through its DEPENDS. This is sufficient to resolve the error on my kirkstone pyrex container.
Quoted 5 lines
NOTE: It's a little odd to me that the OE-core openssh recipe doesn't already inherit native.bbclass - when it *does* inherit nativesdk.bbclass. I would be open to moving the openssh changes in this PR to OE-core directly, if someone can ACK that it would be more appropriate to do so.
Why would one really need to build native, the compiler host machine, version of openssh? Why even gvfs is needed for native?! For target or nativesdk the needs are clear, but for native?
These kind of things really need good justifications or the whole host tooling graph explodes and build times with it. In most cases the native host target has a lot less build dependencies and features enabled because of this reason.
Cheers,
-Mikko
Hey Mikko,
Quoted 27 lines · Mikko Rapeli
Hi,
Quoted 24 lines · Alex Stewart
While rebasing the NI LinuxRT distro to kirkstone, I noticed that my pyrex container fails gvfs:do_configure with a meson error about not finding an
sshclient.| Program ssh found: NO | | ../gvfs-1.50.0/meson.build:462:2: ERROR: Assert failed: SFTP backend requested but a ssh client is requiredAfter some investigation, it seems that gvfs is configured to use the
sshclient implementation in the build machine's PATH. If no native implementation is provided in the native sysroot, it will default to using the host machine's implementation.My new kirkstone pyrex container happened to not install an ssh client, and so would fail. Since ssh isn't a requirement to run BB or OE, I don't think it's appropriate to use the host's ssh.
This patchset adds the native bbclass to openssh, when the user includes meta-oe in his layerstack, and then provides the openssh-native content to gvfs through its DEPENDS. This is sufficient to resolve the error on my kirkstone pyrex container.
Quoted 8 lines
Quoted 5 lines
NOTE: It's a little odd to me that the OE-core openssh recipe doesn't already inherit native.bbclass - when it *does* inherit nativesdk.bbclass. I would be open to moving the openssh changes in this PR to OE-core directly, if someone can ACK that it would be more appropriate to do so.
Why would one really need to build native, the compiler host machine, version of openssh? Why even gvfs is needed for native?! For target or nativesdk the needs are clear, but for native?
I'm not sure I understand the question. Are you asking why the gvfs compile requires an ssh client in the build host toolchain?
If so, I don't know the answer. Trolling through the history of the gvfs project didn't provide me with very much context as to why it is required. And I didn't see an obvious way to work-around the requirement.
Quoted 4 lines
These kind of things really need good justifications or the whole host tooling graph explodes and build times with it. In most cases the native host target has a lot less build dependencies and features enabled because of this reason.
Agreed. I'd love to eschew this requirement; but that is probably a conversation with gvfs upstream about why it exists in the first place.
Signature · 5 lines
Alex Stewart Software Engineer - NI Real-Time OS NI (National Instruments) [email protected]
Hi,
Quoted 35 lines · Alex Stewart
Hey Mikko,
Quoted 32 lines · Mikko Rapeli
Hi,
Quoted 29 lines · Alex Stewart
While rebasing the NI LinuxRT distro to kirkstone, I noticed that my pyrex container fails gvfs:do_configure with a meson error about not finding an
sshclient.| Program ssh found: NO | | ../gvfs-1.50.0/meson.build:462:2: ERROR: Assert failed: SFTP backend requested but a ssh client is requiredAfter some investigation, it seems that gvfs is configured to use the
sshclient implementation in the build machine's PATH. If no native implementation is provided in the native sysroot, it will default to using the host machine's implementation.My new kirkstone pyrex container happened to not install an ssh client, and so would fail. Since ssh isn't a requirement to run BB or OE, I don't think it's appropriate to use the host's ssh.
This patchset adds the native bbclass to openssh, when the user includes meta-oe in his layerstack, and then provides the openssh-native content to gvfs through its DEPENDS. This is sufficient to resolve the error on my kirkstone pyrex container.
NOTE: It's a little odd to me that the OE-core openssh recipe doesn't already inherit native.bbclass - when it *does* inherit nativesdk.bbclass. I would be open to moving the openssh changes in this PR to OE-core directly, if someone can ACK that it would be more appropriate to do so.
Quoted 6 lines
Quoted 3 lines
Why would one really need to build native, the compiler host machine, version of openssh? Why even gvfs is needed for native?! For target or nativesdk the needs are clear, but for native?
I'm not sure I understand the question. Are you asking why the gvfs compile requires an ssh client in the build host toolchain?
What requires gvfs for native build target? I think that dependency should be removed. I don't think this dependency makes sense and I don't think it will really be used by anything.
If there is a real use case, then you could try to remove the ssh dependency. You likely don't need ssh communication at build time so just disable the feature completely.
Cheers,
-Mikko
I'm revoking this PR for the moment, in favor of pursuing an upstream solution.
While doing some more investigation based on the commentary that Mikko and I were having in the thread, I discovered more detail about how gvfs is using the ssh binary.
As this open gvfs issue [1] points out, meson is configured to find the ssh binary in the build host's PATH and to then write that path-string directly into the args[0] for the sftp backend. And that's *all* that the ssh binary is used for at build time.
That's obviously dangerous - as the issue points out - for the cross-compile case, where you cannot assume that the ssh binary path is the same between the build host and the target distro. But it also means that using a sysroot-native ssh binary is equally as insane, since its path is also different from the final target image. So neither the existing implementation, nor this PR, would provide you with a working gvfs-sftp implementation.
The proper solution is probably to change the gvfs-sftp backend upstream to use PATH resolution at runtime to find the ssh binary. Though I don't actually use gvfs-sftp in my use-case, I'll attempt to try and upstream a fix.
The other alternative I see is to disable the gvfs-sftp subpackages from building in OE entirely - which seems undesirable for those users who are depending on it.
[1] https://gitlab.gnome.org/GNOME/gvfs/-/issues/465
Quoted 41 lines · Alex Stewart
While rebasing the NI LinuxRT distro to kirkstone, I noticed that my pyrex container fails gvfs:do_configure with a meson error about not finding an
sshclient.| Program ssh found: NO | | ../gvfs-1.50.0/meson.build:462:2: ERROR: Assert failed: SFTP backend requested but a ssh client is requiredAfter some investigation, it seems that gvfs is configured to use the
sshclient implementation in the build machine's PATH. If no native implementation is provided in the native sysroot, it will default to using the host machine's implementation.My new kirkstone pyrex container happened to not install an ssh client, and so would fail. Since ssh isn't a requirement to run BB or OE, I don't think it's appropriate to use the host's ssh.
This patchset adds the native bbclass to openssh, when the user includes meta-oe in his layerstack, and then provides the openssh-native content to gvfs through its DEPENDS. This is sufficient to resolve the error on my kirkstone pyrex container.
NOTE: It's a little odd to me that the OE-core openssh recipe doesn't already inherit native.bbclass - when it *does* inherit nativesdk.bbclass. I would be open to moving the openssh changes in this PR to OE-core directly, if someone can ACK that it would be more appropriate to do so.
Alex Stewart (3):
openssh: add native BBCLASSEXTEND
gvfs: stylize DEPENDS
gvfs: use native ssh client.../recipes-connectivity/openssh/openssh_%.bbappend | 2 ++ meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)create mode 100644 meta-gnome/recipes-connectivity/openssh/openssh_%.bbappend
Signature · 5 lines
Alex Stewart Software Engineer - NI Real-Time OS NI (National Instruments) [email protected]
Quoted 28 lines · Alex Stewart
I'm revoking this PR for the moment, in favor of pursuing an upstream solution.
While doing some more investigation based on the commentary that Mikko and I were having in the thread, I discovered more detail about how gvfs is using the ssh binary.
As this open gvfs issue [1] points out, meson is configured to find the
sshbinary in the build host's PATH and to then write that path-string directly into theargs[0]for the sftp backend. And that's *all* that the ssh binary is used for at build time.That's obviously dangerous - as the issue points out - for the cross-compile case, where you cannot assume that the ssh binary path is the same between the build host and the target distro. But it also means that using a sysroot-native ssh binary is equally as insane, since its path is also different from the final target image. So neither the existing implementation, nor this PR, would provide you with a working gvfs-sftp implementation.
The proper solution is probably to change the gvfs-sftp backend upstream to use PATH resolution at runtime to find the ssh binary. Though I don't actually use gvfs-sftp in my use-case, I'll attempt to try and upstream a fix.
Quoted 42 lines
The other alternative I see is to disable the gvfs-sftp subpackages from building in OE entirely - which seems undesirable for those users who are depending on it.
[1] https://gitlab.gnome.org/GNOME/gvfs/-/issues/465
Quoted 34 lines · Alex Stewart
While rebasing the NI LinuxRT distro to kirkstone, I noticed that my pyrex container fails gvfs:do_configure with a meson error about not finding an
sshclient.| Program ssh found: NO | | ../gvfs-1.50.0/meson.build:462:2: ERROR: Assert failed: SFTP backend requested but a ssh client is requiredAfter some investigation, it seems that gvfs is configured to use the
sshclient implementation in the build machine's PATH. If no native implementation is provided in the native sysroot, it will default to using the host machine's implementation.My new kirkstone pyrex container happened to not install an ssh client, and so would fail. Since ssh isn't a requirement to run BB or OE, I don't think it's appropriate to use the host's ssh.
This patchset adds the native bbclass to openssh, when the user includes meta-oe in his layerstack, and then provides the openssh-native content to gvfs through its DEPENDS. This is sufficient to resolve the error on my kirkstone pyrex container.
NOTE: It's a little odd to me that the OE-core openssh recipe doesn't already inherit native.bbclass - when it *does* inherit nativesdk.bbclass. I would be open to moving the openssh changes in this PR to OE-core directly, if someone can ACK that it would be more appropriate to do so.
Alex Stewart (3):
openssh: add native BBCLASSEXTEND
gvfs: stylize DEPENDS
I kept this one patch since it was formatting only.
Quoted 24 lines
Quoted 7 lines
gvfs: use native ssh client
.../recipes-connectivity/openssh/openssh_%.bbappend | 2 ++ meta-gnome/recipes-gnome/gvfs/gvfs_1.50.2.bb | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)create mode 100644 meta-gnome/recipes-connectivity/openssh/openssh_%.bbappend
--
Alex Stewart
Software Engineer - NI Real-Time OS
NI (National Instruments)-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#99905): https://lists.openembedded.org/g/openembedded-devel/message/99905
Mute This Topic: https://lists.openembedded.org/mt/95382223/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-