Bug 230204 - emulators/qemu 2.12.0 fails to build with option DOCS disabled, unless pass disable-docs to configure
Summary: emulators/qemu 2.12.0 fails to build with option DOCS disabled, unless pass d...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
: 234400 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-30 23:09 UTC by dewayne
Modified: 2020-09-05 16:02 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments
fix port when docs are disabled (1.74 KB, patch)
2018-08-29 08:24 UTC, Steven Hartland
no flags Details | Diff
fix build without docs while still building man pages (870 bytes, patch)
2018-11-04 19:27 UTC, guyyur
no flags Details | Diff
patch for 4.2.1 (1.76 KB, patch)
2020-08-18 08:27 UTC, Roman Bogorodskiy
no flags Details | Diff
fix qemu-ga.8 location for NOPORTDOCS (525 bytes, patch)
2020-08-18 16:20 UTC, guyyur
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2018-07-30 23:09:33 UTC
With these options
# make -C /usr/ports/emulators/qemu showconfig|grep =on
     CDROM_DMA=on: IDE CDROM DMA
     GNS3=on: gns3 patches (promiscuous multicast)
     NCURSES=on: Console (text) interface support
     PCAP=on: pcap dependency (networking with bpf)
     STATIC_LINK=on: Statically link the executables

a "make clean package" (where WRKDIRPREFIX=/var/ports) results in

perl -Ww -- /var/ports/usr/ports/emulators/qemu/work/qemu-2.12.0/scripts/texi2pod.pl -I docs -I  -I docs "-DVERSION=2.12.0"  docs/qemu-qmp-ref.7.pod && pod2man --utf8 --section=7 --center=" " --release=" " docs/qemu-qmp-ref.7.pod > docs/qemu-qmp-ref.7
No filename or title
gmake[1]: *** [/var/ports/usr/ports/emulators/qemu/work/qemu-2.12.0/rules.mak:387: docs/qemu-qmp-ref.7] Error 255
gmake[1]: Leaving directory '/var/ports/usr/ports/emulators/qemu/work/qemu-2.12.0'
*** Error code 1

I'm afraid the CONFIGURE_ARGS needs some attention to align with the DOCS option being deselected. Unfortunately I cheated and simply changed enable-docs to disable-docs to successfully build the qemu XX package on FreeBSD 11.2-STABLE  r336359M amd64

-               --prefix=${PREFIX} --cc=${CC} --enable-docs --disable-kvm \
+               --prefix=${PREFIX} --cc=${CC} --disable-docs --disable-kvm \

This is different to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196855
Comment 1 dewayne 2018-07-30 23:51:40 UTC
Also modified pkg-plist to build a package successfully,
sed /^man\\/man/d /usr/ports/emulators/qemu/pkg-plist.
Comment 2 Steven Hartland freebsd_committer freebsd_triage 2018-08-29 08:24:58 UTC
Created attachment 196669 [details]
fix port when docs are disabled
Comment 3 dewayne 2018-08-29 17:40:57 UTC
(In reply to Steven Hartland from comment #2)
Thank-you for the simple and elegant solution.  If the maintainer would include, I'd be happy to close :)
Comment 4 guyyur 2018-11-04 19:27:26 UTC
Created attachment 198948 [details]
fix build without docs while still building man pages

I attached a patch to fix patch-Makefile for 2.12.0
It allows building without docs while still building the man pages
Comment 5 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2018-12-18 09:56:37 UTC
disabling DOCS shouldn't exclude man pages unless there are lots of man pages.
Comment 6 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2018-12-31 20:19:57 UTC
*** Bug 234400 has been marked as a duplicate of this bug. ***
Comment 7 guyyur 2019-01-01 18:10:10 UTC
My patch "fix build without docs while still building man pages" doesn't disable the man pages.
It doesn't require passing "--disable-docs"

It rearranges patch-Makefile so the man page qemu-block-drivers.7 will be built even if DOCS is disabled and corrects the paths of qemu-qmp-ref.7 and qemu-ga-ref.7 (the files moved under interop subdir) for the ifdef NOPORTDOCS case.
These three man pages not being built when DOCS is disabled is the cause of the build failure.
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-02-12 21:48:59 UTC
A commit references this bug:

Author: bofh
Date: Tue Feb 12 21:48:13 UTC 2019
New revision: 492812
URL: https://svnweb.freebsd.org/changeset/ports/492812

Log:
  emulators/qemu: Add NETMAP support

  - Build qemu-guest-agent without unused libs [1]
  - Fix build with DOCS disabled [2]

  PR:		232949 [1] 230204 [2]
  Submitted by:	zhecka@gmail.com [1] dewayne@heuristicsystems.com.au [2]
  Reported by:	vmaffione

Changes:
  head/emulators/qemu/Makefile
  head/emulators/qemu/files/patch-Makefile
Comment 9 dewayne 2019-02-13 03:59:30 UTC
(In reply to commit-hook from comment #8)
Thank-you for looking into this problem.  I updated overnight, unfortunately I know receive:
# make -C /usr/ports/emulators/qemu clean package
===>  Cleaning for qemu-2.12.1_2
===>  qemu-2.12.1_2 need to specify gl component with USE_GL.
*** Error code 1

on FreeBSD11.2S (8th Feb). Config information
# make -C /usr/ports/emulators/qemu showconfig |grep =on
     CDROM_DMA=on: IDE CDROM DMA
     NCURSES=on: Console (text) interface support
     PCAP=on: pcap dependency (networking with bpf)
     STATIC_LINK=on: Statically link the executables
Comment 10 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-07-26 02:25:19 UTC
Recently is started failing again:

=>> Building emulators/qemu
build started at Sun Jul 26 05:41:57 +04 2020
port directory: /usr/ports/emulators/qemu
package name: qemu-4.2.1
building for: FreeBSD current-local-job-03 13.0-CURRENT FreeBSD 13.0-CURRENT 1300101 amd64
maintained by: bofh@FreeBSD.org
Makefile ident:      $FreeBSD: head/emulators/qemu/Makefile 542523 2020-07-18 19:41:59Z bofh $

...

---Begin OPTIONS List---
===> The following configuration options are available for qemu-4.2.1:
     CAPSTONE=off: Disassembly framework support
     CDROM_DMA=on: IDE CDROM DMA
     CURL=on: Data transfer support via cURL
     DOCS=off: Build and/or install documentation
     GNUTLS=on: gnutls dependency (vnc encryption)
     GTK3=on: GTK+ 3 GUI toolkit support
     ISCSI=off: libiscsi dependency (iSCSI client for emulated drives)
     JPEG=on: jpeg dependency (vnc lossy compression)
     OPENGL=on: 2D/3D rendering support via OpenGL
     PCAP=on: pcap dependency (networking with bpf)
     PNG=on: png dependency (vnc compression)
     SAMBA=off: samba dependency (for -smb)
     SASL=on: cyrus-sasl dependency (vnc encryption)
     STATIC_LINK=off: Statically link the executables
     USBREDIR=off: usb device network redirection (experimental!)
     VDE=on: vde dependency (for vde networking)
     X11=on: X11 (graphics) support
     X86_TARGETS=off: Build only x86 system targets
====> Console (text) interface support: you have to select exactly one of them
     NCURSES_DEFAULT=on: Depend on ncurses (ports if installed, otherwise base)
     NCURSES_BASE=off: Depend on ncurses in base
     NCURSES_PORT=off: Depend on devel/ncurses in ports
===> Use 'make config' to modify these settings
---End OPTIONS List---

...
gmake[2]: Nothing to be done for 'all'.
gmake[2]: Leaving directory '/wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/slirp'
gmake[2]: Entering directory '/wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/dtc'
gmake[2]: 'libfdt/libfdt.a' is up to date.
gmake[2]: Leaving directory '/wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/dtc'
sh /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/hxtool -t < /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/qemu-options.hx > qemu-options.texi
sh /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/hxtool -t < /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/hmp-commands.hx > qemu-monitor.texi
sh /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/hxtool -t < /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/hmp-commands-info.hx > qemu-monitor-info.texi
sh /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/hxtool -t < /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/qemu-img-cmds.hx > qemu-img-cmds.texi
perl -Ww -- /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/texi2pod.pl -I docs -I . -I . -DVERSION="4.2.1" -DCONFDIR="/usr/local/etc/qemu" qemu-nbd.texi qemu-nbd.8.pod && pod2man --utf8 --section=8 --center=" " --release=" " qemu-nbd.8.pod > qemu-nbd.8
perl -Ww -- /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/texi2pod.pl -I docs -I scripts -I . -DVERSION="4.2.1" -DCONFDIR="/usr/local/etc/qemu" scripts/texi2pod.pl qemu-ga.8.pod && pod2man --utf8 --section=8 --center=" " --release=" " qemu-ga.8.pod > qemu-ga.8
/usr/local/bin/python3.7 -B /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/scripts/qapi-gen.py -o qga/qapi-generated -p "qga-" /wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/qga/qapi-schema.json
No filename or title
gmake[1]: *** [/wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1/rules.mak:394: qemu-ga.8] Error 255
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory '/wrkdirs/usr/ports/emulators/qemu/work/qemu-4.2.1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/emulators/qemu
Comment 11 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-08-18 08:27:13 UTC
Created attachment 217299 [details]
patch for 4.2.1

The attached patch seems to fix this problem for me.
Comment 12 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2020-08-18 09:09:05 UTC
I was actually unable to recreate this problem in a clean system.

http://pdr.bofh.network/data/latest-per-pkg/qemu/4.2.1/

But I will give it another try tonight after upgrading the jails.

And one more thing is so far I know that manpages should be installed irrespective of PORTDOCS. So is the %%PORTDOCS%% really necessary in pkg-plist?
Comment 13 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-08-18 09:52:04 UTC
> I was actually unable to recreate this problem in a clean system.
>
> http://pdr.bofh.network/data/latest-per-pkg/qemu/4.2.1/

I looked at the logs there and all have 'DOCS=on'. To reproduce that, you'll need DOCS=off; it's reproducible for me both in pourdiere with OPTIONS_UNSET=DOCS (which I use for my normal builds) and also locally if I configure qemu with DOCS=off and just do `make clean check-plist`.

I think updating jails should not be required to reproduce this.

> And one more thing is so far I know that manpages should be
> installed irrespective of PORTDOCS.
> So is the %%PORTDOCS%% really necessary in pkg-plist?

Yeah, my patch is definitely not the best approach, and it's a blunt way of fixing things.

There should be a better way to fix this.
Comment 14 guyyur 2020-08-18 16:20:26 UTC
Created attachment 217314 [details]
fix qemu-ga.8 location for NOPORTDOCS

Problem is qemu-ga.8 location changed to $(MANUAL_BUILDDIR)/interop/qemu-ga.8 in 4.2.1.
r542523 fixed the location for "else" section but not for "ifdef NOPORTDOCS" section.
Comment 15 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-08-21 16:09:51 UTC
(In reply to guyyur from comment #14)

This works for me, and looks good too.
Comment 16 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-09-01 02:46:21 UTC
(In reply to guyyur from comment #14)

JFYI: Two weeks has passed since the fix was proposed (2020-08-18), I plan to commit it tomorrow if there'll be no feedback.
Comment 17 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2020-09-01 08:58:28 UTC
Oops. Now there are two patches now. Looks like guyyur@gmail.com's one is a better one? So which one are you proposing to commit ?
Comment 18 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-09-01 08:59:57 UTC
(In reply to Muhammad Moinur Rahman from comment #17)

Yes, guyyur@gmail.com's patch seems better to me too, I think it's the one that needs to be committed.

Thanks
Comment 19 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2020-09-01 09:46:24 UTC
(In reply to Roman Bogorodskiy from comment #18)
I will commit it by tonight. And next time please create a different/new bugs. Somehow this doesn't show up in my buglist. :(
Comment 20 commit-hook freebsd_committer freebsd_triage 2020-09-01 22:27:15 UTC
A commit references this bug:

Author: bofh
Date: Tue Sep  1 22:26:49 UTC 2020
New revision: 547301
URL: https://svnweb.freebsd.org/changeset/ports/547301

Log:
  emulators/qemu: Fix build with OPTION DOCS disabled

  PR:		230204
  Submitted by:	guyyur@gmail.com
  Reported by:	novel

Changes:
  head/emulators/qemu/files/patch-Makefile