Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 789354 - app-emulation/libguestfs-1.38.6-r103 virt-resize is not compiled (needs OCaml bindings which need libxcrypt)
Summary: app-emulation/libguestfs-1.38.6-r103 virt-resize is not compiled (needs OCaml...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
: 796629 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-10 18:55 UTC by David Duchesne
Modified: 2021-10-31 19:21 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_789354.txt,8.04 KB, text/plain)
2021-05-11 05:24 UTC, David Duchesne
Details
build log (part 1) (build.log,969.38 KB, text/x-log)
2021-05-11 05:32 UTC, David Duchesne
Details
build log (part 2) (build2.log,544.18 KB, text/x-log)
2021-05-11 05:33 UTC, David Duchesne
Details
build log for 1.44.1 (ocaml USE enabled) (1.44.1-build.log,961.93 KB, text/x-log)
2021-06-16 23:12 UTC, David Duchesne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Duchesne 2021-05-10 18:55:20 UTC
app-emulation/libguestfs-1.38.6-r103 doesn't compile virt-resize.

At line 72590, the configure script mentions resize :
"resize/Makefile") CONFIG_FILES="$CONFIG_FILES resize/Makefile" ;;

But only virt-resize bash-completion are present after installation, no /usr/bin/virt-resize is present.
equery f libguestfs | grep resize
/usr/share/bash-completion/completions/virt-resize

----
USE="gtk libvirt"
CFLAGS="-march=bdver2 -O2 -pipe"   CXXFLAGS="-march=bdver2 -O2 -pipe" LDFLAGS="-Wl,-O1 -Wl,--as-needed -L/usr/lib64/xcrypt"
----

Reproducible: Always
Comment 1 Jonas Stein gentoo-dev 2021-05-10 23:36:17 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. Please provide
* the complete build.log as attachment and
* paste the emerge info 
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Comment 2 David Duchesne 2021-05-11 05:24:51 UTC
Created attachment 706890 [details]
emerge --info
Comment 3 David Duchesne 2021-05-11 05:32:43 UTC
Created attachment 706893 [details]
build log (part 1)
Comment 4 David Duchesne 2021-05-11 05:33:36 UTC
Created attachment 706896 [details]
build log (part 2)

----
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /usr/bin/guestfish
   /usr/lib64/libguestfs.so.0.504.0
   /usr/bin/virt-alignment-scan
   /usr/bin/virt-cat
   /usr/bin/virt-filesystems
   /usr/bin/virt-log
   /usr/bin/virt-df
   /usr/bin/virt-ls
   /usr/bin/guestunmount
   /usr/bin/virt-format
   /usr/bin/virt-inspector
   /usr/bin/libguestfs-test-tool
   /usr/bin/virt-tail
   /usr/bin/virt-diff
   /usr/bin/virt-edit
   /usr/bin/virt-make-fs
   /usr/bin/virt-rescue
   /usr/lib64/perl5/5.30.3/x86_64-linux-thread-multi/auto/Sys/Guestfs/Guestfs.so
   /usr/bin/virt-index-validate
   /usr/bin/guestmount
>>> Done.
----
Comment 5 Marco Scardovi (scardracs) 2021-06-16 18:53:30 UTC
Is it still reproducible on 1.44.1?
Comment 6 David Duchesne 2021-06-16 21:30:49 UTC
(In reply to Marco Scardovi (scardracs) from comment #5)
> Is it still reproducible on 1.44.1?

Yes, I compiled it a few minutes ago and virt-resize is still missing.

----
>>> Completed installing app-emulation/libguestfs-1.44.1 into /var/tmp/portage/app-emulation/libguestfs-1.44.1/image

 * Final size of build directory: 184828 KiB (180.4 MiB)
 * Final size of installed tree:   15252 KiB ( 14.8 MiB)

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /usr/bin/virt-cat
   /usr/bin/virt-alignment-scan
   /usr/bin/libguestfs-test-tool
   /usr/bin/guestfish
   /usr/lib64/libguestfs.so.0.509.0
   /usr/bin/virt-filesystems
   /usr/bin/virt-log
   /usr/bin/virt-ls
   /usr/bin/virt-tail
   /usr/bin/virt-df
   /usr/bin/virt-diff
   /usr/bin/virt-edit
   /usr/bin/virt-format
   /usr/bin/virt-inspector
   /usr/bin/virt-make-fs
   /usr/bin/virt-rescue
   /usr/lib64/perl5/5.32/x86_64-linux-thread-multi/auto/Sys/Guestfs/Guestfs.so
   /usr/bin/guestmount
   /usr/bin/guestunmount
>>> Done.
 * OCaml based tools and bindings (sysprep, ...) NOT installed
----
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-16 22:04:19 UTC
(In reply to David Duchesne from comment #6)
> (In reply to Marco Scardovi (scardracs) from comment #5)
> > Is it still reproducible on 1.44.1?
> 
> Yes, I compiled it a few minutes ago and virt-resize is still missing.
> 
>  * OCaml based tools and bindings (sysprep, ...) NOT installed
> ----

I think you need USE=ocaml for it. I can add it to the list if it works for you then?
Comment 8 David Duchesne 2021-06-16 22:07:22 UTC
(In reply to Sam James from comment #7)
> (In reply to David Duchesne from comment #6)
> > (In reply to Marco Scardovi (scardracs) from comment #5)
> > > Is it still reproducible on 1.44.1?
> > 
> > Yes, I compiled it a few minutes ago and virt-resize is still missing.
> > 
> >  * OCaml based tools and bindings (sysprep, ...) NOT installed
> > ----
> 
> I think you need USE=ocaml for it. I can add it to the list if it works for
> you then?

I'm currently trying that with ocaml enabled indeed (a lot of dependencies on my old system, so I will let you know in one hour if it worked or not)
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-16 22:16:36 UTC
(In reply to David Duchesne from comment #8)
> 
> I'm currently trying that with ocaml enabled indeed (a lot of dependencies
> on my old system, so I will let you know in one hour if it worked or not)

Thanks! If it works, I'll update both the log message and enable OCaml by default.

If any OCaml packages fail, please tell me because we've managed to improve the situation a *lot* but some slight tweaks may be needed -- point is, don't despair if any fail, it's going to be fixable.
Comment 10 David Duchesne 2021-06-16 23:12:11 UTC
Created attachment 716475 [details]
build log for 1.44.1 (ocaml USE enabled)
Comment 11 David Duchesne 2021-06-16 23:13:24 UTC
(In reply to Sam James from comment #9)
> (In reply to David Duchesne from comment #8)
> > 
> > I'm currently trying that with ocaml enabled indeed (a lot of dependencies
> > on my old system, so I will let you know in one hour if it worked or not)
> 
> Thanks! If it works, I'll update both the log message and enable OCaml by
> default.
> 
> If any OCaml packages fail, please tell me because we've managed to improve
> the situation a *lot* but some slight tweaks may be needed -- point is,
> don't despair if any fail, it's going to be fixable.

Thanks! Unfortunately, with ocaml USE enabled, it fails to build (see build log attached)

--- tldr version ---

virt-sysprep: error while loading shared libraries: libcrypt.so.2: cannot open shared object file: No such file or directory
make[2]: *** [Makefile:3015: sysprep-operations.pod] Error 127
make[2]: *** Waiting for unfinished jobs....
virt-sysprep: error while loading shared libraries: libcrypt.so.2: cannot open shared object file: No such file or directory
make[2]: *** [Makefile:3010: sysprep-extra-options.pod] Error 127
make[2]: Leaving directory '/var/tmp/portage/app-emulation/libguestfs-1.44.1/work/libguestfs-1.44.1/sysprep'
make[1]: *** [Makefile:2482: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-emulation/libguestfs-1.44.1/work/libguestfs-1.44.1'
make: *** [Makefile:2382: all] Error 2

----
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-16 23:14:34 UTC
(In reply to David Duchesne from comment #10)
> Created attachment 716475 [details]
> build log for 1.44.1 (ocaml USE enabled)

Hmmm.. looks like bug 703118. But I thought we fixed that.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-16 23:29:26 UTC
(In reply to Sam James from comment #12)
> (In reply to David Duchesne from comment #10)
> > Created attachment 716475 [details]
> > build log for 1.44.1 (ocaml USE enabled)
> 
> Hmmm.. looks like bug 703118. But I thought we fixed that.

Okay, it turns out this is Not As Simple As It Looked. The old bug wasn't actually properly fixed.

But for now, you'll need to use USE=-ocaml (sorry) if that's okay.

Asking toolchain@ for help, but it looks like this is going to be a pain given we've not migrated to libxcrypt yet.
Comment 14 Hank Leininger 2021-06-16 23:47:23 UTC
(In reply to Sam James from comment #13)
> (In reply to Sam James from comment #12)
> > (In reply to David Duchesne from comment #10)
> > > Created attachment 716475 [details]
> > > build log for 1.44.1 (ocaml USE enabled)
> > 
> > Hmmm.. looks like bug 703118. But I thought we fixed that.
> 
> Okay, it turns out this is Not As Simple As It Looked. The old bug wasn't
> actually properly fixed.
> 
> But for now, you'll need to use USE=-ocaml (sorry) if that's okay.
> 
> Asking toolchain@ for help, but it looks like this is going to be a pain
> given we've not migrated to libxcrypt yet.

I've been looking at exactly this, was just about to make a new bug for it.

tl;dr passing -L/usr/${libdir}/xcrypt/ used to be enough to not only link virt-sysprep, but for virt-sysprep to get a RUNPATH entry.

Now for whatever reason, no RUNPATH is added.

My dumb workaround is:

--- /usr/portage/app-emulation/libguestfs/libguestfs-1.44.1.ebuild      2021-06-08 03:09:36.000000000 -0600
+++ libguestfs-1.44.1.ebuild    2021-06-16 17:41:56.661842834 -0600
@@ -153,7 +153,7 @@
        export vmchannel_test=no
 
        # bug #703118
-       append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/xcrypt"
+       append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/xcrypt -Wl,-R/usr/lib64/xcrypt"
 
        econf \
                $(use_with libvirt) \

With that, I can build libguestfs-1.44.1[ocaml] and get working virt-* binaries.

I have no idea what the right fix is, but that WFM.
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-16 23:52:15 UTC
(In reply to Hank Leininger from comment #14)
> (In reply to Sam James from comment #13)
> > (In reply to Sam James from comment #12)
> > > (In reply to David Duchesne from comment #10)
> > > > Created attachment 716475 [details]
> > > > build log for 1.44.1 (ocaml USE enabled)
> > > 
> > > Hmmm.. looks like bug 703118. But I thought we fixed that.
> > 
> > Okay, it turns out this is Not As Simple As It Looked. The old bug wasn't
> > actually properly fixed.
> > 
> > But for now, you'll need to use USE=-ocaml (sorry) if that's okay.
> > 
> > Asking toolchain@ for help, but it looks like this is going to be a pain
> > given we've not migrated to libxcrypt yet.
> 
> I've been looking at exactly this, was just about to make a new bug for it.
> 

!!

What a coincidence. We seem to always be on the same stuff...

> tl;dr passing -L/usr/${libdir}/xcrypt/ used to be enough to not only link
> virt-sysprep, but for virt-sysprep to get a RUNPATH entry.
> 
> Now for whatever reason, no RUNPATH is added.
> 
> My dumb workaround is:
> 
> --- /usr/portage/app-emulation/libguestfs/libguestfs-1.44.1.ebuild     
> 2021-06-08 03:09:36.000000000 -0600
> +++ libguestfs-1.44.1.ebuild    2021-06-16 17:41:56.661842834 -0600
> @@ -153,7 +153,7 @@
>         export vmchannel_test=no
>  
>         # bug #703118
> -       append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/xcrypt"
> +       append-ldflags "-L${ESYSROOT}/usr/$(get_libdir)/xcrypt
> -Wl,-R/usr/lib64/xcrypt"

Okay, this makes sense (it's equivalent to the ld.so.conf.d hack in the other bug) but I'm worried it's dangerous based on my discussions with dilfridge. 

I think the issue is that some things are going to be linked against the new and shiny libxcrypt and some won't, i.e. we're not fully replacing what glibc provides.

BUT it might actually turn out to be okay in this case, actually. Need to think and play a bit. Just be careful doing this, especially if you're building binpkgs for another system.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-18 18:51:04 UTC
*** Bug 796629 has been marked as a duplicate of this bug. ***
Comment 17 Larry the Git Cow gentoo-dev 2021-06-18 22:50:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=055efdba6f794cd3181aec537e52c72a874a4c70

commit 055efdba6f794cd3181aec537e52c72a874a4c70
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-06-16 22:15:03 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-18 22:50:11 +0000

    app-emulation/libguestfs: enable OCaml by default for tools
    
    Needed for some common/popular tools.
    
    Closes: https://bugs.gentoo.org/789354
    Signed-off-by: Sam James <sam@gentoo.org>

 app-emulation/libguestfs/libguestfs-1.38.6-r103.ebuild | 6 ++++--
 app-emulation/libguestfs/libguestfs-1.44.1.ebuild      | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b51eac66d64d0d3aa8e26987b16db70135421a19

commit b51eac66d64d0d3aa8e26987b16db70135421a19
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-06-18 22:41:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-18 22:49:39 +0000

    app-emulation/libguestfs: fix libxcrypt RPATH
    
    We were struggling to find libxcrypt (when USE=-system) because it's buried
    away in a subdir - /usr/$(get_libdir)/xcrypt.
    
    For now, let's include a helping hand hint (RPATH) to tell binaries to look
    there for libraries. This won't be an issue in future when we fully remove/disable
    libcrypt from glibc and use libxcrypt[system] instead.
    
    Thanks-to: Hank Leininger <hlein@korelogic.com>
    Closes: https://bugs.gentoo.org/789354
    Signed-off-by: Sam James <sam@gentoo.org>

 app-emulation/libguestfs/libguestfs-1.38.6-r103.ebuild | 6 ++++--
 app-emulation/libguestfs/libguestfs-1.44.1.ebuild      | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)
Comment 18 Larry the Git Cow gentoo-dev 2021-10-31 19:21:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e248001f442fee25f45aa164c0da1cd41b41e882

commit e248001f442fee25f45aa164c0da1cd41b41e882
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-31 19:20:59 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-31 19:20:59 +0000

    app-emulation/libguestfs: note that guestfs-tools is now needed for tools
    
    Always show the message rather than conditionally.
    
    Bug: https://bugs.gentoo.org/789354
    Signed-off-by: Sam James <sam@gentoo.org>

 ...uestfs-1.46.0-r1.ebuild => libguestfs-1.46.0-r2.ebuild} | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)