Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 719032 - app-emulation/virtualbox-6.1.6 build failure with USE=headless
Summary: app-emulation/virtualbox-6.1.6 build failure with USE=headless
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL: https://www.virtualbox.org/pipermail/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-23 11:55 UTC by Vedran Vrbanc
Modified: 2020-06-16 20:43 UTC (History)
1 user (show)

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


Attachments
ebuild with patch (virtualbox-6.1.6-r1.ebuild,14.21 KB, text/plain)
2020-04-23 12:24 UTC, Vedran Vrbanc
Details
patch file (virtualbox-6.1.6-headless-fix.patch,685 bytes, patch)
2020-04-23 12:26 UTC, Vedran Vrbanc
Details | Diff
revised patch file (virtualbox-6.1.6-headless-fix.patch,612 bytes, patch)
2020-04-23 12:53 UTC, Vedran Vrbanc
Details | Diff
Build log (gzip-ed) with provided patch, with "headless" USE flag. (app-emulation:virtualbox-6.1.6:20200502-205528.log.gz,391.21 KB, application/x-gzip)
2020-05-02 21:27 UTC, Thibaud CANALE
Details
Build log (gzip-ed) without user patch from comment 4. (app-emulation:virtualbox-6.1.6:20200616-202838.log.gz,150.07 KB, application/gzip)
2020-06-16 20:43 UTC, Thibaud CANALE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vedran Vrbanc 2020-04-23 11:55:37 UTC
headless build fails with the following error:

VirtualBox-6.1.6/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp:98:42: error: ‘PSHCLFORMATDATA’ has not been declared

bug is upstream, introduced here https://www.virtualbox.org/changeset/83624/vbox

PSHCLFORMATDATA was renamed to PSHCLFORMATS, but obviously forgotten in VBoxSharedClipboardSvc-x11-stubs.cpp

bug is reported upstream and will be fixed in a future version of virtualbox.

temporary fix:

replace "PSHCLFORMATDATA" with "PSHCLFORMATS" at VirtualBox-6.1.6/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp:98



Reproducible: Always

Steps to Reproduce:
1. USE="headless" emerge -v virtualbox
Comment 1 Vedran Vrbanc 2020-04-23 12:24:42 UTC
Created attachment 634186 [details]
ebuild with patch
Comment 2 Vedran Vrbanc 2020-04-23 12:26:12 UTC
Created attachment 634188 [details, diff]
patch file

files/virtualbox-6.1.6-headless-fix.patch
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-04-23 12:44:28 UTC
Can you add the URL to the upstream issue please?
Comment 4 Vedran Vrbanc 2020-04-23 12:53:57 UTC
Created attachment 634190 [details, diff]
revised patch file

fixed patched file path
Comment 5 Vedran Vrbanc 2020-04-23 12:56:05 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #3)
> Can you add the URL to the upstream issue please?

Virtualbox bug reporting policy states that build errors are not submitted as bugs but instead reported to the mailing list.

My report is here, devs responeded: https://www.virtualbox.org/pipermail/vbox-dev/2020-April/015446.html
Comment 6 Thibaud CANALE 2020-05-02 21:27:43 UTC
Created attachment 635756 [details]
Build log (gzip-ed) with provided patch, with "headless" USE flag.

Hello,

Thank you Vedran Vrbanc for this report, the patch you provided through attachment 634190 [details, diff] works, simplify by writing its content under the "/etc/portage/patches" directory; unfortunately the build is unsuccessful, related to another error which should have its own issue.
Full-disclosure:
/var/tmp/portage/app-emulation/virtualbox-6.1.6/work/VirtualBox-6.1.6/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h:58:11: fatal err
or: X11/Xlib.h: No such file or directory
   58 | # include <X11/Xlib.h>
      |           ^~~~~~~~~~~~

But this issue brings another root issue: why does an headless configuration pull a file about a clipboard sharing feature, which looks like related to a graphic environment? I might be wrong, but shouldn’t this file be discarded when headless configuration is set? Isn’t something wrong with the configuration part?

Anyway, here the log of the (failed) build, as you can see the user patch is applied, and the main error is fixed (the file VBoxSharedClipboardSvc-x11-stubs.cpp is compiled without issue):
================================
 * Applying renamed_PSHCLFORMATDATA.patch ...
patching file src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp
Hunk #1 succeeded at 95 with fuzz 1.
 [ ok ]
 * User patches applied.
================================

Best regards,
Comment 7 Vedran Vrbanc 2020-05-04 08:04:18 UTC
(In reply to Thibaud "thican" CANALE from comment #6)

It compiled on my system but only because I had libX11 and other stuff installed already. Your issue probably predates virtualbox-6.1.6.

I have tried emerging virtualbox on a clean gentoo system and it looks like virtualbox now needs additional dependencies, even if it does not use a GUI.

required dependencies:

media-libs/libglvnd
x11-libs/libX11
x11-libs/libXext
x11-libs/libXmu
x11-libs/libXrender
x11-libs/libXt


package.use:
app-emulation/virtualbox headless -qt5
media-libs/libglvnd X

If you emerge those manually, and set the above use flags, it should compile.

I see that most of these dependencies are pulled in non-headless builds, so maybe some older version of VirtualBox didn't require these for a headless build, but now it does. I tried to compile it manually and disabled pretty much everything in the ./configure script, including opengl, but still it wanted GL/glx.h, Xlib.h + others. 

I will dig a bit more and see if this can be made to work without X11/GL stuff, but that should probably be fixed upstream. A quick and dirty fix would be to just add above dependencies as hard dependencies to the ebuild.
Comment 8 Thibaud CANALE 2020-05-04 10:33:42 UTC
(In reply to Vedran Vrbanc from comment #7)
../..
> I will dig a bit more and see if this can be made to work without X11/GL
> stuff, but that should probably be fixed upstream. A quick and dirty fix
> would be to just add above dependencies as hard dependencies to the ebuild.

Thanks for your answer, but I think it’s better (I guess Gentoo’s devs will agree) to report those information in the dedicated bug 720736, and to keep this ticket to its main root issue.

I agree it is possible to make it compiling and running by providing the required dependencies, however as you said this is something which should be fixed upstream.

For conclusion, this subject should be move to the bug 720736. Thanks again for your research.
If you agree, I can copy your last comment.

Best regards.
Comment 9 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-06-15 12:52:00 UTC
Still an issue with virtualbox-6.1.10?
Comment 10 Vedran Vrbanc 2020-06-15 14:16:32 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #9)
> Still an issue with virtualbox-6.1.10?

+headless works for me on 6.1.10-r1
Comment 11 Thibaud CANALE 2020-06-16 20:43:30 UTC
Created attachment 645002 [details]
Build log (gzip-ed) without user patch from comment 4.

Hello,

I disagree, I think there is still some issues with VirtualBox 6.1.6 and the headless flag, specially about this issue about "PSHCLFORMATDATA".
I just tried to compile this version without user patch from comment 4, I still have the same issue (see new attachment):
/var/tmp/portage/app-emulation/virtualbox-6.1.6/work/VirtualBox-6.1.6/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-x11-stubs.cpp:98:42: error: ‘PSHCLFORMATDATA’ has not been declared
   98 |                                          PSHCLFORMATDATA pFormats)
      |                                          ^~~~~~~~~~~~~~~

With the user patch, I meet the issue described in bug 720736.

Just because it (might) work(s) with version 6.1.10 as you asked (spoiler alert, it doesn't) and because this version, 6.1.6, is still in Portage tree, I don't think this bug should be considered as fixed.

I guess this user patch is missing from your archive of patchsets for this version, but I still think this is not enough for fixing this build on an headless system.

Please reopen this bug until the user patch is provided from ebuild.

Thanks.